0
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;}

I was trying to extract one element from the input message using WCF Interceptor. but i am getting error at Line NewbodyDoc.Load(reply.ToString);

Does any one has idea what am i doing wrong.

user1104946
  • 680
  • 1
  • 9
  • 30

1 Answers1

0

ToString() is a method and you have missed the angular braces

Change this

 NewbodyDoc.Load(reply.ToString);

To

 NewbodyDoc.Load(reply.ToString());

Happy Coding :)

dreamweiver
  • 6,002
  • 2
  • 24
  • 39