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
pbenitoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
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
0
pbenitoAuthor Commented:
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
0
Bob LearnedCommented:
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
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

pbenitoAuthor Commented:
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
0
Bob LearnedCommented:
Hmmm, I wonder if you could just return a string to the client, and construct an XmlDocument from the XML fragment instead?

Bob
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pbenitoAuthor Commented:
Does the SOAP envelope enclose strings with CDATA?

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

Bob
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.