Showing json response as xml, wrong value in xmlns
I test a REST-service that respond with a json.
My request: GET https://develop-sys.test.abc.se/mom/19820224/201907
The json response looks fine, both i tab "JSON" and tab "Raw":
"period" : "201907",
"error" : false
Since I use ReadyApi I can select to show the response in xml format in the "XML" tab. The data that was in the json is correct also in the xml view.
But I get a different path in the xmlns-element than the one I sent the request to. A colleague even got another environment in the path.
Where does ReadyApi get the value for the xmlns element? I recognize the values because I have tested with those values also but not in my latest test.
Has anyone else seen this behavior when showing a json response as xml?
Solved! Go to Solution.
I suspect the issue is a cpnsequence of readyapi trying to convert your json response i to xml. If your datatype (Content-Type header) is json (e.g. application/json) readyapi converts your json responseto xml, and that is what your seeing.
The xmlns attribute is typically includedin a schema and can have any value. Itsjust used so the elememts can have unique identifiers (nsmespace prefix). Your xmlns attribute doesnt include a prefix value so this is a default namespace.
All thatboring stuff aside, you can ignore the contents of the xml tab if your content is json anyway.
Hope this helps explain,
Yes, my response is json (Content-type application/json) so I suspected that I could ignore this. Thank's for the confirmation @richie.