1

我正在尝试开发一个基于 PHP SOAP 的客户端,它集成了 Sabre(https://developer.sabre.com)酒店可用的通知服务。当我尝试在 SOAPUI 中执行测试服务时,它总是失败并得到以下响应。

    <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
   <s:Header>
      <a:Action s:mustUnderstand="1">http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/fault</a:Action>
      <a:RelatesTo>uuid:e3c5bacc-224b-410a-aef9-eefe5cf5ac8c</a:RelatesTo>
   </s:Header>
   <s:Body>
      <s:Fault>
         <s:Code>
            <s:Value>s:Receiver</s:Value>
            <s:Subcode>
               <s:Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</s:Value>
            </s:Subcode>
         </s:Code>
         <s:Reason>
            <s:Text xml:lang="en-US">Error in deserializing body of request message for operation 'AvailNotif_SubmitRequest'.</s:Text>
         </s:Reason>
         <s:Detail>
            <ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
               <HelpLink i:nil="true"/>
               <InnerException>
                  <HelpLink i:nil="true"/>
                  <InnerException>
                     <HelpLink i:nil="true"/>
                     <InnerException i:nil="true"/>
                     <Message>Instance validation error: '' is not a valid value for TargetEnum.</Message>
                     <StackTrace>at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIOta2010A.Read6_TargetEnum(String s)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIOta2010A.Read510_OTA_HotelAvailNotifRQ(Boolean isNullable, Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderIOta2010A.Read645_Item()
   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer4.Deserialize(XmlSerializationReader reader)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)</StackTrace>
                     <Type>System.InvalidOperationException</Type>
                  </InnerException>
                  <Message>There is an error in XML document (23, 311).</Message>
                  <StackTrace>at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)</StackTrace>
                  <Type>System.InvalidOperationException</Type>
               </InnerException>
               <Message>Error in deserializing body of request message for operation 'AvailNotif_SubmitRequest'.</Message>
               <StackTrace>at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, XmlSerializer serializer, MessagePartDescription returnPart, MessagePartDescriptionCollection bodyParts, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.XmlSerializerOperationFormatter.DeserializeBody(XmlDictionaryReader reader, MessageVersion version, String action, MessageDescription messageDescription, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
   at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeRequest(Message message, Object[] parameters)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace>
               <Type>System.ServiceModel.CommunicationException</Type>
            </ExceptionDetail>
         </s:Detail>
      </s:Fault>
   </s:Body>
</s:Envelope>

编辑:

这是我的 XML 请求

    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:asy="http://htng.org/PWSWG/2007/02/AsyncHeaders" xmlns:add="http://www.w3.org/2005/08/addressing" xmlns:head="http://htng.org/1.3/Header/" xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:ns="http://www.opentravel.org/OTA/2003/05">
   <soap:Header>
      <asy:ReplyTo>
         <!--Optional:-->
         <add:Address></add:Address>
      </asy:ReplyTo>
      <asy:RelatesToCorrelationID>INNTENDER13213</asy:RelatesToCorrelationID>
      <asy:CorrelationID>214A50B2-E62E-4f8b-BD97-62ABE31E15C2</asy:CorrelationID>
      <head:TimeStamp>2015-03-25T09:41:59.982</head:TimeStamp>
      <oas:Security>
         <!--Optional:-->
         <oas:UsernameToken Id="">
            <!--Optional:-->
            <oas:Username>USERNAME</oas:Username>
            <!--Optional:-->
            <oas:Password Type="?">PASSWORD</oas:Password>
         </oas:UsernameToken>
      </oas:Security>
   </soap:Header>
   <soap:Body>
      <ns:OTA_HotelAvailNotifRQ EchoToken="echo" TimeStamp="2015-03-25T09:41:59.982" Target="" Version="3.000" TransactionIdentifier="" SequenceNmbr="" TransactionStatusCode="" PrimaryLangID="" AltLangID="" RetransmissionIndicator="" CorrelationID="214A50B2-E62E-4f8b-BD97-62ABE31E15C2" MessageContentCode="8">
         <!--Optional:-->
         <ns:POS>
            <!--Zero or more repetitions:-->
            <ns:Source AgentSine="" PseudoCityCode="" ISOCountry="" ISOCurrency="" AgentDutyCode="" AirlineVendorID="" AirportCode="" FirstDepartPoint="" ERSP_UserID="" TerminalID="">
               <!--Optional:-->
               <ns:RequestorID URL="http://chetu.com" Type="1" Instance="" ID="10001C00001" ID_Context="crs" MessagePassword="">
                  <!--Optional:-->
                  <ns:CompanyName CompanyShortName="CRS" TravelSector="" Code="MKTSRC" CodeContext="chain" Division="" Department="">INNTERNDER</ns:CompanyName>
               </ns:RequestorID>
               <!--Optional:-->
               <ns:Position Latitude="" Longitude="" Altitude="" AltitudeUnitOfMeasureCode="" PositionAccuracy=""/>
               <!--Optional:-->
               <ns:BookingChannel Type="4" Primary="true">
                  <!--Optional:-->
                  <ns:CompanyName CompanyShortName="CRS" TravelSector="" Code="MKTSRC" CodeContext="chain" Division="" Department="">INNTERNDER</ns:CompanyName>
               </ns:BookingChannel>
            </ns:Source>
         </ns:POS>
         <!--Optional:-->
         <ns:UniqueID URL="" Type="1" Instance="" ID="14069C0001311" ID_Context="crs">
            <!--Optional:-->
            <ns:CompanyName CompanyShortName="CRS" TravelSector="" Code="MKTSRC" CodeContext="chain" Division="" Department="">INNTERNDER</ns:CompanyName>
         </ns:UniqueID>
         <!--Optional:-->
         <ns:AvailStatusMessages ChainCode="" BrandCode="" HotelCode="95057" HotelCityCode="" HotelName="INNTENDER" HotelCodeContext="" ChainName="" BrandName="" AreaID="">
            <!--Zero or more repetitions:-->
            <ns:AvailStatusMessage Override="" BookingLimitMessageType="SetLimit" BookingLimit="5" LocatorID="" BookingThreshold="">
               <!--Optional:-->
               <ns:StatusApplicationControl Start="2016-10-01" Duration="" End="2016-10-07" RatePlanType="13" RatePlanCode="Rack" RatePlanID="" RatePlanQualifier="" PromotionCode="FALL09" PromotionVendorCode="" RatePlanCategory="RACKCAT" InvCodeApplication="" InvCode="C" InvType="C" InvTypeCode="King" IsRoom="" Mon="1" Tue="1" Weds="1" Thur="1" Fri="0" Sat="0" Sun="1" RatePlanCodeType="" RateTier="" AllRateCode="" AllInvCode="true" InvBlockCodeApply="" InvBlockCode="Group1" Override="" QuoteID="" SubBlockCode="" WingIdentifier="">
                  <!--Optional:-->
                  <ns:DestinationSystemCodes>
                     <!--Zero or more repetitions:-->
                     <ns:DestinationSystemCode></ns:DestinationSystemCode>
                  </ns:DestinationSystemCodes>
               </ns:StatusApplicationControl>
               <!--Optional:-->
               <ns:LengthsOfStay ArrivalDateBased="" FixedPatternLength="7">
                  <!--Zero or more repetitions:-->
                  <ns:LengthOfStay Time="3" TimeUnit="Day" OpenStatusIndicator="" MinMaxMessageType="SetMinLOS">
                     <!--Optional:-->
                     <ns:LOS_Pattern FullPatternLOS="4"/>
                  </ns:LengthOfStay>
               </ns:LengthsOfStay>
               <!--Optional:-->
               <ns:BestAvailableRates>
                  <!--Zero or more repetitions:-->
                  <ns:BestAvailableRate LengthOfStayTime="0" LengthOfStayTimeUnit="" RatePlanCode="BAR1" Amount="10.00" CurrencyCode="USD" DecimalPlaces="" TaxInclusive="false"/>
               </ns:BestAvailableRates>
               <!--Optional:-->
               <ns:HurdleRate Amount="100.00" CurrencyCode="USD" DecimalPlaces=""/>
               <!--Optional:-->
               <ns:Delta Amount="10.00" CurrencyCode="USD" DecimalPlaces="" Ceiling="10" MaxSold="3"/>
               <!--Optional:-->
               <ns:UniqueID URL="" Type="16" Instance="" ID="1" ID_Context="crs">
                  <!--Optional:-->
                  <ns:CompanyName CompanyShortName="CRS" TravelSector="" Code="" CodeContext="chain" Division="" Department="">INNTENDER</ns:CompanyName>
               </ns:UniqueID>
               <!--Optional:-->
               <ns:RestrictionStatus Restriction="Master" Status="Open" SellThroughOpenIndicator="" MaxAdvancedBookingOffset="P4DT4H30M" MinAdvancedBookingOffset="P3DT5H"/>
            </ns:AvailStatusMessage>
         </ns:AvailStatusMessages>
      </ns:OTA_HotelAvailNotifRQ>
   </soap:Body>
</soap:Envelope>
4

0 回答 0