Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Travelport uAPI php SOAP客户端_Php_Xml_Soap_Travelport Api - Fatal编程技术网

Travelport uAPI php SOAP客户端

Travelport uAPI php SOAP客户端,php,xml,soap,travelport-api,Php,Xml,Soap,Travelport Api,我需要使用Travelport uAPI开发一个基于PHP的web应用程序。我能够使用函数curl\u init()编写所有xml请求来连接到Web服务,但我一直在尝试使用SoapClient类来实现这一点。 我正在使用此示例,但不起作用: 我不知道我做错了什么。有人知道使用SoapClient类在PHP中运行的示例代码/项目吗?我在网上搜索过,但在PHP中找不到任何东西。(在问题编辑中回答。转换为社区wiki答案。请参阅) OP写道: 最后,实现我的解决方案的方法是使用Travelport测

我需要使用Travelport uAPI开发一个基于PHP的web应用程序。我能够使用函数
curl\u init()
编写所有xml请求来连接到Web服务,但我一直在尝试使用
SoapClient
类来实现这一点。 我正在使用此示例,但不起作用:

我不知道我做错了什么。有人知道使用SoapClient类在PHP中运行的示例代码/项目吗?我在网上搜索过,但在PHP中找不到任何东西。

(在问题编辑中回答。转换为社区wiki答案。请参阅)

OP写道:

最后,实现我的解决方案的方法是使用Travelport测试工具编写xml请求并传递包含xml的字符串

身份验证需要:

$this->credentials["login"]=$user;
$this->credentials["password"]=$pass;
$this->credentials["traceid"]=$traceid; (branchcode)
然后创建soap客户端:

$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']);
这就满足了我的需要:)

现在,我试图在本文中使用SoapClient和WSDL函数传递请求信息


首先,确保您发送的xml请求是有效的。他们有一个非常好的测试实用程序来完成这项工作:因此,请确保您的请求使用该测试实用程序,然后尝试将其带到php代码中。另外,别忘了XML是区分大小写的(因为它我差点自杀:)@Hi@castledom04,您能提供上面解决的示例的完整代码吗?或者您能解释传递给_doRequest()方法的参数吗。