cancel
Showing results for 
Search instead for 
Did you mean: 

Error while parsing an XML stream (CX_SXML_PARSE_ERROR)

Former Member
0 Kudos

Hi Gurus,

Thanks in advance,

I have created sap ui 5 application in this i am able to get data but when i tring  to sent data using post method data i got 500 Internal Error .

I am using this this code

OData.request

    ({

        requestUri: 

                   "proxy/http/gw_address:port/sap/opu/odata/sap/ZGW_MATERIAL_SRV/Material",              

                 method: "POST",  

                 data : MaterialContent ,

                 headers: {

                           'x-requested-with':  'XMLHttpRequest',

                           'X-CSRF-Token': xcsrfToken,

                       'Content-Type': 'application/atom+xml',                     

                       'sap-user':'gw_admin',

                       'sap-password':'welcomepass1',

                    'sap-client':'001'

                                         }   },  

               function (data, response) 

                {  

                        alert("Success Post"+data.results[0].Delivery);

                                                },function (err)

                       { 

                          alert(" Fail Post "+err.message);

                     } ); 

       

i got param value in Fire fox and i tried to sent throught RestClient then i got

<?xml version="1.0" encoding="utf-8" ?>

- <error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">

  <code>CX_SXML_PARSE_ERROR/001560AA0E081DEB8CA398CC1690D406</code>

     <message xml:lang="en">Error while parsing an XML stream</message>

  - <innererror>

  <transactionid>5253987096C4295DE1000000C0A800CF</transactionid>

  <errordetails />

</innererror>

</error>


I am waiting for your response

With Regrads

Surendra Suryawanshi

Accepted Solutions (0)

Answers (1)

Answers (1)

midhun_vp
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Midhun

Atually I am passing the below Request body(payload) that is not working in sapui5 application:

<a:entry xmlns:a="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"><a:author><a:name/></a:author><a:content type="application/xml"><m:properties><d:Status m:type="Edm.String">n</d:Status><d:Requantity/><d:Quantity/><d:Material/><d:Customer/><d:Delivery/></m:properties></a:content></a:entry>

but my old program param in that i passing the below request body that is working fine in javascript with datajs.1.0.3.js:

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><author><name/></author><title/><content type="application/xml"><m:properties xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><d:Status xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">y</d:Status><d:Requantity xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">1</d:Requantity><d:Quantity xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">1.000</d:Quantity><d:Material xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">AUTO/A2C6000</d:Material><d:Customer xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">1231</d:Customer><d:Delivery xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">80000243</d:Delivery></m:properties></content></entry>

this working .

but frist one is giving error

Plz help me .

Thanks in advance