[英]Sabre SOAP - wsse:Security - Not Bound
I am trying to make a TOken request to the SABRE SOAP, I am using their examples but at the end I get this error:我正在尝试向 SABER SOAP 发出令牌请求,我正在使用他们的示例,但最后我收到此错误:
<faultstring>Unable to create envelope from given source: Error on line 19 of document : The prefix "wsse" for element "wsse:Security" is not bound. Nested exception: The prefix "wsse" for element "wsse:Security" is not bound.</faultstring>
This is my request:这是我的要求:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:mes="http://www.ebxml.org/namespaces/messageHeader" xmlns:web="http://webservices.sabre.com">
<soapenv:Header>
<mes:MessageHeader mes:version="1">
<mes:From>
<mes:PartyId>Client</mes:PartyId>
</mes:From>
<mes:To>
<mes:PartyId>SWS</mes:PartyId>
</mes:To>
<mes:CPAId>DCG</mes:CPAId>
<mes:ConversationId>123</mes:ConversationId>
<mes:Service>Session</mes:Service>
<mes:Action>TokenCreateRQ</mes:Action>
<mes:MessageData>
<mes:MessageId>1234</mes:MessageId>
<mes:Timestamp>2015-01-01T00:00:00</mes:Timestamp>
</mes:MessageData>
</mes:MessageHeader>
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>USER</wsse:Username>
<wsse:Password>PASSWORD</wsse:Password>
<Organization>PCC</Organization>
<Domain>DOMAIN</Domain>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<web:TokenCreateRQ Version="1.0.0"/>
</soapenv:Body>
</soapenv:Envelope>
and this is the WSDL file: http://files.developer.sabre.com/wsdl/sabreXML1.0.00/usg/TokenCreateRQ.wsdl这是 WSDL 文件: http://files.developer.sabre.com/wsdl/sabreXML1.0.00/usg/TokenCreateRQ.ZDD3BDA2F13F14AEF6CC0EDE06064E
Any idea what is wrong?知道有什么问题吗?
Try this structure.试试这个结构。 The difference are namespaces under Security.
不同之处在于安全性下的命名空间。
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility">
<wsse:UsernameToken>
<wsse:Username>${#TestCase#Username}</wsse:Username>
<wsse:Password>${#TestCase#Password}</wsse:Password>
<Organization>${#TestCase#CPAId}</Organization>
<Domain>${#TestCase#Domain}</Domain>
</wsse:UsernameToken>
</wsse:Security>
The error is on the namespace declaration, used declared as sec
but then used wsse
.错误出现在命名空间声明上,使用声明为
sec
但随后使用wsse
。
Replace: xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext"
替换:
xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext"
With: xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
与:
xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
As a simple recommendation for looking into namespaces, you can import the WSDL into SoapUI and check the blank example auto-generated with all the possible elements for the request.作为查看命名空间的简单建议,您可以将 WSDL 导入 SoapUI 并检查自动生成的空白示例以及请求的所有可能元素。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.