Log WCF soap message parameters and method name RRS feed

  • Question

  • I am using Log4net and have a method to log the calling context.

    What i want is that is there any way that i can log the message method name and the parameters. My current code is following

    private void LogCallingProgramContext()
                OperationContext context = OperationContext.Current;
                if (context != null)
                    MessageProperties messageProperties = context.IncomingMessageProperties;
                    var endpointProperty =
                        messageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;
                    if (endpointProperty != null)
                        string strCallingProgramContext = string.Format("Call from IP address {0} and port is {1}", endpointProperty.Address, endpointProperty.Port);

    Kamran Shahid Application Developer (MCP,MCAD,MCSD.NET,MCTS,[web])

    Sunday, August 31, 2014 4:20 PM


All replies