Forum Discussion

hovito's avatar
hovito
New Contributor
13 years ago

JSON response msgs not converted to XML

Hey guys,
With 4.0 Pro Trial version (and 3.6.2 snapshot free), JSON response messages are no longer being converted to XML. This is preventing all validations from occurring and hindering testing effort greatly.
I do receive JSON response messages and they visible in SoapUI. When I select the XML or Outline tab, the only thing displayed is "<xml/>".

Please advise.

9 Replies

  • I have the same issue. I tried with different free versions of soapUI 3.6, 3.6.2 snapshot and 4.0.1 snapshot (nightly build) and I get a JSON response but it's not converted to XML. I looked in the soapUI logs and no errors were found. Am I missing something ? some hidden option perhaps? I also checked to verify if the response in a valid JSON format ( http://jsonlint.com/ ) and it is.
    The JSON response looks like this :

    {"test": {"data": {
    "Search": [ {
    "index": 1,
    "name": "Google",
    "active": 1,
    "excluded": false,
    "fieldGroups": {"Properties": [ {
    "number": 0,
    "fields": {
    "searchIconURL": "http://localhost:8080/resource/searchIconGoogle.jpg",
    "searchName": "Google",
    "searchURL": "http://www.google.com"
    }
    }]}
    }],
    "Social": [ {
    "index": 2,
    "name": "Facebook",
    "active": 1,
    "excluded": false,
    "fieldGroups": {"Properties": [ {
    "number": 0,
    "fields": {
    "socialIconURL": "http://localhost:8080/resource/socialnetIconFacebook.jpg",
    "socialName": "Facebook",
    "socialURL": "http://www.facebook.com"
    }
    }]}
    }]
    }}}

    This issue is a blocked to our testing effort since we cannot use soapUI in our tests. Could you please help ?
  • orion1's avatar
    orion1
    New Contributor
    Hi,

    I'm using soapui 3.6.1 free version, and my json response is converted into a xml format with no problem.

    My step is a REST request, and i have set "application/json' as accepted encoding for response.
    For information, my JSON response starts like that: [{"first": { ...

    Anyway, it should not blocked your tests, as you can use groovy to validate your json response. My script looks like:

    import com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep;
    import net.sf.json.groovy.*;

    RestTestRequestStep step = testRunner.testCase.getTestStepByName( "MyStep" );
    String response = step.getProperty( "response" ).value;
    def slurper = new JsonSlurper();
    def result = slurper.parseText(response);
    def level2List = result.level1.level2;
    ...

    Hope this would help,

    Regards
  • hovito's avatar
    hovito
    New Contributor
    I tried with 3.6.1 free version and still didn't convert the JSON response into XML. Thanks anyway, but I found the real issue: even if the JSON response was correct, soapUI had some problems when converting it to XML. We fixed this in the code and now it works well.

    Thanks
  • vidu12's avatar
    vidu12
    New Contributor
    Hi hovito,

    what you have fixed in that code? and where ?
    Please do let me know.

    Thanks,
    vidu
  • vidu12's avatar
    vidu12
    New Contributor
    Hi,

    where u have fixed that in SOAP UI code or at your REST service code.
    If it is in SOAP UI code then do let me know in which file you made the fix and where? Or send me the updated jar/class file and position to place.
    Our testing is stuck because of this please help.

    Thanks,
    Vidu12
    • yves_brulotte's avatar
      yves_brulotte
      Occasional Contributor

      Reviving this thread as it is still an issue.

      json response is not converted to xml in response. I cannot see the xml in Soapui 5.1.0 but the ResponseasXml is working. But when i activate the license on Ready! API, no xml at all. I then need to vconvert over 500+ calls to jsonPath and almost all of them are trasnfer properties that SUM,CONCAT etc... that i cannot do with jsonpath.

       

      That issue block our testing

      • nmrao's avatar
        nmrao
        Champion Level 3
        Looks you are using SoapUI NG, can you just open a new topic in respective forum (SoapUI NG) with more details possible?