cancel
Showing results for 
Search instead for 
Did you mean: 

Handling of "/" in SAP API Management ODATA Calls

christoffer_fuss
Participant
0 Kudos

Hello,

I am calling my on premise ODATA Service via SAP API Management and everything is working fine. But I have a problem with the special character "/" (Slash) in ODATA URLS:

/functionalLocations(applicationId='MA',id='0001/00001/00001')";

Calling this entity leads to SAP Gateway Error:

400 - Ungültiges URI-Segment 

If I replace the "/" with the URL encoding "%2F" I am getting

/functionalLocations(applicationId='MA',id='0001%2F00001%2F00001')";

This is working fine if I call the request directly to SAP Gateway without using SAP API Management.

If I call the URL encoded ODATA request via SAP API Management I get an error code 400 without any error text. So I have no idea what is going wrong here?

Every other special character like "-" (%2D) is working fine.

So how can I pass a "/" in SAP API Management?

Best Regards,

Chris

Accepted Solutions (0)

Answers (2)

Answers (2)

christoffer_fuss
Participant
0 Kudos

Hi Divya,

Thanks again for answering.

The variable "target.url" is empty. The variable "request.uri" shows:

.../RX_SRV/tenantStatus(firstName='J%C3%BCrgen',lastName='Mustermann',email='test@test.de',contractNr='99%2F4-1-00004',contractDate=datetime'2012-01-01T00:00:00')?%24format=json&%24select=statusId%2CcallId

The escape symbol "%2F" is killing the request.

The request never reaches my backend so there is no log in SAP gateway available. If i send the same reuqest directly to my backend without using API Management it is working fine. So this seems to be a problem in API Management.

IIn Debug console I see the following error:

I opend the incident and hope the guys can help me.

Best Regards,

Chris

divyamary
Contributor
0 Kudos

Hi Christoffer

It would be good to reach out to product development team so that they can have a look into the issue in detail. Kindly raise an incident or BCP ticket on OPU-API-DT component.

Sharing few troubleshooting options that can help you in identifying the issue :-

a) On API Management side you can use an JavaScript policy attached to target end post flow request stream to trace target.url parameters and this would then log outgoing target url in the debug tool, so that you would be able to see outgoing target url.

a) If it is 400 bad request, then check on Gateway logs what is the error . If you have access to http trace logs on Gateway side then you would be able to see the incoming target url as well.

Thanks and Best Regards,

Divya

christoffer_fuss
Participant
0 Kudos

Hi Divya,

I raised an incident on that and the guys fixed it. So it is working now.

Best regards,

Chris