Passing XML Data with CDATA Section

Dedicated to DataStage and DataStage TX editions featuring IBM<sup>®</sup> Service-Oriented Architectures.

Moderators: chulett, rschirm

Post Reply
raghav_ds
Premium Member
Premium Member
Posts: 40
Joined: Wed May 04, 2011 2:21 am

Passing XML Data with CDATA Section

Post 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.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post 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
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply