SoapUI 5.2.1-REST Service's JSON response not displayed in JSON view
Hi,
When I execute REST service in Soap UI 5.2.1 Open source, the respective JSON response is not displayed in JSON view and instead below message is displayed.
"The content you are trying to view cannot be viewed as JSON".
Please suggest me if I have to change SoapUI settings to see JSON response in JOSON view
Please find below other views that I see.
XML View:
<data contentType="text/plain;charset=ISO-8859-1" contentLength="140"><![CDATA[{"status":{"resultCode":0,"developerMessage":"Hint question retrived successfully [Time Taken: 1103 millisec]"},"data":{"hintQuestion":"7"}}]]></data>
HTML View:
{"status":{"resultCode":0,"developerMessage":"Hint question retrived successfully [Time Taken: 1103 millisec]"},"data":{"hintQuestion":"7"}}
Raw view:
HTTP/1.1 200 OK
Date: Mon, 09 Nov 2015 20:57:50 GMT
Content-Type: text/plain;charset=ISO-8859-1
X-Powered-By: Servlet/2.5 JSP/2.1
Set-Cookie: JSESSIONID=RF4JWBHpJvGVGQmnGqDlyTP2121pBQgVpn2sf8PtQJsDBFT5TYMf!1112697720; path=/; HttpOnly
Set-Cookie: sto-id-16671=GCJIKIMAEBBP; Expires=Mon, 09-Nov-2015 21:23:10 GMT; Path=/
Connection: close
Transfer-Encoding: chunked
Set-Cookie: nwp_1-47873-%3FVFSIN_PUB%3Fsg_nhlweb_qa1_8080=BPJGKIMAJABP; Expires=Mon, 09-Nov-2015 21:32:10 GMT; Path=/
{"status":{"resultCode":0,"developerMessage":"Hint question retrived successfully [Time Taken: 1103 millisec]"},"data":{"hintQuestion":"7"}}
I'm not sure about the exact cause; but, I guess the issue is with the response Content-Type which holds "text/plain;charset=ISO-8859-1". Hence, SoapUI doesn't detects in the JSON response viewer.I just tried with one of my REST service and SoapUI displayed perfect JSON view with the Content-Type - application/json
HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 Date: Tue, 10 Nov 2015 03:37:56 GMT Expires: Wed, 11 Nov 2015 03:37:56 GMT
When I tried to reproduce your scenario, with response Content-Type as "text/plain", the JSON response viewer displays "The content you are trying to view cannot be viewed as JSON".
As suggested by nmrao, please check with the service provider to match the Content-Type that suits with Front-end application.
Thanks,
Samy
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others, Thanks. ↓↓↓
- I think the value which was to Content-Tye may not valid. i.e., application/Json instead of application/json; charset=UTF-8, charset can be whatever supported. Could be an issue with case sensitivity(Your case it is Capital Json instead of all small json)