cancel
Showing results for 
Search instead for 
Did you mean: 

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

SOLVED
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 ?

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

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

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

View solution in original post

7 REPLIES 7
Occasional Contributor

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

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.

Occasional Contributor

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

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.

Community Hero

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

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
Occasional Contributor

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

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

Moderator

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

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

Occasional Contributor

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

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 .

Moderator

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

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

View solution in original post