public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel)
{
MessageBuffer buffer = request.CreateBufferedCopy(Int32.MaxValue);
Message reply = buffer.CreateMessage();
XmlDocument NewbodyDoc = new XmlDocument();
NewbodyDoc.Load(reply.ToString);
XmlNodeList strval = NewbodyDoc.GetElementsByTagName("SSNIdentification");
if (strval.Count > 0)
{
XmlNode xmlNode = strval.Item(0);
string strRval = xmlNode.InnerText;}
我试图使用WCF拦截器从输入消息中提取一个元素。但我在Line NewbodyDoc.Load(reply.ToString);
收到错误有没有人知道我做错了什么。
答案 0 :(得分:0)
ToString()
是一种方法,你错过了角度支撑
更改此
NewbodyDoc.Load(reply.ToString);
要
NewbodyDoc.Load(reply.ToString());
快乐编码:)