Forum Discussion

DDS_Inc__Suppor's avatar
DDS_Inc__Suppor
Occasional Contributor
15 years ago

JSON response msgs not converted to XML

With 4.0 Pro version (and 3.6.2 snapshot), JSON response messages are no longer being converted to XML. This is preventing all validations from occurring and hindering testing effort greatly. This problem DOES NOT occur in version 3.6.1 using the same resources, etc.

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.

10 Replies

  • DDS_Inc__Suppor's avatar
    DDS_Inc__Suppor
    Occasional Contributor
    I found the answer on my own.

    In 3.6.2 and 4.0, a new global setting was added to HTTP settings, Normalize Forward Slashes. By default, this option is unchecked. Unfortunately that is opposite of how ver 3.6.1 works.

    A side effect of this not being selected is JSON messages are not converted to XML.
  • DDS_Inc__Suppor's avatar
    DDS_Inc__Suppor
    Occasional Contributor
    I spoke too soon. This only helped for some of the resources we have.

    Please advise.
  • Hi!

    hmm.. could you attach the entire raw response for a JSON response that isn't converted correctly!?

    regards!

    /Ole
    eviware.com
  • I am getting this same issue. Here is a sample of my response:


    [
    {
    score: 6.029486,
    subTrack: null,
    tags: [ ],
    track: "Appearance",
    startTime: 18 ,
    guid: "428f5cd3-e5ef-40aa-b774-53c5d8d16e9d",
    segmentTypeId: "4cb53a3908b1cb506e00002b",
    endTime: 175,
    id: "4cb5411808b1cb50fa08794f",
    metadata: {
    Character Type: null,
    Character: "Forrest Gump",
    Character Nickname: null,
    Actor: "Tom Hanks",
    ID: null,
    }
    }
    ]
  • Does it matter if all values have to be in quotes?
  • Nope, seems to be the spaces in the element name fields...
  • DLuks wrote:
    Nope, seems to be the spaces in the element name fields...

    So this issue is resolved from your point of view?

    /Henrik
    SmartBear Stockholm
  • Sort of. It is resolved for me because I can specify in my request which fields I want returned for my data. So I can disable the return of potentially bad(?) formatted fields, i.e. ones with spaces.

    Since I was able to find a workaround, I would still consider this a possible bug. Actually I might argue that the program offer full JSON support and provide at least some examples of using JSON for assertions.
  • I also noticed the conversion not working if you encounter parenthesis in the response data.
  • Hi,

    The reason this isn't working for the response you provided, is that it is not valid JSON. You can use this online JSON validator to validate the response. According to the JSON spec, all strings have to be quoted, using double quotes ("). The same goes for parentheses, they are not a valid JSON character (unless used as part of a string).

    Regards,
    Dain
    SmartBear Stockholm