Hi,
I'm trying to update a record in the new SAP demo System using OData and Json and receive errors.
The first error is "Value 2014-03-11T13:01:02Z does not represent a valid date/time" as response to the following request:
POST https://sapes4.sapdevcenter.com/sap/opu/odata/IWBEP/GWDEMO/ProductCollection HTTP/1.1
Cookie: SAP_SESSIONID_ES4_800=<SessionID>;
X-CSRF-Token: <CSRF-Token>
Content-Type: application/json; charset=utf-8
Host: sapes4.sapdevcenter.com
Expect: 100-continue
Content-Length: 693
{
"ProductName": "Notebook Basic 15",
"ChangedAt": "2014-03-11T13:01:02Z",
"TaxTariffText": null,
"ProductID": "HT-1000",
"DimensionUnit": null,
"WeightUnitText": null,
"UnitPrice": 95600.0,
"ProductKey": "FF15FF203",
"WeightMeasure": 0.0,
"ProductWidth": 0.0,
"DimensionUnitText": null,
"SupplierID": null,
"ProductDescription": null,
"ProductCategory": null,
"TaxTariffCode": 0,
"QuantityUnit": null,
"ProductTypeCode": null,
"QuantityUnitText": null,
"WeightUnitCode": null,
"SupplierName": "0100000000",
"CurrencyCode": null,
"ProductHeight": 0.0,
"CurrencyText": null,
"ProductDepth": 0.0,
"SupplierGuid": null
}
If I then play around with the date-format (for example omit the "Z" in the date string), I get "Error while parsing an XML stream" as response to the following request (note, that I'm using Json!):
POST https://sapes4.sapdevcenter.com/sap/opu/odata/IWBEP/GWDEMO/ProductCollection HTTP/1.1
Cookie: SAP_SESSIONID_ES4_800=7iFTONEanHtP4tr6RZtBvzOg-q3hMxHlvqwAUFaiFrg%3d;
X-CSRF-Token: Ha1u0NVPHG9DyEapG1vU8Q==
Content-Type: application/json; charset=utf-8
Host: sapes4.sapdevcenter.com
Expect: 100-continue
Content-Length: 692
{
"ProductName": "Notebook Basic 15",
"ChangedAt": "2014-03-11T13:01:02",
"TaxTariffText": null,
"ProductID": "HT-1000",
"DimensionUnit": null,
"WeightUnitText": null,
"UnitPrice": 95600.0,
"ProductKey": "FF15FF203",
"WeightMeasure": 0.0,
"ProductWidth": 0.0,
"DimensionUnitText": null,
"SupplierID": null,
"ProductDescription": null,
"ProductCategory": null,
"TaxTariffCode": 0,
"QuantityUnit": null,
"ProductTypeCode": null,
"QuantityUnitText": null,
"WeightUnitCode": null,
"SupplierName": "0100000000",
"CurrencyCode": null,
"ProductHeight": 0.0,
"CurrencyText": null,
"ProductDepth": 0.0,
"SupplierGuid": null
}
Any ideas what's wrong here and how to solve it?
Thanks a lot
Michaela