Ask a Question

SoapUI 5.4.0 XML tab don't display JSON content like 5.0.0

SOLVED
debrabph
Occasional Contributor

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 ?

7 REPLIES 7
royki
Occasional Contributor

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.

debrabph
Occasional Contributor

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.

Hey

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
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
debrabph
Occasional Contributor

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 Smiley Happy

Olga_T
SmartBear Alumni (Retired)

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

debrabph
Occasional Contributor

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 Smiley Sad .

Olga_T
SmartBear Alumni (Retired)

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

cancel
Showing results for 
Search instead for 
Did you mean: