cancel
Showing results for 
Search instead for 
Did you mean: 

Error while parsing an XML stream

former_member184238
Participant
0 Kudos

Hi,

I have done one application with create operation(deep insert)  in both mobile and desktop.

For desktop application I am using oData model and for mobile application I am using JSON Model. create operation is working fine in browser application but not in mobile.

when I am doing create operation in mobile I am getting the following error in console.


CX_SXML_PARSE_ERROR/001560AA0E081DEB8CA398CC1690D406Error while parsing an XML streamC47931E35B06F1249B1D20CF30C48576


when I am passing post request with some data as object and it's not triggering back end. But for my desktop application it's working fine.

I even tested the passing data in both applications and both are same.

Please help me to solve this issue.

Thanks&Regards

Sridevi.G

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

I met the "xml-parse-stream-error", too.

Maybe it helps:

When you send a number with your request, you must do a

          parseInt() 

in your javascript.

Greetz

jmoors
Active Contributor
0 Kudos

When you say you have tested the data in both applicatiosn and they are the same, are you checking the actual HTTP post data (via Chrome developer tools etc) as I would expect the format to be different i.e. one in oData and the other in JSON, as it might not be the actual data but the format of the overall post.

I would check that the information being sent is in the correct format for the backend etc to consume, or the backend is configured correctly.

Also, maybe a stupid question, but why are you using two different formats, if it's the same application, just for different device types, why wouldn't use the same data source for both?

Regards,

Jason

0 Kudos

Hi Garapati,

we met the same issue, we found a note below for the issue:

1751991 - OData Channel - Deep Insert in JSON Format Leads to Error

Hope this can help others who met the same issue.

Former Member
0 Kudos

Hi Jone,

This Note is as per release 240, but we are using release 740.

In that note corrections are there already, but still we are getting the same error.

Please suggest.

Thanks,

Saurabh

0 Kudos

Hi Saurabh,

if your release is 740 and you are using the deep insert with json format, please try to input all the fields with value for the subobject: example, deep insert PO with PI, we give all the values to the PI fields: like "Priority" : "123". then the json parser will be working fine.

Hope this can help you.

Best Regards

Jone Sun

Former Member
0 Kudos

Hi Jone,

Thanks for the quick response.

I have tried with values passed to all the fields. Still is showing the same error.

This is the data I have passed. I have Header as manager and its name and complex structure as Employee, name and manager.

I have passed all the values. Still Showing the parsing error.

Please guide.

Thanks,

Saurabh

0 Kudos

Hi Saurabh,

I think you can use gateway client for testing first: tcode SEGW, then get the payload for deep insert with expand command, the payload you use for deep insert should as below:

{

    "Managerno" : "00000018",

    "Name" : "MMMm",

   "ManagertoEmpSet" :

    [

      {

          "Ename" : "EEE",

          "Employeemo" : "00000016",

          "Manager" : "00000018"\

        }

      ]

}

if you have passed all the fields with value, the error still happened, then you can use the Error log function to check what was happened,with tcode /IWFND/ERROR_LOG, you can check the call stack and the error details, you can also set a external break point in the class /IWCOR/CL_DS_HDLR_ROOT method /IWCOR/IF_REST_HANDLER~HANDLE, then set a break point at statement "RAISE", you can check where the error happened.

please also check if all the field names are correct.

Best Regards

Jone Sun

Former Member
0 Kudos

Hi Jone,

Thanks, Issue resolved by removing results from the request

former_member226851
Participant
0 Kudos

Hi Saurabh,

That's a good point! I had a very similar problem, nevertheless when I removed 'results' from a sending request path, I managed to send it without any error.

It seems, that 'results' exist only within a path when data is received, when data is sent there is no 'results' within path.

Best regards,

Tomasz Sobkowiak

Former Member
0 Kudos

Hi Tomasz,

It's true. I checked it in debugging also , we got error while reading results tag while parsing.

Thanks,

Saurabh

Former Member
0 Kudos

Hi,

I've got the same error message.

Can you show me an example how you resolved it?

Thank you in advance,

Julia