Sabre 取消行程段错误 (OTA_CancelRQ)
Sabre cancel itinerary segments error (OTA_CancelRQ)
我正在尝试通过 Sabre API (OTA_CancelRQ) 取消行程段。
我遵循了 this answer here 并且我可以到达第 3 步 (OTA_CancelRQ)。
- 第一步:SessionCreateRQ
- 第 2 步:GetReservationRQ
- 第 3 步:OTA_CancelRQ
- 第四步:EndTransactionRQ
- 第 5 步:SessionCloseRQ
目前我卡在第 3 步,它总是失败并显示以下错误消息
cvc-elt.1: Cannot find the declaration of element 'OTA_CancelRQ'.
请求数据
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
<From>
<PartyId>sample.url.of.sabre.client.com</PartyId>
</From>
<To>
<PartyId>webservices.sabre.com</PartyId>
</To>
<CPAId>****</CPAId>
<ConversationId>convid</ConversationId>
<Service>OTA_CancelLLSRQ</Service>
<Action>OTA_CancelLLSRQ</Action>
<MessageData>
<MessageId>msgid112</MessageId>
<Timestamp>2020-04-20T09:25:27Z</Timestamp>
<TimeToLive>2020-04-20T09:25:27Z</TimeToLive>
</MessageData>
</MessageHeader>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
<BinarySecurityToken EncodingType="Base64Binary" valueType="String">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTC!ICESMSLB\/CRT.LB!1587378430974!2968!17</BinarySecurityToken>
</Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<OTA_CancelRQ Version="2.0.2">
<Segment Type="entire" />
</OTA_CancelRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
响应数据
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
<eb:From>
<eb:PartyId eb:type="URI">webservices.sabre.com</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="URI">sample.url.of.sabre.client.com</eb:PartyId>
</eb:To>
<eb:CPAId>****</eb:CPAId>
<eb:ConversationId>convid</eb:ConversationId>
<eb:Service>OTA_CancelLLSRQ</eb:Service>
<eb:Action>OTA_CancelLLSRS</eb:Action>
<eb:MessageData>
<eb:MessageId>1447971375167810151</eb:MessageId>
<eb:Timestamp>2020-04-20T10:25:17</eb:Timestamp>
<eb:RefToMessageId>msgid112</eb:RefToMessageId>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTC!ICESMSLB\/CRT.LB!1587378313106!6744!9</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<soap-env:Fault>
<faultcode>soap-env:Client.Validation</faultcode>
<faultstring>ERR.SWS.CLIENT.VALIDATION_FAILED</faultstring>
<detail>
<stl:ApplicationResults xmlns:stl="http://services.sabre.com/STL/v01" status="NotProcessed">
<stl:Error timeStamp="2020-04-20T05:25:17-05:00" type="Validation">
<stl:SystemSpecificResults>
<stl:Message>cvc-elt.1: Cannot find the declaration of element 'OTA_CancelRQ'.</stl:Message>
<stl:ShortText>ERR.SWS.CLIENT.VALIDATION_FAILED</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</detail>
</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>
您似乎错过了命名空间
例如
<OTA_CancelRQ Version="2.0.2" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Segment Type="entire"/>
</OTA_CancelRQ>
修改 soap 请求正文如下:
<SOAP-ENV:Body>
<OTA_CancelRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2.0.2">
<Segment Type="entire"/>
这应该可以解决所面临的问题。
希望对您有所帮助!
谢谢!
我正在尝试通过 Sabre API (OTA_CancelRQ) 取消行程段。
我遵循了 this answer here 并且我可以到达第 3 步 (OTA_CancelRQ)。
- 第一步:SessionCreateRQ
- 第 2 步:GetReservationRQ
- 第 3 步:OTA_CancelRQ
- 第四步:EndTransactionRQ
- 第 5 步:SessionCloseRQ
目前我卡在第 3 步,它总是失败并显示以下错误消息
cvc-elt.1: Cannot find the declaration of element 'OTA_CancelRQ'.
请求数据
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header>
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
<From>
<PartyId>sample.url.of.sabre.client.com</PartyId>
</From>
<To>
<PartyId>webservices.sabre.com</PartyId>
</To>
<CPAId>****</CPAId>
<ConversationId>convid</ConversationId>
<Service>OTA_CancelLLSRQ</Service>
<Action>OTA_CancelLLSRQ</Action>
<MessageData>
<MessageId>msgid112</MessageId>
<Timestamp>2020-04-20T09:25:27Z</Timestamp>
<TimeToLive>2020-04-20T09:25:27Z</TimeToLive>
</MessageData>
</MessageHeader>
<Security xmlns="http://schemas.xmlsoap.org/ws/2002/12/secext">
<BinarySecurityToken EncodingType="Base64Binary" valueType="String">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTC!ICESMSLB\/CRT.LB!1587378430974!2968!17</BinarySecurityToken>
</Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<OTA_CancelRQ Version="2.0.2">
<Segment Type="entire" />
</OTA_CancelRQ>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
响应数据
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
<soap-env:Header>
<eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1">
<eb:From>
<eb:PartyId eb:type="URI">webservices.sabre.com</eb:PartyId>
</eb:From>
<eb:To>
<eb:PartyId eb:type="URI">sample.url.of.sabre.client.com</eb:PartyId>
</eb:To>
<eb:CPAId>****</eb:CPAId>
<eb:ConversationId>convid</eb:ConversationId>
<eb:Service>OTA_CancelLLSRQ</eb:Service>
<eb:Action>OTA_CancelLLSRS</eb:Action>
<eb:MessageData>
<eb:MessageId>1447971375167810151</eb:MessageId>
<eb:Timestamp>2020-04-20T10:25:17</eb:Timestamp>
<eb:RefToMessageId>msgid112</eb:RefToMessageId>
</eb:MessageData>
</eb:MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
<wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/ACPCRTC!ICESMSLB\/CRT.LB!1587378313106!6744!9</wsse:BinarySecurityToken>
</wsse:Security>
</soap-env:Header>
<soap-env:Body>
<soap-env:Fault>
<faultcode>soap-env:Client.Validation</faultcode>
<faultstring>ERR.SWS.CLIENT.VALIDATION_FAILED</faultstring>
<detail>
<stl:ApplicationResults xmlns:stl="http://services.sabre.com/STL/v01" status="NotProcessed">
<stl:Error timeStamp="2020-04-20T05:25:17-05:00" type="Validation">
<stl:SystemSpecificResults>
<stl:Message>cvc-elt.1: Cannot find the declaration of element 'OTA_CancelRQ'.</stl:Message>
<stl:ShortText>ERR.SWS.CLIENT.VALIDATION_FAILED</stl:ShortText>
</stl:SystemSpecificResults>
</stl:Error>
</stl:ApplicationResults>
</detail>
</soap-env:Fault>
</soap-env:Body>
</soap-env:Envelope>
您似乎错过了命名空间
例如
<OTA_CancelRQ Version="2.0.2" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Segment Type="entire"/>
</OTA_CancelRQ>
修改 soap 请求正文如下:
<SOAP-ENV:Body>
<OTA_CancelRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Version="2.0.2">
<Segment Type="entire"/>
这应该可以解决所面临的问题。
希望对您有所帮助!
谢谢!