Search Ticket via SOAP with Dynamic Field

English! place to talk about development, programming and coding
Post Reply
fmattos
Znuny newbie
Posts: 18
Joined: 23 Aug 2012, 00:39
Znuny Version: 3.1.8
Real Name: Flavio
Company: student

Search Ticket via SOAP with Dynamic Field

Post by fmattos »

Hello!

I've been trying to use search ticket operation with dynamic fields via soap but it is not working( more than one result is being returned) I've followed the manual... but it' s not working.
When I use the OTRS search user interface, it works fine, just one result is returned instead of many
This is my php code and my xml request and response:

Code: Select all


         <?php
       
       try{
          
           error_reporting(E_ALL);

           $url      = "http://ip/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnector/";
           $myID='123456';
           $Operation = "TicketSearch";
           $client = new SoapClient(null, array('location'  => $url,
                                                'uri'       => "CORE",
                                                'trace'     => 1,
                                                'style'     => SOAP_RPC,
                                                'use'       => SOAP_ENCODED));
           $msg=array(
              new SoapParam('root@localhost', 'ns1:UserLogin'),
              new SoapParam('pass', 'ns1:Password'),
       
                 
             new SoapParam("DynamicField_Test", array('Equals' => $myId))
          );
          
          
          
           $answer = $client->__soapCall($Operation,$msg);
           print_r($answer);

          
          
          print_r($answer);
          
        }catch (Exception $e){
           echo $e->getMessage();
        }
        catch (SoapFault $sf){
           echo $sf->getMessage();
        }
       
    ?>

and this is my xml request and response...

Code: Select all



    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
       xmlns="http://www.otrs.org/TicketConnector/actions">
       <SOAP-ENV:Header />
       <SOAP-ENV:Body>
          <TicketSearch>
             <UserLogin>root@localhost</UserLogin>
             <Password>..</Password>
             <DynamicField_Test>
                <Equals>123456</Equals>
             </DynamicField_Test>
          </TicketSearch>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>



    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
       xmlns:namesp197="http://www.otrs.org/TicketConnector/actions"
       xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
       xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
       <soap:Body>
          <namesp197:TicketSearchResponse>
             <TicketID>10</TicketID>
             <TicketID>9</TicketID>
             <TicketID>8</TicketID>
             <TicketID>7</TicketID>
             <TicketID>6</TicketID>
             <TicketID>5</TicketID>
             <TicketID>4</TicketID>
             <TicketID>3</TicketID>
             <TicketID>2</TicketID>
             <TicketID>1</TicketID>
          </namesp197:TicketSearchResponse>
       </soap:Body>
    </soap:Envelope>


Thanks!
fmattos
Znuny newbie
Posts: 18
Joined: 23 Aug 2012, 00:39
Znuny Version: 3.1.8
Real Name: Flavio
Company: student

Re: Search Ticket via SOAP with Dynamic Field

Post by fmattos »

After version 3.1.9 this problem was solved
Post Reply