Skip to Content
avatar image
Former Member

Hide Metadata from oData response

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • May 15 at 10:12 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • May 14 at 08:29 PM

    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

    Add comment
    10|10000 characters needed characters exceeded