Skip to Content
Sep 15, 2013 at 05:13 PM

PUT req. not working with Edm.DateTime - Error while parsing an XML stream


hello All,

I'm trying to do an update request (PUT). However this request fails because : Error while parsing an XML stream

The entity has got a few properties of type Edm.DateTime.

The metadata:

<Property Name="createTime" Type="Edm.DateTime" sap:creatable="false" sap:updatable="false" sap:sortable="false" sap:filterable="false"/

The PUT request:

<d:createTime xmlns:d="" m:type="Edm.String">2013-04-17T08:47:44</d:createTime>

That's strange...Edm.String ? Why is SAPUI5 converting my property to Edm.String? The metadata clearly states that it is of type Edm.DateTime.

I've never said in UI5 or in Gateway that it is a string.

SAP NW Gateway checks if the types are the same. Since they are not the same the error is raised.

Now my call is just a simple one:

var oModel = new sap.ui.model.odata.ODataModel(serviceUrl);...........oModel.submitChanges(.......

So my question is: who worked with DateTime types in a PUT request in an odataModel (not json !!) ?

Some header which must be set ?

Any help will be appreciated.