Forum Discussion
13 years ago
Hi,
Thanks for sending the sample project. Yes, it works, but it's a different situation
Unfortunately, changing the email for our main account (the posting account) caused us to not receive any activation email and left our account utterly locked. Haven't heard from the forum admins for about a week, you should really consider looking into that.
Fortunately, we eventually found that we had another pro Account. Most people won't, again, keep track of your admin email.
----------------------------------------------------------------------------------
Since I couldn't get any support for several days, I kept looking into it, and reached a few additional conclusions:
As seen above, this is a REST service. The response is the "Main" XML. However, the Raw response is something like:
As you can see, the whole contents have a CDATA flag applied BEFORE the Main element. I've used the SubmitListener.afterSubmit Event at a project level with the usual code and like we discussed, it didn't work.
The replacement will only work for anything inside Main (inclusive). For example:
- a content = content.replaceAll( "data", "" ) or content = content.replaceAll( "contentType", "" ) does nothing.
- a content = content.replaceAll( "Main", "water" ) will replace correctly.
Ergo, I can never remove the CDATA tag with the Event script (at least not like this).
----------------------------------------------
I've also tried to use a script and even Property Transfers to store the result into a property.
- Transfering the initial response to a property works, and I don't see the CDATA there afterwards (only from "Main" onwards, which might hint why the replace CDATA above fails to work). However, I can't filter inside it by XPath (see below).
Script:
This returns a "org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA error at line:x", the getXmlHolder line.
The same happens if I try to use an XPath expression in a 2nd Property Transfer, with Source as the Property I started with.
- Hope this gives you further input. It might be a fringe situation that soapUI can't handle.
Thanks for sending the sample project. Yes, it works, but it's a different situation

Unfortunately, changing the email for our main account (the posting account) caused us to not receive any activation email and left our account utterly locked. Haven't heard from the forum admins for about a week, you should really consider looking into that.
Fortunately, we eventually found that we had another pro Account. Most people won't, again, keep track of your admin email.
----------------------------------------------------------------------------------
Since I couldn't get any support for several days, I kept looking into it, and reached a few additional conclusions:
As seen above, this is a REST service. The response is the "Main" XML. However, the Raw response is something like:
<data contentType="application/xml; charset=utf-8" contentLength="857">
<![CDATA[<Main publisher="mss.cto.pp" publicationTime="2013-11-21T14:13:37" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn::metadata:2008">
<Description>
<LocationTable>
<Schedule IDRef="_Test_1"/>
<Schedule IDRef="_Test_2"/>
</LocationTable>
<InformationTable>
<Information Id="_Test_1">
<Name length="medium"> Test 1</Name>
<URL>00a2</URL>
<Genre href="urn::metadata:cs:CS:2008:04"/>
</Information>
<Information Id="_Test_2">
<Name length="medium"> Test 2</Name>
<URL>00a3</URL>
<Genre href="urn::metadata:cs:CS:2008:04"/>
</Information>
</InformationTable>
</Description>
</Main>]]>
</data>
As you can see, the whole contents have a CDATA flag applied BEFORE the Main element. I've used the SubmitListener.afterSubmit Event at a project level with the usual code and like we discussed, it didn't work.
The replacement will only work for anything inside Main (inclusive). For example:
- a content = content.replaceAll( "data", "" ) or content = content.replaceAll( "contentType", "" ) does nothing.
- a content = content.replaceAll( "Main", "water" ) will replace correctly.
Ergo, I can never remove the CDATA tag with the Event script (at least not like this).
----------------------------------------------
I've also tried to use a script and even Property Transfers to store the result into a property.
- Transfering the initial response to a property works, and I don't see the CDATA there afterwards (only from "Main" onwards, which might hint why the replace CDATA above fails to work). However, I can't filter inside it by XPath (see below).
Script:
// allServices is the step name
def inputHolder = "allServices#Response"
def holderRawReq = groovyUtils.getXmlHolder(inputHolder)
This returns a "org.apache.xmlbeans.XmlException: error: Unexpected element: CDATA error at line:x", the getXmlHolder line.
The same happens if I try to use an XPath expression in a 2nd Property Transfer, with Source as the Property I started with.
- Hope this gives you further input. It might be a fringe situation that soapUI can't handle.