我正在使用soap api在php中开发web应用程序.我有xml format as shown below把请求发送到api但是我在查看xml时遇到了像元素companyname上不允许Trailing solidus这样的错误postman.
<OTA_AirLowFareSearchRQ xmlns="http://www.opentravel.org/OTA/2003/05" ResponseType="OTA" ResponseVersion="1.9.2" Version="1.9.2" AvailableFlightsOnly="true">
<POS>
<Source PseudoCityCode="PCC">
<RequestorID ID="1" Type="1">
<CompanyName Code="TN" />
</RequestorID>
</Source>
</POS>
<OriginDestinationInformation RPH="1">
<DepartureDateTime>2016-03-15T11:00:00</DepartureDateTime>
<OriginLocation LocationCode="KTM"/>
<DestinationLocation LocationCode="DEL"/>
<TPA_Extensions>
<SegmentType Code="O"/>
</TPA_Extensions>
</OriginDestinationInformation>
<TravelPreferences ValidInterlineTicket="true">
<CabinPref PreferLevel="Preferred" Cabin="Y" />
<TPA_Extensions>
<TripType Value="Return" />
<LongConnectTime Min="780" Max="1200" Enable="true" />
<ExcludeCallDirectCarriers Enabled="true" />
</TPA_Extensions>
</TravelPreferences>
<TravelerInfoSummary>
<SeatsRequested>3</SeatsRequested>
<AirTravelerAvail>
<PassengerTypeQuantity Code="ADT" Quantity="2" />
<PassengerTypeQuantity Code="CHD" Quantity="1" />
</AirTravelerAvail>
</TravelerInfoSummary>
<TPA_Extensions>
<IntelliSellTransaction>
<RequestType Name="50ITINS" />
</IntelliSellTransaction>
</TPA_Extensions>
</OTA_AirLowFareSearchRQ>
Run Code Online (Sandbox Code Playgroud)
我用谷歌搜索了错误,但没有找到任何解决方案.我也无法确定错误是什么,所以我需要一些帮助.
当我将鼠标悬停在第5行的十字标志时,我得到错误,例如在元素companyname上不允许使用Trailing solidus,当我将鼠标悬停在第6行时,我会收到错误,例如忽略了意外的结束标记(requestorid).在这里,我无法确定错误说明了什么.我认为它是正确的xml格式.
我今天发生了这种情况,但我需要做的就是将Postman中的响应查看器类型从"HTML"切换到"XML",错误就消失了.这可能发生,因为服务器响应没有适当设置Content-Type标题 - 它来自text/html我,而不是text/xml.