cancel
Showing results for 
Search instead for 
Did you mean: 

Error while parsing an XML stream

Former Member
0 Kudos

Hi all,

Iam trying an OData model create method.

This is my sample code,

onInit: function() {

  this._oView = this.getView();

  this.oModel = new sap.ui.model.odata.ODataModel("myurl", "true","myuserid","mypassword");

  this._oView.setModel(this.oModel);

  },

// On save button

handleSavePress: function() {

  var emp = this.oView.byId("empId").getValue();

  var name = this.oView.byId("nameId").getValue();

  var city = this.oView.byId("cityId").getValue();

  var obj = {};

  obj.Id = emp;

  obj.Name = name;

  obj.City = city;

  this.oModel.create("/mycreateSet",obj,null,

  function(){

  alert("Created Sucessfully");

  },

  function(){

  alert("Error while creating");

  }

  );

  },

while executing this code i'm getting an error in console as,

2015-08-27 11:29:06 [index.html] The following problem occurred: HTTP request failed400,Bad Request,{"error":{"code":"CX_SXML_PARSE_ERROR/001560AA0E081DEB8CA398CC1690D406","message":{"lang":"en","value":"Error while parsing an XML stream"},"innererror":{"transactionid":"55DCDC6D9FA63438E1000000C0A80103","timestamp":"20150827055102.2783640","Error_Resolution":{"SAP_Transaction":"Run transaction /IWFND/ERROR_LOG on SAP NW Gateway hub system and search for entries with the timestamp above for more details","SAP_Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"},"errordetails":[]}}} -

Please help me on this.

Thanks in advance,

Sathish

Accepted Solutions (1)

Accepted Solutions (1)

santhu_gowdaz
Active Contributor

May be wrongly passing some data. check with your metadata Properties type.

  obj.Id = emp;//If type is integer then you can't pass string values.

  obj.Name = name;

  obj.City = city;

Former Member
0 Kudos

Hi Santhosh,

Ya my id is of type integer.

I have changed that.

Now its working.

Thank you santhosh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Can you share the error in  /IWFND/ERROR_LOG or get the Request payload data from the HTTP trace of the browser?

Regards,
Vijay

Former Member
0 Kudos

Hi Vijay,

I have already shared the error in my question.

Thanks

Sathish