on 12-01-2017 1:24 PM
Hi
We are trying to call an OData service in the SAP Backend user a $Filter via OData provisioning
We are able to call the odata service directly using this filter option but when we do it via the OData adapter the adapter crashes with this error.
Request url for HCI:
https://xxxxxx-iflmap.hcisbp.eu1.hana.ondemand.com/http/Webshop/SalesOrderHistory/SalesOrderSet$filt... eq '0050169000'
Response from CPI (the request does not reach the SAP Backend
An internal server error occured: No property "Customer%20eq%20%270050169000%27" exists in type "Z_ORDER_TO_CASH_V1_SRV.SalesOrder" at position 1 in "Customer%20eq%20%270050169000%27"..
It seems as if the adapter tries to find the entire string “Customer eq ‘1234567890’”as a property in the service.
The Filter parameters are dynamically set from the request url using the CamelHTTPQuery header.
I do not think it is a problem with OData provisioning itself since a direct call to the ODP OData service (via http) works fine. Also $top & &skip work fine both in http and odata adapter.
So it seems a problem specifically for the CPI OData adapter.
How can we solve this?
Thanks
Tom
Hi Tom,
It seems to me there is a ? missing:
https://xxxxxx-iflmap.hcisbp.eu1.hana.ondemand.com/http/Webshop/SalesOrderHistory/SalesOrderSet$filter=Customereq'0050169000'
vs
https://xxxxxx-iflmap.hcisbp.eu1.hana.ondemand.com/http/Webshop/SalesOrderHistory/SalesOrderSet?$filter=Customereq'0050169000'
Can that be the error?
Kind regards,
Martin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Martin,
I was using the wrong header for the filter in my OData select. I used CamelHTTPQuery which contains the complete filter string including thew word filter itself which is nice for monitoring but you cannot use it in your OData select statement.
Apache Camel also sends all url parameters as headers with the message, so as soon as I whitelist the header named filter I can use it in the query string, which then looks something like this (note the top and skip headers are also whitelisted):
$select=Field5,Field4,Field3,Field2,Field1,DeliveryCity,DeliveryPostlCode,DeliveryCountryIso,DeliveryStreet,DeliveryName,DeliveryPartnerID,Status,SelectMaterial,AllowanceTotal,Payable,TaxInclusive,TaxExclusive,Yourreference,Custpurchasenumber,Documentdate,Customer,RequestType,Division,DistrChan,SalesOrg,DocType,Salesdocument&$top=${header.top}&$skip=${header.skip}&$filter=${header.filter}
This works pretty good as long as all parameters are always provided which is something you can agree upon with the sender of the request.
KInd regards
Tom
Hi Rooijen,
Could you please elaborate on "whitelist the header named filter". How do you do that in CPI? We have a OData Service Integration Flow (Odata as sender and receiver). We are not able to capture any url parameter in headers. In our case, the below is output of header list
null accept-language en-US,en;q=0.9,gu;q=0.8
ODataContext org.apache.olingo.odata2.core.ODataContextImpl@501b8ee3
odataEntity Customers
ODataMethod GET_FEED
odataURI null
SAP_MessageProcessingLogID AFy_xY3nU4CZP0GUMwfhjwAyYXip s
criptFile script2.gsh
scriptFileType groovy
UriInfo com.sap.gateway.core.ip.odata.OGWUriInfo@da8f72b x-forwarded-for 50.101.108.120
Hi Olegs,
Thanks, I tried it but the behaviour stays the same alas.
regards
Tom
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried
https://xxxxxx-iflmap.hcisbp.eu1.hana.ondemand.com/http/Webshop/SalesOrderHistory/SalesOrderSet/?$fi... eq '0050169000'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.