ClientMessageInspector를 사용하여 웹 서비스의 응답을 수정하려고합니다. 어떤 시점에서 수정 된 XMLStream
에서 Message
을 생성해야합니다. 스트림의 내용은 다음과 같습니다 :WCF에서 XML 응답 수정. 깨진 XML
System.Xml.XmlReader XMLReader = System.Xml.XmlReader.Create(XMLStream);
Message ModifiedReply = System.ServiceModel.Channels.Message.CreateMessage(OriginalReply.Version, null, XMLReader);
을 그러나 나는 Message.ToString (와 메시지 내용을 인쇄 할 때) 내가 얻을 :
<s:Envelope xmlns:s="http://env">
<s:Header />
<s:Body>
... stream ...
</s:Body>
</s:Envelope>
<soapenv:Envelope xmlns:soapenv="http://env" xmlns:xsd="http://xsd" xmlns:xsi="http://xsi" xmlns:v1="http://v1">
<soapenv:Body>
<v1:VM>
<SH>
<a>aa</a>
<b>bb</b>
</SH>
</v1:VM>
</soapenv:Body>
</soapenv:Envelope>
내가 사용하여 메시지를 만들려고
어떻게 "... 스트림 ..."을 방지하고 실제 XML 부분을 가져올 수 있습니까?