Search Ticket via SOAP with Dynamic Field

Moderator: crythias

Locked
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) 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>

Thanks
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Search Ticket via SOAP with Dynamic Field

Post by crythias »

OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
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 »

Thank you crythias! But it didn't help.. my code works fine with all default fields.. the problem is the dynamic field
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Search Ticket via SOAP with Dynamic Field

Post by crythias »

It appears I'm not able to help. I though those links, especially the last one, were explicitly for Dynamic Fields.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
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 »

There is a bug in otrs 3.1.8 version. This problem was solved in the version 3.1.10
Locked