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) It is like in the manual.
When I use the OTRS search user interface, it works.
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();
}
?>
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>