Forum Discussion

Ajay_Singh_Pari's avatar
Ajay_Singh_Pari
Frequent Visitor
4 years ago
Solved

How to Validate Text/Plain response inside an xml

Below is the sample body

 

<data contentType="text/plain" contentLength="3169"><![CDATA[{ "RequestOutTime": "20201125 041439.710", "ResponseInTime": "20201125 041442.916", "inboundContentType": "application/json", "TransactionStatus": "SUCCESS", ......(and so on)......... , "partBEffectiveDate": "08/01/2020" } } }]]></data>

  • Hey Ajay_Singh_Pari,

    If you need to extract values out of an xml response that contains cdata (everything in the cdata handler is ignored by the xml parser) then you have a couple of different choices to handle it.

    1. Use an in script groovy script to replace the cdata handler with empty characters
    2. Use an event handler to replace the cdata handler with empty characters
    3. Use sequential property transfers tp extract the values you want.

    I've linked to option 3 below:

    https://www.soapui.org/docs/functional-testing/working-with-cdata/

    Ta

    Rich

1 Reply

  • richie's avatar
    richie
    Community Hero
    Hey Ajay_Singh_Pari,

    If you need to extract values out of an xml response that contains cdata (everything in the cdata handler is ignored by the xml parser) then you have a couple of different choices to handle it.

    1. Use an in script groovy script to replace the cdata handler with empty characters
    2. Use an event handler to replace the cdata handler with empty characters
    3. Use sequential property transfers tp extract the values you want.

    I've linked to option 3 below:

    https://www.soapui.org/docs/functional-testing/working-with-cdata/

    Ta

    Rich