Product/components used and version/fix level:
API Gateway Advanced Edition 11.0.0.0.2185 (Free forever edition)
Detailed explanation of the problem:
I am looking to expose the Microsoft Odata sample feed via an API gateway and consume the Odata feed using excel. This is to demonstrate what logging / processing I can do to an odata feed in the API gateway.
I am using northwind as my sample odata feed.
https://services.odata.org/northwind/northwind.svc
I am using Excel 2016 to preview and load an entity from the odata feed this works fine.
When I expose the odata feed via my API gateway in the cloud, I get a 406 error (Not acceptable)
Details: “OData: Request failed: The remote server returned an error: (406) Not Acceptable. (API Gateway encountered an error. Error Message: Not acceptable. Request Details: Service - northwind.svc, Operation - null, Invocation Time:10:24:46 AM, Date:Jun 6, 2024, Client IP - 80.x.x.x, User - Default and Application:null)”
When I run fiddler, to look at what Excel is sending the API gateway and I can see excel sends 3 request. The first 2 are successful. These are both requests for json.
The third, I see the 406 error
This is the header
GET /gateway/northwind.svc/1 HTTP/1.1
User-Agent: Microsoft.Data.Mashup (Power Query documentation - Power Query | Microsoft Learn)
MaxDataServiceVersion: 3.0
Accept: application/atomsvc+xml;q=0.8,application/atom+xml;q=0.8,application/xml;q=0.7,text/plain;q=0.7
Accept-Encoding: gzip, deflate
Host: envxxxxxx.apigw-aw-eu.webmethods.io
When I use postman to emulate it, it appears that the API gateway will not accept this format. Should API gateway accept the format request? application/xml. This appears to be a valid Odata request and the backend sample odata feed will accept it.
So it works with application/json:
But not with application/xml
Also in the output, I see
"odata.metadata": "https://services.odata.org/northwind/Northwind.svc/$metadata",
I think this should need to be transformed to http://envxxxxxx.apigw-aw-eu.webmethods.io/gateway/northwind.svc/1/$metadata.
I have seen other threads suggest to use Response transformation to call another service, however this does not appear to be an option for the odata policy in API gateway
Compared, to a non odata API policy, where there is an option of a response transformation.
Error messages / full error message screenshot / log file:
Question related to a free trial, or to a production (customer) instance?
This is using the free trial. But looking to implement in a production customer instance, where they are looking to expose an odata feed via an API gateway, to use in Excel.