-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when making call with content type application/xml #652
Comments
There's nothing specific in gateway for any content type. Can you explain how to reproduce the problem? What versions are you using? What is your configuration? |
Thank you for the quick response Spencer! https://github.com/LucasAndersson/spring-cloud-gateway-xml-demo
I also tried serializing to a json string using jackson like this:
With that approach I get a slightly different error:
I created my project using Spring Initializr, however I had to downgrade to Finchley.RELEASE version of Spring Cloud and 2.0.6.RELEASE version of Spring Boot because of the issue described here: #577 What I'm trying to achieve is to receive an XML payload in my gateway, map it to a different model and pass it downstream as JSON, map the response from the downstream service (which is also JSON) to a different model and return it to the gateway caller as XML. In my example I've only added a filter to modify the request body, I never seem to reach the downstream service so I thought it would be irrelevant to include a filter to modify the response. There will be 4 different models involved, the gateway request/response (which should be (de)serialized as XML) and the downstream service request/response (which should be (de)serialized as JSON). |
…ing-cloud#652) * Add each PropertySource from PropertySourceLocators individually instead of as a CompositePropertySource. Fixes spring-cloud#611
Hi
I'm building a gateway that will receive XML, map it to JSON, call an underlying external service using said JSON and then return a XML response to the gateway caller. I've set up a simple route that modifies the path, request and response bodies. When I call my gateway I get this response back:
{ "timestamp": "2018-11-12T15:43:22.621+0000", "path": "/v1/reserve", "status": 500, "error": "Internal Server Error", "message": "Content type 'application/xml' not supported" }
Does Spring Cloud Gateway not support XML? How do you propose that I deal with this problem?
The text was updated successfully, but these errors were encountered: