Sabre SOAP - wsse:Security - 未绑定
Sabre SOAP - wsse:Security - Not Bound
我正在尝试向 SABRE SOAP 发出 TOken 请求,我正在使用他们的示例,但最后我收到此错误:
<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>
这是我的要求:
<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>
这是 WSDL 文件:http://files.developer.sabre.com/wsdl/sabreXML1.0.00/usg/TokenCreateRQ.wsdl
知道哪里出了问题吗?
试试这个结构。区别在于 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>
错误出现在命名空间声明中,使用声明为 sec
但随后使用 wsse
。
替换:xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext"
随着:xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
作为查看命名空间的简单建议,您可以将 WSDL 导入 SoapUI 并检查自动生成的包含请求的所有可能元素的空白示例。
我正在尝试向 SABRE SOAP 发出 TOken 请求,我正在使用他们的示例,但最后我收到此错误:
<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>
这是我的要求:
<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>
这是 WSDL 文件:http://files.developer.sabre.com/wsdl/sabreXML1.0.00/usg/TokenCreateRQ.wsdl
知道哪里出了问题吗?
试试这个结构。区别在于 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>
错误出现在命名空间声明中,使用声明为 sec
但随后使用 wsse
。
替换:xmlns:sec="http://schemas.xmlsoap.org/ws/2002/12/secext"
随着:xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"
作为查看命名空间的简单建议,您可以将 WSDL 导入 SoapUI 并检查自动生成的包含请求的所有可能元素的空白示例。