2021 May 05 3:33 PM
Hi, I am building a JSON request body using postman. I want to insert multiple entities or in other words Deep Insert.
I am using this https://services.odata.org/V4/TripPinService/$metadata for building requests.
This is my request for EntitySet People, which includes navigation property i.e Friends
POST: https://services.odata.org/TripPinRESTierService/(S(xt3fdfsg1vd1qxc2ot1dppka))/People
Request Body:
{
"UserName": "vinaysharmatest",
"FirstName": "Vinay",
"LastName": "Sharma",
"Emails": [
"vinay.sharma1@example.com"
],
"AddressInfo": [
{
"Address": "187 Suffolk Ln.",
"City": {
"Name": "Boise",
"CountryRegion": "United States",
"Region": "ID"
}
}
],
"Friends": [
{
"UserName": "vincentcalabrese",
"FirstName": "Vincent",
"LastName": "Calabrese",
"Emails": [
"Vincent@example.com",
"Vincent@contoso.com"
],
"AddressInfo": [
{
"Address": "55 Grizzly Peak Rd.",
"City": {
"CountryRegion": "United States",
"Name": "Butte",
"Region": "MT"
}
}
],
"Gender": "Male",
"Concurrency": 637556417625349000
}
]
}
and i am getting this
(500 Internal Server Error)
{
"error": {
"code": "",
"message": "Value cannot be null.\r\nParameter name: edmEntityObject"
}
}
2021 May 05 3:34 PM
Thank you for visiting SAP Community to get answers to your questions. Since this is your first question, I recommend that you familiarize yourself with our Q&A Tutorial: https://developers.sap.com/tutorials/community-qa.html, as it provides tips for preparing questions that draw responses from our members. Should you wish, you can revise your question by selecting Actions, then Edit.
By adding a picture to your profile you encourage readers to respond: https://www.youtube.com/watch?v=46bt1juWUUM
Many thanks!
2021 May 05 6:59 PM
Hello,
I've tried the same and also tried deep insert with trips, and getting the same error.
The error is generic and seems to be thrown by the underlying OData library.
I assume that the service implementation does not cover the deep insert.
Your payload looks good to me
If you want to play with other odata services, you may check the GWSAMPLE_BASIC, which should be still available for public testing on demo server ES5
Kind Regards,
Carlos
2021 May 07 10:52 AM