Forum Discussion

AHo's avatar
Occasional Contributor
14 years ago

manipulate SoapResponse - extract CDATA-Section

Hi soapUI Community,

i have a problem with "Property Transfer".
Unfortunately I receive my response with a CDATA-Section. (see example below)

<soapenv:Envelope xmlns:soapenv="">
<ns1:callResponse xmlns:ns1="">

<![CDATA[<?xml version="1.0" encoding="UTF-8"?>

<response xmlns="">
<serviceresult name="myService">
<array name="lib" type="library">
<string name="name">The Old Man and the Sea</string>
<string name="desc">Some text</string>
<string name="isbn">315009075X</string>
<string name="name">Alices Adventures in Wonderland</string>
<string name="desc">Lorem ipsum dolor sit amet.</string>
<string name="isbn">0688110878</string>


To call my other webservices I need the isbn of the books which is inside the CDATA-Section.
I tried these:

declare namespace tst='';

As a result of CDATA this XPath Selection throws an error ("Missin match of Source XPath...").
Is it possible to manipulate the response with SoapUI and extract the "<response xmlns=""> ... </response>" Tag?
Or can I delete the CDATA-Tag from the response before I start the "Property Transfer"?

I hope you can help me.

so long,


3 Replies

  • AHo's avatar
    Occasional Contributor
    Hi Ole,

    awesome - that's exactly what i was looking for.
    You just made my day!
    Thank you very very much.

    best regards,
  • rajeshbachani's avatar
    Occasional Contributor
    I am in a similar problem but have not found a solution yet. I have referred to the link you have mentioned here Ole, but seems that does not fall entirely under the purview of my problem. Maybe you can throw some light on this one

    My server is written in Java (using Spring) and the webservices exposed are consumed in SoapUI (obviously! ).
    A typical situation we have is one major entity is encapsulated in another entity.
    So, consider object A contains object B. Object A is then passed to the Client as part of a web service, and the client needs object B (contained inside object A) to be passed as a parameter into the next webservice call.

    So, the goal in SoapUI - when we try making a test suite - is to extract object B (serialized in XML) from the received response - and use that as it is (or with some updates in certain fields) into the request for the next web service call.

    How do we achieve this?

    I am doing this:

    Retrieving object B from the return part of the response and storing it in a property at the project level.
    If I now try to parameter transfer this property in the request I end up with a CDATA[] tag in front of the entire object.
    How can this be avoided?



    And "B" from this response is to be "inserted" into the request as:


    Please bear with the formatting and the content of the example - but this is just to show what I would like to do.

    Thanks in advance,