Skip to Content
0

POST Operation using OData Adapter in HCI

Nov 25, 2016 at 09:31 AM

921

avatar image

Dear All.

I'm using Odata adapter in receiver end,

and the oData receiver channel configuration

in content modifier payload is

when i execute the flow getting below error.

LastError = com.sap.gateway.core.ip.component.odata.exception.OsciException: Bad Request : 400 : HTTP/1.1 http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> xml:lang="en">Must be an entity set instead of an entity: 'Invoices'. , cause: com.sap.gateway.core.ip.component.odata.exception.OsciException: Bad Request : 400 : HTTP/1.1 http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> xml:lang="en">Must be an entity set instead of an entity: 'Invoices'.

but when i execute the same payload the REST API client tool it's posted successfully,

same payload : REST API client tool result.

may i know why i 'm getting an above error. do we need to go for client certificate authentication since my target url is https?

Regards

Ramesh

1.png (19.9 kB)
2.png (27.4 kB)
3.png (20.5 kB)
3.png (28.6 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Sriprasad Shivaram Bhat Nov 25, 2016 at 09:55 AM
0

Hello Ramesh,

Its better to have one to one mapping after content modifier to avoid issues w.r.t input payload.

You can use the XSD in mapping which is generated using Model operation of the OData Channel for the Entity to which you are trying to POST the data.

Regards,

Sriprasad Shivaram Bhat

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks for your reply

you mean one to one mapping by using xsd, i can see many entity in my src.main.resources.wsdl.

5.png (38.0 kB)
0
avatar image
Former Member Nov 25, 2016 at 09:50 AM
0

Hi Ramesh,

Seems the payload is the culprit. can you check on that part.

Regards,

Vijay

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thank for reply.

the payload which is place in API tool same payload i placed in content modifier's body. but in API toll it's working whereas in my flow throwing that error.

is my payload were i'm placing in content modifier right? or do we need to modify? is odata adapted accept this payload or do odata having any specific format?

Regards

Ramesh

0

may i know when the Bad Request : 400 : HTTP/1.1 come?

0
Sriprasad Shivaram Bhat Nov 25, 2016 at 10:03 AM
0

Yes Ramesh,

You can use the last XSD ending with ***POST4.These XSDs are generated when you finish your model operation.

Regards,

Sriprasad Shivaram Bhat

Show 1 Share
10 |10000 characters needed characters left characters exceeded

you mean, if i send the xml using mapping (target xsd is ***POST4) to Odata adapter the message can be processed, not require this content modifier?

0
Sriprasad Shivaram Bhat Nov 25, 2016 at 10:18 AM
0

Hello Ramesh,

Content Modifier is required. Mapping is required just to make sure your message sent to target server as per the structure its looking for.

In many cases when when manually create XML structure there are chances of issues w.r.t. data or format just to avoid that we will use mapping.Adding mapping is just to ensure message is not getting failed because of your input XML.

Regards,

Sriprasad Shivaram Bhat

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks for your clarification.

now message mapping error ..

LastError = com.sap.xi.mapping.camel.XiMappingException: com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot produce target element /Invoices. Queue has not enougth values in context. Target xsd requires a value for this element, but target field mapping does not produce one. Probably the xml-instance is not valid to the source xsd, or the target field mapping does not fulfill the requirement of the target xsd., cause: com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot produce target element /Invoices. Queue has not enougth values in context. Target xsd requires a value for this element, but target field mapping does not produce one. Probably the xml-instance is not valid to the source xsd, or the target field mapping does not fulfill the requirement of the target xsd.

because .

content modifier payload is

by my XSD structure is (exported from HCI and import ESR)

i can see both structure is different. how can we send as for payload which is placed in content modifier if i use the message mapping.

fyi. content modifier payload if i place in API it's posting successfully

Regards

Ramesh

1.png (24.2 kB)
2.png (26.3 kB)
0