Travelport uAPI php SoapClient



我需要使用Travelport uAPI开发一个基于PHP Web的应用程序。我能够在编写所有 xml 请求curl_init()使用该函数连接到 Web 服务,但我无法尝试使用SoapClient类来做到这一点。我正在使用此示例并且不起作用:

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

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

(在问题编辑中回答。 转换为社区维基答案。请参阅将问题的答案添加到问题本身时,适当的操作是什么?)

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 函数在这篇文章中传递请求信息,WSDL 函数具有相同的名称。如何选择一个?