4

I am developing web application in php using soap api. I have the xml format as shown below to send the request to the api but I get the error like Trailing solidus not allowed on element companyname while viewing the xml in 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> 

I had googled the error but not found any solution. I also cannot determine what the error say so I need some help.

Screenshot: enter image description here

When I hover to the cross sign in line 5 I get the error like Trailing solidus not allowed on element companyname and when I hover to the line 6 I get error like Unexpected end tag (requestorid) ignored. Here I cannot determined what the error says. I think it's in the correct xml format.

Kiran Subedi
  • 2,244
  • 3
  • 17
  • 34

3 Answers3

6

I had this happen today, but all I needed to do was switch the response viewer type in Postman from "HTML" to "XML" and the errors went away. This probably happened since the server responding did not appropriately set the Content-Type header - it came in as text/html for me instead of text/xml.

jocull
  • 20,008
  • 22
  • 105
  • 149
2

Actually this has connection to self closing tag like <CompanyName Code="TN" />.

Just replace this with <CompanyName Code="TN"></CompanyName> and the error goes away.

Hope this helps.

Mayank Kumar Chaudhari
  • 16,027
  • 10
  • 55
  • 122
-1

Try this way:

<POS>
 <Source PseudoCityCode="ThisShouldBeYourIPCCNotJustPCCasValue">
    <RequestorID ID="1" Type="1">
        <CompanyName Code="TN">TN</CompanyName>
    </RequestorID>
 </Source>
</POS>
fcarreno
  • 701
  • 4
  • 8