返回 javax.xml.soap.SOAPException 的原因:无法从 SOAP API 内部化消息

dja*_*ski 1 xml soap sabre

我正在使用与 Sabre SOAP API 集成的系统。从我的角度来看,它只是将格式正确的 XML(Content-Type标头设置为text/xml)发送到端点,作为响应,我得到另一个 XML。它可以工作,但是偶尔(我们发送的请求的一小部分)我会收到此错误:

要求:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <ns4:MessageHeader xmlns:ns4="http://www.ebxml.org/namespaces/messageHeader" xmlns:ns5="http://www.w3.org/1999/xlink" xmlns:ns6="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:ns7="http://www.opentravel.org/OTA/2002/11" xmlns:ns8="http://www.w3.org/2000/09/xmldsig#">
      <ns4:ConversationId>04f446900386013646690cc47a6a2880</ns4:ConversationId>
      <ns4:From>
        <ns4:PartyId ns4:type="urn:x12.org:IO5:01">999999</ns4:PartyId>
        <ns4:Role/>
      </ns4:From>
      <ns4:To>
        <ns4:PartyId ns4:type="urn:x12.org:IO5:01">123123</ns4:PartyId>
        <ns4:Role/>
      </ns4:To>
      <ns4:CPAId>CPAID</ns4:CPAId>
      <ns4:Service ns4:type="OTA"/>
      <ns4:Action>PassengerDetailsRQ</ns4:Action>
    </ns4:MessageHeader>
    <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext">
      <wsse:BinarySecurityToken EncodingType="wsse:Base64Binary" valueType="String">SECURITY_TOKEN_REMOVED</wsse:BinarySecurityToken>
    </wsse:Security>
  </soap:Header>
  <soap:Body>
    <PassengerDetailsRQ HaltOnError="false" version="3.2.0" xmlns="http://services.sabre.com/sp/pd/v3_2">
      <PostProcessing RedisplayReservation="true">
        <EndTransactionRQ>
          <EndTransaction Ind="true"/>
          <Source ReceivedFrom="APPNAME"/>
        </EndTransactionRQ>
      </PostProcessing>
    </PassengerDetailsRQ>
  </soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)

回复:

<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
  <soap-env:Header/>
  <soap-env:Body>
    <soap-env:Fault>
      <faultcode>soap-env:Client.InvalidEbXmlMessage</faultcode>
      <faultstring>Unable to internalize message</faultstring>
      <detail>
        <StackTrace>javax.xml.soap.SOAPException: Unable to internalize message</StackTrace>
      </detail>
    </soap-env:Fault>
  </soap-env:Body>
</soap-env:Envelope>
Run Code Online (Sandbox Code Playgroud)

我一直在寻找对这javax.xml.soap.SOAPException: Unable to internalize message代表什么情况的人类描述,但我没有发现任何有用的东西。

我的假设是 - 请求在第一层被拒绝,因此业务层尚未处理它,因此当我收到此错误时我可以重新发送。我对吗?

我浏览了失败的请求,它们与我们发送的其余请求一样 - 所以我想这不是因为正文无效。

小智 5

我认为您的内容类型不正确。更改内容类型:text/xml