XML to JSON Transform and ÖÄ characters


#1

Hi,

I am running the Tyk Gateway and Dashboard on premise.

I am using the body transform to change a XML reply to JSON. I struggled for some time only to find that the problem is with the character Ö and Ä. When I test these in the XML message the JSON on the other side is left blank.

Here is the example from the documentation with 2 Finnish city names instead when testing it on the Dashboard:

<?xml version="1.0" encoding="utf-8"?>
<servers version="1">
    <server>
        <serverName>Jyväskylä</serverName>
        <serverIP>127.0.0.1</serverIP>
    </server>
    <server>
        <serverName>Hyvinkää</serverName>
        <serverIP>127.0.0.2</serverIP>
    </server>
</servers>


Result:
{

}

Has anyone come across something similar?

Br,
Louis


#2

Have you tried using the tester in the dashboard? Yu can pre-test your template without needing to save and reload - you should also then see error output in the dashboard logs if there was a problem.


#3

Hi,

That is how I found it. I pasted the example input and template from the documentation into the Dashboard Endpoint Designer. Changed the two city names to Finnish cities and with Ä and Ö in it and the the result is empty.


When I don’t do a transform on the response the whole XML does pass through without problems.

Br,
Louis


#4

Hi Louis,

OK thanks for the report, I’ve raised it as a bug here:

We’ll try and get it into our next point release (there are two patches coming before that).

M.


#5

Well, that is great.
Cheers!


#6

Hi Louis,

I’m looking into this issue for 2.4 and haven’t been able to reproduce the issue so far. I’ve posted some details in the issue tracker over at GitHub: https://github.com/TykTechnologies/tyk/issues/642#issuecomment-300442432

Could you please reply there with more bits of information? Especially interested in what Tyk versions (gateway and/or dashboard) you’re running and what the API definition looks like.

Thank you!


#7

Hi,

I have the following version installed:
tyk-dashboard 1.3.2 amd64
tyk-gateway 2.3.3 amd64

Br,
Louis


#8

Could you reply in the GitHub issue? It’s easier to keep track of the info there, and I’ll post any updates there too. Thank you!