Forum Discussion
SmartBear_Suppo
Alumni
13 years agoHi,
The code still works for me even when I have the CDATA tag in a different location:
soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
<soapenv:Body>
<sam:searchResponse>
<![CDATA[<item>
<id>Item 1</id>
<description>One handy protocol droid. This droid is fluent
in over six million forms of communication and has a lovely golden color.
Built by an enthusiast. Mindwiped only once. Can be carried on your back.</description>
<price>1</price>
</item>
<item>
<id>Item 2</id>
<description>Box of chocolate with several popular items. Covered in Glucose.
Recommended safety distance when eating Spring Surprise, 10 feet.</description>
<price>1.99</price>
</item>
<item>
<id>Item 3</id>
<description>One towel. Massively useful thing.
Impress the strags with this amazing cloth!</description>
<price>2.99</price>
</item>
<item>
<id>Item 4</id>
<description>Ono-Sendai 7. The newest cowboy tech from Hosaka.
Break the ICE with this conversation piece.</description>
<price>4.99</price>
</item>
<item>
<id>Item 5</id>
<description>soapui Pro 1.7.5. Necessary when testing Web Services.</description>
<price>349</price>
</item>
<item>
<id>item 6</id>
<description><![CDATA[<item><width>123</width><height>345</height>
07.<length>098</length><isle>A34</isle></item>></description>
<price>123</price>
</item>]]>
</sam:searchResponse>
</soapenv:Body>
</soapenv:Envelope>
results in:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
<soapenv:Body>
<sam:searchResponse><item>
<id>Item 1</id>
<description>One handy protocol droid. This droid is fluent
in over six million forms of communication and has a lovely golden color.
Built by an enthusiast. Mindwiped only once. Can be carried on your back.</description>
<price>1</price>
</item>
<item>
<id>Item 2</id>
<description>Box of chocolate with several popular items. Covered in Glucose.
Recommended safety distance when eating Spring Surprise, 10 feet.</description>
<price>1.99</price>
</item>
<item>
<id>Item 3</id>
<description>One towel. Massively useful thing.
Impress the strags with this amazing cloth!</description>
<price>2.99</price>
</item>
<item>
<id>Item 4</id>
<description>Ono-Sendai 7. The newest cowboy tech from Hosaka.
Break the ICE with this conversation piece.</description>
<price>4.99</price>
</item>
<item>
<id>Item 5</id>
<description>soapui Pro 1.7.5. Necessary when testing Web Services.</description>
<price>349</price>
</item>
<item>
<id>item 6</id>
<description><item><width>123</width><height>345</height>
07.<length>098</length><isle>A34</isle></item>></description>
<price>123</price>
</item></sam:searchResponse>
</soapenv:Body>
</soapenv:Envelope>
The CDATA tag is removed.
That's not related to the replacing of the CDATA tag, however, I tried similar scenarios and it worked for me as well.
Using the SubmitListener.afterSubmit event I am not running into any of these problems.
Regards,
Marcus
SmartBear Support
The code still works for me even when I have the CDATA tag in a different location:
soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
<soapenv:Body>
<sam:searchResponse>
<![CDATA[<item>
<id>Item 1</id>
<description>One handy protocol droid. This droid is fluent
in over six million forms of communication and has a lovely golden color.
Built by an enthusiast. Mindwiped only once. Can be carried on your back.</description>
<price>1</price>
</item>
<item>
<id>Item 2</id>
<description>Box of chocolate with several popular items. Covered in Glucose.
Recommended safety distance when eating Spring Surprise, 10 feet.</description>
<price>1.99</price>
</item>
<item>
<id>Item 3</id>
<description>One towel. Massively useful thing.
Impress the strags with this amazing cloth!</description>
<price>2.99</price>
</item>
<item>
<id>Item 4</id>
<description>Ono-Sendai 7. The newest cowboy tech from Hosaka.
Break the ICE with this conversation piece.</description>
<price>4.99</price>
</item>
<item>
<id>Item 5</id>
<description>soapui Pro 1.7.5. Necessary when testing Web Services.</description>
<price>349</price>
</item>
<item>
<id>item 6</id>
<description><![CDATA[<item><width>123</width><height>345</height>
07.<length>098</length><isle>A34</isle></item>></description>
<price>123</price>
</item>]]>
</sam:searchResponse>
</soapenv:Body>
</soapenv:Envelope>
results in:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sam="http://www.soapui.org/sample/">
<soapenv:Body>
<sam:searchResponse><item>
<id>Item 1</id>
<description>One handy protocol droid. This droid is fluent
in over six million forms of communication and has a lovely golden color.
Built by an enthusiast. Mindwiped only once. Can be carried on your back.</description>
<price>1</price>
</item>
<item>
<id>Item 2</id>
<description>Box of chocolate with several popular items. Covered in Glucose.
Recommended safety distance when eating Spring Surprise, 10 feet.</description>
<price>1.99</price>
</item>
<item>
<id>Item 3</id>
<description>One towel. Massively useful thing.
Impress the strags with this amazing cloth!</description>
<price>2.99</price>
</item>
<item>
<id>Item 4</id>
<description>Ono-Sendai 7. The newest cowboy tech from Hosaka.
Break the ICE with this conversation piece.</description>
<price>4.99</price>
</item>
<item>
<id>Item 5</id>
<description>soapui Pro 1.7.5. Necessary when testing Web Services.</description>
<price>349</price>
</item>
<item>
<id>item 6</id>
<description><item><width>123</width><height>345</height>
07.<length>098</length><isle>A34</isle></item>></description>
<price>123</price>
</item></sam:searchResponse>
</soapenv:Body>
</soapenv:Envelope>
The CDATA tag is removed.
content = content.replaceAll( "data", "" ) or content = content.replaceAll( "contentType", "" ) does nothing
That's not related to the replacing of the CDATA tag, however, I tried similar scenarios and it worked for me as well.
Using the SubmitListener.afterSubmit event I am not running into any of these problems.
Regards,
Marcus
SmartBear Support