Skip to Content
0

Hide Metadata from oData response

May 14 at 03:22 PM

78

avatar image
Former Member

Hello,

I created an API that consumes an oData service created in SAP Gateway, and the response always looks like this :


I've read that in oData 2.0 the metadata isn't optional, but is there any way to hide this from the response ? Mostly because it contains a direct URL to our Backend, and I don't want the API consumers to have access to this data.

I tried looking up for the methods in DPC_EXT class but I couldn't find any.

Please help!

odata.jpg (60.2 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Ralf Handl
May 15 at 10:12 AM
1

The URLs in __metadata should be the URLs used by your API consumers to access the API, which they need to know anyway.

If your API is "hidden" behind a proxy and __metadata does not contain the "external" proxy URLs but instead shows the "internal" backend URLs, then the proxy isn't forwarding its external URL information to Gateway. See https://wiki.scn.sap.com/wiki/display/BSP/Using%20Proxies for information on how proxies and ABAP backends can be configured to produce correct "external" URLs.

Share
10 |10000 characters needed characters left characters exceeded
Andre Fischer
May 14 at 08:29 PM
1

this is not possible.

You could use a reverse proxy and put it in between your backend system and the API consumers to shield the hostname of your system from the consumers.

BR

Andre

Share
10 |10000 characters needed characters left characters exceeded