Skip to Content

"Error while parsing XML stream" while updating oData entity

Nov 11, 2016 at 12:02 PM


avatar image
Former Member

Dear experts,

we are trying to build a Fiori App which is updating product assignments to Appointments.

When we try to update the newly created entity, we receive an "Error while parsing XML stream".

This is the coding from the App:

Populate the data:

var headerGuid = oController.oModel.getProperty(oController.Context).Guid;
 var data = oController.byId("productBasketEdit").getModel("json").getData();
 if (data && data.hasOwnProperty("Products"))
 productBasketData.Products = data.Products;
 // var headerGuid = this.headerGuid;
 var i = 0;
 var length = oSelectedItems.length;
 var oListItem;
 for (i = 0; i < length; i++) {
 oListItem = oSelectedItems[i];
 var tempObject = oListItem.getBindingContext("json").getObject();
 var pushObject = {
 HeaderGuid: headerGuid,
 ItemGuid: "00000000-0000-0000-0000-000000000001", // Hardcoded for time being. Try to save only 1 product for now
 ProductGuid: tempObject.ProductGuid,
 ProductId: tempObject.ProductId,
 ProductName: tempObject.ProductDescription,
 ProcessingMode: "A" // Hardcoded for time being. Try to save only 1 product for now
 var productBasketModel = new sap.ui.model.json.JSONModel(productBasketData);
 oController.byId("productBasketEdit").setModel(productBasketModel, "json");

The request itself is looking fine when we check it in the Chrome browser, but still we are getting the XML parsing error.

First question: Why is this an XML parsing error when we are actually using json?

Second question: Where could this problem be originating? On the App side or on the OData side? Any ideas on the solution?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers