on 09-12-2014 3:22 PM
Hi all,
I am trying to insert multiple records using nested json request body but when I am inserting it using POSTMAN I am getting following error
Binding new entities to existing entities via NavigationProperty is not supported
Following are the artifacts that I am using to do so :
service url : http://server:port/logic/odata/person.xsodata/PersonBean POST
request body :
{
"PERS_ID": 30,
"FIRSTNAME": "TstFNameClient",
"LASTNAME": "TstLNameClient",
"E_MAIL": "TstemailClient@gmail.com",
"AddressBean": [
{
"ADDRESS_ID": 12,
"ADDRESS_TEXT1": "tstadd1client",
"ADDRESS_TEXT2": "tstadd2client",
"CITY": "tstcityclient",
"STATE": "tststateclient",
"COUNTRY": "tstcountryclient",
"ZIP": "12345",
"PERS_ID": 30
}
]
}
OData Service code :
service namespace "cust.quote.service" {
"ZCUSTSEARCH"."TBL_PERSON"
as "PersonBean"
navigates ("Address" as "AddressBean");
"ZCUSTSEARCH"."TBL_ADDRESS"
as "AddressBean";
association "Address" principal "PersonBean"("PERS_ID")
multiplicity "1" dependent "AddressBean"("PERS_ID") multiplicity "*";
}
Hello everybody,
are there any news/ideas regarding this one? I recently started working with the hana cloud platform and xsodata services. I am currently at a point where I have a similar entity releationship as stated by dharmesh and similar requirements: I want to insert a record of a type which contains a nested type.
unfortunately, I encounter the same error mentioned in the above posting:
{
"error": {
"code": "",
"message": {
"lang": "en-US",
"value": "Error processing request stream. Binding new entities to existing entities via NavigationProperty is not supported. NavigationProperty: foobarB"
}
}
}
does anybody have an advice on how to solve this?
thanks in advance,
Jan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jan,
You can have a look at the following thread to see if it fits your situation: https://scn.sap.com/thread/3604817.
It suggests using the $batch option with your XS OData service to group multiple operations in one request.
I don't think that we can use associations with the trial version of HANA because it uses a version that doesn't support them yet.
Neal
Hey Neal,
thanks for the reply, that was helpful.
although i was hoping that providing "deep" entities as an input to an odata create service is possible (event if that would force me to create a custom create EXIT).
Inserting deep entities is possible when using odata services which are exposed by netweaver gateway systems. So why does this not apply to an XSOdata service?
thank you and best regards,
jan
Hi,
I am trying to do something similar using a many-to-many association and have run into the same error. Did you ever find an answer or alternative technique? I see that this question is over a year old and not answered.
Here is my oData service definition:
service {
"yyy.zzz.ComplianceTracker.data::ComplianceModel.Resource"
as "Resources"
navigates ("ToResourceComplianceRequirements" as "ResourceComplianceRequirements")
create events(before "yyy.zzz.ComplianceTracker.services:resourceComplianceRequirements.xsjslib::createResourceBeforeExit")
;
"yyy.zzz.ComplianceTracker.data::ComplianceModel.ComplianceRequirement" as "ComplianceRequirements";
association "ToResourceComplianceRequirements"
principal "Resources"("ID") multiplicity "*"
dependent "ComplianceRequirements"("ID") multiplicity "*"
over "yyy.zzz.ComplianceTracker.data::ComplianceModel.ResourceComplianceRequirement"
principal ("RESOURCE.ID")
dependent ("COMPLIANCE_REQUIREMENT.ID");
}
Here is my request payload:
{
"ID": "0",
"NAME": "",
"DESCRIPTION": "",
"ResourceComplianceRequirements": [{"ID": "1"}]
}
Here is response body:
{
"error": {
"code": "",
"message": {
"lang": "en-US",
"value": "Error processing request stream. Binding new entities to existing entities via NavigationProperty is not supported. NavigationProperty: ResourceComplianceRequirements"
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.