Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Team

I tried to resolve the XML Error but i am not getting how to resolve please help me

XML Request
XML
<?xml version="1.0" encoding="UTF-8"?>
<OTA_TourSearchRQ xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05/OTA_TourSearchRQ.xsd"EchoToken=ABC001 TransactionIdentifier=1 TimeStamp=2014-07-30T16:57:00 Version=1.000 Target=Test"><POS><Source><AgentSine>ABC</AgentSine><AgentDutyCode>=DELTAXml</AgentDutyCode><RequestorID> <Type>5</Type> <ID>DELTAXml</ID></RequestorID></Source></POS><SearchCriteria><DestinationPref> <RegionCode>5473</RegionCode></DestinationPref><SearchDateRange> <Start>2014-08-15</Start> <End>2014-08-16</End></SearchDateRange><CustomerCounts> <Code>10</Code> <Quantity>10</Quantity> <Age></Age></CustomerCounts></SearchCriteria></OTA_TourSearchRQ>

when I validate the XML, getting error as below
Errors in the XML document:
    1:  156 Element type "OTA_TourSearchRQ" must be followed by either attribute specifications, ">" or "/>".

please help me to resolve

Thanks with Advance
Sheethal
Posted

1 solution

Try this

XML
<OTA_TourSearchRQ
    xmlns="http://www.opentravel.org/OTA/2003/05"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-        instance"
    xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05/OTA_TourSearchRQ.xsd"
    EchoToken="ABC001"
    TransactionIdentifier="1"
    TimeStamp="2014-07-30T16:57:00"
    Version="1.000 "
    Target="Test">

    <POS>
        <Source>
            <AgentSine>ABC</AgentSine>
            <AgentDutyCode>=DELTAXml</AgentDutyCode>
            <RequestorID>

                <Type>5</Type>              <ID>DELTAXml</ID>
            </RequestorID>
        </Source>
    </POS>

    <SearchCriteria>
        <DestinationPref>

            <RegionCode>5473</RegionCode>
        </DestinationPref>
    <SearchDateRange>
    <Start>2014-08-15</Start>
    <End>2014-08-16</End>
    </SearchDateRange>
        <CustomerCounts>
             <Code>10</Code>
            <Quantity>10</Quantity>

            <Age></Age>
        </CustomerCounts>
    </SearchCriteria>
</OTA_TourSearchRQ>
 
Share this answer
 
Comments
smsheethal 30-Jul-14 8:52am    
Thank you Kumarb

Now it is working. How to fix this type of issue can you advise me
Kumarbs 30-Jul-14 8:56am    
I just gone through your code and find that you missed the opening quotes for Target=Test.
In order to identify the problems, you can create an xml file and open it in browser. If any exceptions available in the code, you won't able to execute the file. The errors reflects in the browser itself.
smsheethal 30-Jul-14 9:02am    
Thanks
Kumarbs 31-Jul-14 0:49am    
Most Welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900