CDATA XML input seemingly being parsed incorrectly

Report your bugs here, Thank you!

CDATA XML input seemingly being parsed incorrectly

Postby kvasko » 29 Jun 2011 19:05

I am using soapUI 4.0.0 Build dist-123-2011-06-14, Build Date 2011/06/14 09:52

I created a new project leaving the defaults selected. I type in the URL of the server providing the web service. I right click on the service and create a new request and this gets generated...

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fix="http://10.6.1.21:8080/Consol/FIXED_NETWORK">
<soapenv:Header/>
<soapenv:Body>
<fix:system_status>
<!--Optional:-->
<fix:SysStatusXML>
</fix:SysStatusXML>
</fix:system_status>
</soapenv:Body>
</soapenv:Envelope>

The problem exists when I try to pass XML CDATA to the webservice as below. It seems that SoapUI is parsing the greater than symbol incorrectly. The bold portion below is highlighted in red but nothing after it is (i would expect it to be). With the below I get a "400 Bad Request"

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fix="http://10.6.1.21:8080/Consol/FIXED_NETWORK">
<soapenv:Header/>
<soapenv:Body>
<fix:system_status>
<fix:SysStatusXML>
<![CDATA[<SystemStatus><StartDate>20110101</StartDate><EndDate>20110625</EndDate><SiteID>36801</SiteID></SystemStatus>]]
</fix:SysStatusXML>
</fix:system_status>
</soapenv:Body>


However using &gt; and $lt; the webservice works correctly.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fix="http://10.6.1.21:8080/Consol/FIXED_NETWORK">
<soapenv:Header/>
<soapenv:Body>
<fix:system_status>
<fix:SysStatusXML>
&lt;SystemStatus&gt;&lt;StartDate&gt;20110101&lt;/StartDate&gt;&lt;EndDate&gt;20110625&lt;/EndDate&gt;&lt;SiteID&gt;36801&lt;/SiteID&gt;&lt;/SystemStatus&gt;
</fix:SysStatusXML>
</fix:system_status>
</soapenv:Body>
</soapenv:Envelope

</soapenv:Envelope>

Is there something I am overlooking? I am trying to base my example off of the SoapUI examples given here. http://www.soapui.org/Functional-Testin ... cdata.html
kvasko
User
 
Posts: 2
Joined: 29 Jun 2011 17:49

Re: CDATA XML input seemingly being parsed incorrectly

Postby Finan » 01 Jul 2011 10:36

change: <![CDATA[<SystemStatus><StartDate>20110101</StartDate><EndDate>20110625</EndDate><SiteID>36801</SiteID></SystemStatus>]]

into:
<![CDATA[<SystemStatus><StartDate>20110101</StartDate><EndDate>20110625</EndDate><SiteID>36801</SiteID></SystemStatus>]]>

And you should be fine
Finan
Wizard
Wizard
 
Posts: 126
Joined: 06 Dec 2010 16:18

Re: CDATA XML input seemingly being parsed incorrectly

Postby kvasko » 01 Jul 2011 16:39

That does not seem to work either.

Here is the example of what I am talking about

http://i.imgur.com/a7A98.jpg

It is like soapUI is just stopping on the first ">". You can see what I mean by the image above. The CDATA data should be all in red from syntax highlighting but it stops as soon as the first ">" is found.
kvasko
User
 
Posts: 2
Joined: 29 Jun 2011 17:49

Re: CDATA XML input seemingly being parsed incorrectly

Postby leathej1 » 18 Jul 2011 21:04

Yep. I'm seeing the exact same thing here.
leathej1
User
 
Posts: 2
Joined: 18 Jul 2011 20:57

Re: CDATA XML input seemingly being parsed incorrectly

Postby RichardCPaterson » 12 Sep 2011 16:20

I also have the same problem. This wouldn't be too bad as replacing the tags with &lt; and &gt; works fine; however, another feature of soapUI breaks this workaround.

Property transfer steps seem to rewrite messages for you, "correct" all the &lt; and &gt; workarounds and encapsulate everything in CDATA tags, which it then incorrectly parses.

This has given me rage. >:(
RichardCPaterson
User
 
Posts: 1
Joined: 12 Sep 2011 15:42

Re: CDATA XML input seemingly being parsed incorrectly

Postby VinodPSingh » 22 Dec 2011 09:12

Thanks Kvasko and Finan!!

I was stuck with similar problem !! but for me both the foramts are working fine i.e.

&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;BODY&gt;&lt;GETNIA&gt;&lt;AMO&gt;KGGRCEECX1Kx01N&lt;/AMO&gt;&lt;RESOURCETYPE&gt;1&lt;/RESOURCETYPE&gt;&lt;/GETNIA&gt;&lt;/BODY&gt;

AND

<![CDATA[<?xml version="1.0" encoding="UTF-8"?><BODY><GETNIA><AMO>KGGRCEECX1Kx01N</AMO><RESOURCETYPE>1</RESOURCETYPE></GETNIA></BODY>]]>
VinodPSingh
User
 
Posts: 1
Joined: 22 Dec 2011 09:01


Return to soapUI Bugs