【发布时间】:2019-07-24 14:38:08
【问题描述】:
我是 SOAP 世界的新手,我想知道如何向 sabre 服务器发出请求,但我没有成功,我需要帮助才能发出以下请求。
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Header>
<eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="1.0">
<eb:From>
<eb:PartyId>Client</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId>SWS</eb:PartyId>
</eb:To>
<eb:CPAId>3DBJ</eb:CPAId>
<eb:ConversationId>MyConversationID</eb:ConversationId>
<eb:Service>Service</eb:Service>
<eb:Action>getReservationRQ</eb:Action>
<eb:MessageData>
<eb:MessageId></eb:MessageId>
<eb:Timestamp></eb:Timestamp>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility">
<wsse:BinarySecurityToken>Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESE!ICESMSLB\/RES.LB!1</wsse:BinarySecurityToken>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns7:GetReservationRQ xmlns:ns7="http://webservices.sabre.com/pnrbuilder/v1_15" Version="1.15.0">
<ns7:Locator>JXJ</ns7:Locator>
<ns7:RequestType>Stateful</ns7:RequestType>
<ns7:ReturnOptions UnmaskCreditCard="true">
<ns7:SubjectAreas>
<ns7:SubjectArea>PRICING_INFORMATION</ns7:SubjectArea>
</ns7:SubjectAreas>
</ns7:ReturnOptions>
</ns7:GetReservationRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
这是我在邮递员中发送的 XML,它会生成一个结果,但是当我在 PHP 中执行此操作时会生成一个错误。
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://webservices.havail.sabre.com' : Document is empty
$client = new SoapClient("https://webservices.havail.sabre.com");
$checkVatParameters =array(
'BinarySecurityToken' => 'Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESE!ICESMSLB\/RES.LB!',
'Locator' => 'JXJ',
'RequestType'=>'Stateful',
'SubjectArea'=>'PRICING_INFORMATION'
);//variables
$result=$client->__getFunctions();
$result = $client->GetReservationRQ($checkVatParameters);
echo "REQUEST:\n" . $client->__getLastRequest() . "\n";
}
他们只给了我一个 URL,但它问我 WDSL
【问题讨论】:
-
从错误消息中我会说webservices.havail.sabre.com 没有 SOAP API。也许您需要使用测试 xml 中的服务 url 启动客户端? (webservices.sabre.com/pnrbuilder/v1_15)
-
谢谢,如果我添加了命名空间路径和页面链接并给出了答案
标签: php xml web-services soap sabre