Page 1 of 1

Passing XML Data with CDATA Section

Posted: Fri Sep 16, 2011 1:33 am
by raghav_ds
I have a general Web-service, which accepts xml inputs with CDATA section. The webservice does not work if we do not have CDATA section in the request.

Sample XML is given below:

In this xml we need send our input xml under request tab with CDATA section.

Code: Select all

<soapenv:Envelope xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" > 
<soapenv:Body> 
    <web:XMLProcessor> 
      <web:request> 
        <![CDATA[[b]Input XML[/b]]]> 
      </web:request> 
    </web:XMLProcessor> 
  </soapenv:Body> 
</soapenv:Envelope> 

[b]XML Input[/b]
<Header1>
<?Instruction1 Update?>
<?Userid Userid?>
<?Password Password?>
<?Table Table1?>
<Heder2>xyz<Header2>
<Header3 Operator="not in">'ABC','Cde'<Header3>
........<Header1>
I have constructed the XML Input using XML O/p Stage and specified the data Element as XML. I am able to construct the entire xml but unable to add <![CDATA[]]> section. How can I achieve this. I tried to do it for entire xml, which is not working at the source web service side.

Also I need to know how can I remove <?xml version="1.0" encoding="UTF-8"?> as it is written by default when ever we use an xml output stage. For example if we use 3 o/p stages for constructing a single xml, then the tag is written 3 times.

Posted: Fri Sep 16, 2011 6:32 am
by eostic
...eliminate the header in any of your xmlOutput Stages by checking the Generate XML Chunk box...

As for the CDATA, if it's not appearing in some cases, it "sounds" like the <web:request> element might be null. Make sure that the value of that column (where you build the header and has xpath that ends with /web:request/text() ) is never null.........

Ernie