2

I need to develop a PHP web based application using Travelport uAPI. I'm able to connect to the webservice using the function curl_init() writing all xml request, but I'm stuck trying to do it with SoapClient class. I'm using this example and doesn't work:

http://demo.travelportuniversalapi.com/Home/SampleCode

I don't know what I'm doing wrong. Anyone knows a working sample code/project in PHP using SoapClient class? I've searched in the web, but I couldn't find anything in PHP.

gavenkoa
  • 45,285
  • 19
  • 251
  • 303
castledom04
  • 207
  • 2
  • 13
  • 1
    First, ensure that the xml requests you're sending are valid. They have a pretty good test utility to do that: http://developer.travelport.com/euf/assets/developer-network/downloads/Travelport_API_Test_Tool.zip So make sure that your requests are working with that test utility, and then try to bring it to your php code. Also, don't forget that XML is case-sensitive (I almost killed myself because of that :)) – Arman Bimatov Jun 05 '13 at 12:22
  • 2
    Hi @castledom04, can you provide the full code for above SOLVED sample., or can you explain the parameters passed to _doRequest() method. – Venkat Papana Jan 30 '14 at 18:18

1 Answers1

2

(Answered in a question edit. Converted to a community wiki answer. See What is the appropriate action when the answer to a question is added to the question itself? )

The OP wrote:

At last the way to reach my solution has been using the Travelport test tool writing my xml requests and passing a string containing the xml.

Needed for authentication:

$this->credentials["login"]=$user;
$this->credentials["password"]=$pass;
$this->credentials["traceid"]=$traceid; (branchcode)

Then I create the soap client:

$client = new SoapClient("galileo/air_v20_0/Air.wsdl", $this->credentials);
$rsp=$client->__doRequest($this->request, $this->credentials['location'], $this->credentials['soapaction'], $this->credentials['soap_version']);

And this covers my needs :)

Now I'm trying to pass the request info using SoapClient and WSDL functions in this post WSDL functions with the same name. How to choose one?

Community
  • 1
  • 1
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129