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