Link to home
Start Free TrialLog in
Avatar of pbenito
pbenito

asked on

How do I transmit an XML document via SOAP?

Hi,
 
   I am developing a web service in C# 3.0 that extracts an XML document out of an Oracle 11g database and sends the entire document back to the client.  I have tried sending and XMLNode via SOAP and noticed that it strips out XML processing instructions (<? & ?>) and document type definitions (<! & >), becuase they are not allowed in SOAP.  WIth that said, how can I encode the XML file and be able to send it back to the client without modifying its contents?

Thanks,
Pat
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Usually if you don't want content to be processed, it would need to go in a CDATA element.

Example
<![CDATA[<client>Smith & Barney</client>]]>

Bob
Avatar of pbenito
pbenito

ASKER

Thanks Bob.

I do not want to modify the XML document after retrieving it out of the database.  Is there an encoding method that I can use to send it via SOAP?

Pat
Pat,

Can you tell me how you are "extracting an XML document out of an Oracle 11g database and sending the entire document back to the client"?

Bob
Avatar of pbenito

ASKER

Sure.  I have the XML document stored as an xml type in oracle.  I have an XQuery statement to return the XML document, and then I have an XMLNode as the return type on my web service.  When the client gets the XMLNode it has the processing instructions parsed out.

Thanks,
Pat
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pbenito

ASKER

Does the SOAP envelope enclose strings with CDATA?

Pat
Or, even better would be to wrap the XmlNode in a CDATA data, without modifying the source XML.

Bob