XmlDocument を使用して XML ドキュメントのコンテンツを読み取り、それらのコンテンツを Web サービス要求の 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);
助けてくれてありがとう。