[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 788
  • Last Modified:

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
0
pbenito
Asked:
pbenito
  • 4
  • 3
1 Solution
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
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

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now