2014-09-23 65 views
0

有一個以前工作的Java Web服務,上週突然中斷。Saber SOAP調用返回空字符串

請求的版本沒有永遠更新,它在版本1.2.7上,當前版本是1.7.5,所以我不確定是否是這個問題。我已經通過代碼進行了調試,並且HTTP頭文件,createSessionRQ和其他一切正常,但Bargain Finder Max調用最終會在解析時拋出SAXException,java.io.IOException: '' For input string: ""。只要我在第一遍嘗試解析傳入消息時就會發生這種情況。所有其他答案都解析得很好。解析代碼全部來自apache axis 1庫。 XML示例如下。再一次,這個工作一直持續到上週。

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
    <SOAP-ENV:Header> 
     <eb:MessageHeader SOAP-ENV:mustUnderstand="1" eb:version="1.0"> 
     <eb:From> 
     <eb:PartyId type="urn:x12.org:IO5:01">company</eb:PartyId> 
     </eb:From> 
     <eb:To> 
     <eb:PartyId type="urn:x12.org:IO5:01">webservices.sabre.com</eb:PartyId> 
     </eb:To> 
     <eb:CPAId>0WPB</eb:CPAId> 
     <eb:ConversationId>convoid</eb:ConversationId> 
     <eb:Service eb:type="OTA">Air Shopping Service</eb:Service> 
     <eb:Action>BargainFinderMaxRQ</eb:Action> 
     <eb:MessageData> 
     <eb:MessageId>mid:0_2014-09-22T21:43:40m</eb:MessageId> 
     <eb:Timestamp>2014-09-22T21:43:40</eb:Timestamp> 
     <eb:TimeToLive>2014-09-22T21:43:40</eb:TimeToLive> 
     </eb:MessageData> 
     <eb:DuplicateElimination/> 
     <eb:Description>Bargain Finder Max Service</eb:Description> 
     </eb:MessageHeader> 
     <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility"> 
     <wsse:BinarySecurityToken>tokenhere</wsse:BinarySecurityToken> 
     </wsse:Security> 
    </SOAP-ENV:Header> 
    <SOAP-ENV:Body> 
     <ns1:OTA_AirLowFareSearchRQ Version="1.2.7" xmlns:ns1="http://www.opentravel.org/OTA/2003/05"> 
      <ns1:POS> 
      <ns1:Source PseudoCityCode="0WPB"> 
      <ns1:RequestorID ID="1" Type="1"> 
     <n 

s1:CompanyName Code="TN">TN</ns1:CompanyName> 

</ns1:RequestorID> 

</ns1:Source> 

</ns1:POS> 

     <ns1:OriginDestinationInformation RPH="1"> 
    <ns1:DepartureDateTime>2014-10-31T00:00:00</ns1:DepartureDateTime> 

    <ns1:OriginLocation LocationCode="BWI"/> 

    <ns1:DestinationLocation LocationCode="MBJ"/> 

     <ns1:TPA_Extensions> 
    <ns1:SegmentType Code="O"/> 

</ns1:TPA_Extensions> 

</ns1:OriginDestinationInformation> 

     <ns1:OriginDestinationInformation RPH="2"> 
    <ns1:DepartureDateTime>2014-11-03T00:00:00</ns1:DepartureDateTime> 

    <ns1:OriginLocation LocationCode="MBJ"/> 

    <ns1:DestinationLocation LocationCode="BWI"/> 

     <ns1:TPA_Extensions> 
    <ns1:SegmentType Code="O"/> 

</ns1:TPA_Extensions> 

</ns1:OriginDestinationInformation> 

     <ns1:TravelPreferences> 
    <ns1:CabinPref Cabin="Y" PreferLevel="Preferred"/> 

     <ns1:TPA_Extensions> 
    <ns1:TripType Value="Return"/> 

</ns1:TPA_Extensions> 

</ns1:TravelPreferences> 

     <ns1:TravelerInfoSummary> 
    <ns1:SeatsRequested>1</ns1:SeatsRequested> 

    <ns1:AirTravelerAvail> 
    <ns1:PassengerTypeQuantity Code="ADT" Quantity="2"/> 



</ns1:AirTravelerAvail> 

</ns1:TravelerInfoSummary> 

     <ns1:TPA_Extensions> 
     <ns1:IntelliSellTransaction> 
    <ns1:RequestType Name="50ITINS"/> 

</ns1:IntelliSellTransaction> 

</ns1:TPA_Extensions> 

</ns1:OTA_AirLowFareSearchRQ> 
</SOAP-ENV:Body> 
</SOAP-ENV:Envelope> 

回答

0

這是一個軸1個問題,你可以升級到軸2或執行以下修改:

應改爲:

CommonHTTPsender是HTTPSender的改進版本。

希望這些信息對您有所幫助。

+0

這樣做。更改axis.jar中的client-configuration.wdll以使用傳輸方法CommonsHTTPSender。還必須包括必要的罐子才能讓它工作。 – czobrisky 2014-10-01 17:26:04