I am using CA LISA 7.1 . When I tried executing a XML input , I received a JSON response instead of XML response. I checked the response in SOAP 5.2.1 and it gave a similar response whereas when I checked it in SOAP 4.2.1 I could see the output in XML. Can someone please help me out on what the issue is ?
Also , I tried executing another XML input and I got an XML response for it but I am facing this issue with one step.
Hi Venkatesh, following are some things to examine:
1) If you are able, use a LISA Test Case and send a request using Webservice Execution XML or Raw Soap. The response you see returned to the test case step will be the content as it was when it came from your service. If it is XML, there is a good bet that SOAP UI is converting it.
2) If the response to your test case is converted from XML into JSON, check your VSI and VSM. In the VSI, look at the response that is generated. Is that response in XML or JSON format? Also, for this response, CLICK the MetaData tab and check to see if there are any HTTP meta data tags indicating that the response is JSON. If this all looks good, open your VSM and check the Responder Step, Filters. Are there any response DPHs added in? If so, do the DPHs perform any actions that convert the response from XML to JSON?
If your LISA Test Case returns XML, I would look more deeply into SOAP UI and ensure that SOAP UI is not automatically converting the response. I saw a scenario last week where a customer submitted a SOAP UI request and SOAP UI converted the XML response to JSON.
You have mentioned to use web service execution(xml) or raw soap but we are actually using Rest based services and we invoke them using Webservices -> Rest Step
Is there any other way for us to check if the tool is converting the XMl response to JSON. Also could you please help me in explaining how to check it in VSI or VSM(Are they related to virtualization - if yes we dont use virtualization -we just focus on validatng the reponse of webservice)
Let me make sure I understand. Your input request is an XML. You are expecting the response from the service to be in XML format.
You execute a REST Step using LISA 7.1 Test Automation and the response you get back is JSON.
You send the same XML request to the endpoint using SoapUI 5.2.1 and the response back from the service is JSON.
You send the same XML request to the endpoint using SoapUI 4.2.1 and the response back from the service is XML.
The LISA Rest Step does not perform automatic conversion on the response data -- meaning it does not convert XML to JSON. If you execute the REST step and JSON is returned, I would look into the service as the potential issue. For a conversion to happen in your Test Case, your test step would need to apply some sort of filter or customization that implements an XML to JSON data conversion. If you have not applied any Filters or customizations in your LISA Test Step or Test Case to convert the data from XML to JSON, your best course of action is to discuss the behavior with the developer of the service.
If your service is virtual, it is possible that the developer added some behavior to return JSON rather than XML. The RESTful interfacing mechanism of LISA 7.1 is slightly different from the feature improvements in the latest DevTest release (9.x).
Venkatesh, I do not have LISA 7.1 installed on my machine so I am unable to check on this further. Please check out the REST example test case located in your LISA Workstation installation directory on your machine. In this directory, there is an 'examples' subdirectory containing a REST example test case. I believe the test case contains both XML and JSON examples. Perhaps, there is a hint of what might be causing the conversion there. The location of the LISA Test Case is: <LISA_HOME>/examples/Tests/rest-example.tst.
Thanks for the quick response Joel.
Yeah your understanding on my problem description is correct and I would discuss on this with developers
Also I would check on the example you have provided for reference and get back to you if I have anything else.