Hi,
I’m very new to Tyk, so this is why I post this question under setting up Tyk. This is a very newbie question.
My basic case is the following: call a webservice, transform the request body from json, receive the response and tranform the response body from xml to json.
This is what I have done:
- I’m running Tyk on premise in docker containers
- I have chosen a simple test web service: http://www.webservicex.net/geoipservice.asmx
- Created an API with the dashboard
- In the core settings: added a name, slug, listen path and set the Authentication mode to “Open”
- In the endpoint designer: added an endpoint
- The endpoint: set method to POST, no extra path
- The endpoint: added Body transform, for the request → result is a XML
- The endpoint: added Modify request headers, added the required headers for content-type and SOAPAction
- Tested the API with Postman: worked great!
- The endpoint: added Modify response headers, removed the unwanted headers and added the content-type application/json
- The endpoint: added the Body transform for the response body. I started simply by returning a fixed json { “result” : “OK” }
- Updated and then tested the API with Postman: Postman reports that the API does not reply
- Checked the docker output:level=error msg=“Error unmarshalling XML: xml.Decoder.Token() - XML syntax error on line 1: invalid character entity & (no semicolon)”
- The endpoint: removed the response Body transform → API works
- Checked the validity of the XML returned by the service: XML seems to be valid.
What could I do to fix this / what did I do wrong?
Thanks in advance for your answer.
Ger