Service Virtualization

Expand all | Collapse all

JSON response, from XML (DevTest 8.1) to JSON (DevTest 10.1)

Jump to Best Answer
  • 1.  JSON response, from XML (DevTest 8.1) to JSON (DevTest 10.1)

    Posted 06-28-2018 02:56 AM

    Hi All,

     

    I have a virtual service created with DevTest 8.1, which contains JSON responses. These responses are stored in XML and a JSON DPH was used to convert them to JSON format.

    Now, with DevTest 10.1, JSON DPH stores response in JSON format. And my virtual service running under DevTest 10.1 responds with XML messages... when I am waiting some JSON...

    What is the simplest way to make my virtual service running with DevTest 10.1 and responding with JSON messages ?

    I have about 20 requests/responses and I'm afraid to do the conversion manually (bad manipulation, or to forget something...)

     

    Best regards,

     

    Benoit



  • 2.  Re: JSON response, from XML (DevTest 8.1) to JSON (DevTest 10.1)
    Best Answer

    Posted 06-28-2018 09:40 AM

    You can try any of the below:

    . If you have the RR pairs, can you create them again in 10.1, so the responses will be in JSON.

    . Manually edit the VSI responses.

    . Use a Scriptable DPH on the Response side and write code to convert the response into JSON. Refer Joel's response DevTest 10.1 - JSON DPH not available on response side ? This will provide a sample code.



  • 3.  Re: JSON response, from XML (DevTest 8.1) to JSON (DevTest 10.1)

    Posted 06-28-2018 02:17 PM

    As a last resort, if you no longer have the RR pairs, you could use the recorder to capture the responses from the original services if you have the requests to exercise it.