1
我正在使用XmlDocument读取XML文档的内容,然后将这些内容一起传递到Web服务请求的SOAP消息正文中。然而,在实际被相处在呼叫传递的数据的<(这是从XML文档读取)和>符号正在与XmlDocument读取作为SOAP消息正文传递的XML文件
> and <
这是造成在接收端的问题代替。
我错过了什么?
这里是我的代码片段:
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);
感谢任何及所有的帮助。