SoapUI 5.4.0 XML tab don't display JSON content like 5.0.0
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
SoapUI 5.4.0 XML tab don't display JSON content like 5.0.0
With the 5.0.0 version, when I receive a JSON response, I can show it in the XML tab. It's important for me because one json propertie of the message include an HTML content. So I can copy and past this content easily in a text editor.
With the 5.4.0 version, the json response in displayed in the json tab solely. In the XML tab there's the message "The content you are trying to view cannot be viewed as XML".
Can I reproduce the 5.0.0 behavior with the 5.4.0 version ?
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can copy from the json tab as well. Do you want to copy the xml tags also ? As from the json tab the html code also appears.
PS: Not sure did I get your requirement exactly or not.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes I can copy from the JSON tab, but the html code must be manually modified before it can be displayed by a navigator : remove \r, change \" with ", etc...
From the XML tab (in 5.0.0) the HTML code is directly usable. See the joined files in my question.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you manually need to remove/alter \r, etc. Using the RequestFilter.afterRequest event handler
You can use something like the following code to alter '\r' to blank using the following code
Def content = context.httpResponse.responseContent
Log.info(content)
content = content.replaceAll ("/\r", "")
The above will remove '\r' in the response before displaying thr resultant content in your response tabs. You could reproduce the above for all the characters you need to alter.
I've used the above approach before now when i had an html string in an escaped .json response and i had to verify and extract certain attribute values from thr html string.
OR, If you just want to force your .json response into .xml (so it displays correctly in your outline tab) you could add the Accept header to your request that setting the value as 'application/xml', this will result in your response being returned as .xml in your response.
Perhaps the above options can help?
Cheers,
Rich
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Richie for your answer but it doesn't answer my question which was originally : can I reproduce the 5.0.0 behavior. I had thought about a configuration parameter... It's curious that this possibility to display automatically an xml representation from a json stream was removed.
If it is no more available, it's an answer too
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @debrabph.,
I think that the best way to proceed here is to contact our Support team. They will do their best to assist you.
To create a case, please follow this link: https://support.smartbear.com/message/?prod=ReadyAPI
Olga Terentieva
SmartBear Assistant Community Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your suggestion Olga, but your support team don't provide support for SoapUI open source. They have closed may request and asked me to submit my question in the SoapUI open source forum. So I'm back with my question always open .
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry for the misunderstanding, I thought you were using the Pro version as this is the forum for SoapUI Pro. Have you asked this question in the SoapUI OS forum?
(I have edited the reply because the link was wrong the first time, now it is correct, sorry for the confusion)
Olga Terentieva
SmartBear Assistant Community Manager
