Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Lucia_na

XML e ASP

Recommended Posts

Bom Tarde pessoal!

 

Não estou conseguindo carregar um xml gerado em asp. Da Erro.

Se eu carregar esse xml genuino, por exemplo em pg html, funciona mas se eu carregar em Asp nao.

Alguém sabe pq isso ocorre e o que pode ser feito?

 

Obrigada

 

Luciana

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ola...

Ja vou postar meu codigo asp com o xml, pra entender em seguinda vai o erro dai.

 

ASP
str = "<?xml version=""1.0"" encoding=""iso-8859-1""?>"

            str = str & " <bookingRequest requestType=""bookingRequest"">"

            str = str & "     <requestAuditInfo> "

            str = str & "         <agentCode>SUD002</agentCode> "

            str = str & "         <requestPassword> 95E88T93M48A80S11W48</requestPassword> "

            str = str & "         <requestID>1236598</requestID> "

            str = str & "         <requestTime>2007-11-12T15:41:01</requestTime> "

            str = str & "     </requestAuditInfo> "      

            str = str & " <bookingHeader> "

            str = str & "     <yourReference>REF1234</yourReference> "

            str = str & "     <currencyCode>EUR</currencyCode> "

            str = str & "     <bookingItems> "

            str = str & "         <bookingItem> "

            str = str & "             <bookingItemNumber>1</bookingItemNumber> "

            str = str & "             <productCode>CAG733600</productCode> "

            str = str & "             <serviceDate>2007-11-25</serviceDate> "

            str = str & "             <leadName> "

            str = str & "                 <title>MS</title> "

            str = str & "                 <firstName>A</firstName> "

            str = str & "                 <secondName>BEECY</secondName> "

            str = str & "             </leadName> "

            str = str & "             <immediateConfirmationRequired>true</immediateConfirmationRequired> "

            str = str & "             <hotelBookingDetail> "

            str = str & "                 <nights>1</nights> "

            str = str & "                 <subProducts> "

            str = str & "                     <subProduct> "

            str = str & "                         <subProductCode>00001</subProductCode> "

            str = str & "                         <subProductQuantity>1</subProductQuantity> "

            str = str & "                         <roomingList> "

            str = str & "                             <room> "

            str = str & "                                 <roomNumber>1</roomNumber> "

            str = str & "                                 <paxNames> "

            str = str & "                                     <paxName> "

            str = str & "                                         <title>MS</title> "

            str = str & "                                         <firstName>A</firstName> "

            str = str & "                                         <secondName>BEECY</secondName> "

            str = str & "                                     </paxName> "

            str = str & "                                     <paxName> "

            str = str & "                                         <title>MS</title> "

            str = str & "                                         <firstName>B</firstName> "

            str = str & "                                         <secondName>BEECY</secondName> "

            str = str & "                                     </paxName> "

            str = str & "                                 </paxNames> "

            str = str & "                             </room> "

            str = str & "                         </roomingList> "

            str = str & "                     </subProduct> "

            str = str & "                 </subProducts> "

            str = str & "                 <preferences/> "

            str = str & "             </hotelBookingDetail> "

            str = str & "         </bookingItem> "

            str = str & "     </bookingItems> "

            str = str & " </bookingHeader> "    

            str = str & " </bookingRequest> "

 

O erro que ocorre é o seguinte:

<error>

<errorCode>001</errorCode>

<errorText>XML is not well formed: Error during parsing:: Content is not allowed in prolog.</errorText>

<errorSolution>Modify the XML. Ensure that the XML is well formed before resending.</errorSolution>

</error>

 

Obrigada

 

Luciana

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.