Opc.Ua.ServiceMessageContextMessageInspector.BeforeSendRequest C# (CSharp) Method

BeforeSendRequest() public method

Enables inspection or modification of a message before a request message is sent to a service.
public BeforeSendRequest ( Message &request, IClientChannel channel ) : object
request Message The message to be sent to the service.
channel IClientChannel The WCF client object channel.
return object
        public object BeforeSendRequest(ref Message request, IClientChannel channel)
        {
            OperationContext context = OperationContext.Current;

            if (context != null)
            {
                context.Extensions.Add(new MessageContextExtension(m_messageContext));
            }
            
            ServiceMessageContext.ThreadContext = m_messageContext;
            return request.Headers.MessageId;
        }
        #endregion