Search code examples
soapsabre

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:

  <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

Any idea what is wrong?


Solution

  • 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>