XmlDocument to read XML file, passed as SOAP message body

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello all,

I am using XmlDocument to read an XML documents contents and then pass those contents along in the SOAP message body of a web service request. However, in the data that is actually getting passed along in the call (that was read from the XML document) the
< and > symbols are being replaced with &gt; and &lt; which is causing issues on the receiving end.
What am I missing?

Here is a snippet of my code:

<pre class="prettyprint" style=" string filePath = FileList.SelectedItem.Value;
string doc = File.ReadAllText(filePath);

XmlDocument xDoc = new XmlDocument { PreserveWhitespace = true };
xDoc.LoadXml(doc);


MyService.TransactionRequest request = new MyService.TransactionRequest { message = xDoc.OuterXml };


MyService.TransactionClient client = new MyService.TransactionClient();


client.ProcessTransaction(request);[/code]
<br/>
Thanks for any and all help.
<br/>
<br/>

View the full article
 
Back
Top