Service Virtualization

  • 1.  Jason-Soap message comparision

    Posted Jun 14, 2016 11:12 AM

    Hi,

    I have a requirement to call 2 services and compare there response.

    The response of 1st service is soap and 2nd service is json.

     

    both services are suppose to return as response but in different format.

    Is there any way that I can compare both these in 9.x version. the value and xpath of the fields also need to be same.

     

    Thanks,

    Pankaj



  • 2.  Re: Jason-Soap message comparision
    Best Answer

    Posted Jun 14, 2016 11:20 AM

    completely different animals.. you will have to convert one to the other.  xml to json might be easier.

     

    Quickest way to convert XML to JSON in Java - Stack Overflow



  • 3.  Re: Jason-Soap message comparision

    Posted Jun 14, 2016 11:28 AM

    so we have create a custom java step or custom filter which will convert xml to json and save it to a property?

     

    Is there any way we can convert both soap and Jason into some comparable objects without needing to write custom code?

     

    Thanks,

    Pankaj



  • 4.  Re: Jason-Soap message comparision

    Posted Jun 14, 2016 11:44 AM

    I am not aware of any built in functions to do this.

     

    note that order independent compare is optional for json. and takes an newer jar file for xml documents.