public override void OnIncomingMessage(Message message)
        {
            if (message == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message");
            }

            if (this.ContextExchangeMechanism == ContextExchangeMechanism.HttpCookie)
            {
                this.OnReceiveHttpCookies(message);
            }
            else
            {
                this.OnReceiveSoapContextHeader(message);
            }

            // deserialize the callback context header, if present
            int headerIndex = message.Headers.FindHeader(CallbackContextMessageHeader.CallbackContextHeaderName, CallbackContextMessageHeader.CallbackContextHeaderNamespace);

            if (headerIndex > 0)
            {
                CallbackContextMessageProperty property = CallbackContextMessageHeader.ParseCallbackContextHeader(message.Headers.GetReaderAtHeader(headerIndex), message.Version.Addressing);
                message.Properties.Add(CallbackContextMessageProperty.Name, property);
            }

            ContextExchangeCorrelationHelper.AddIncomingContextCorrelationData(message);
        }
Beispiel #2
0
        public override void OnIncomingMessage(Message message)
        {
            if (message == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("message");
            }
            if (base.ContextExchangeMechanism == ContextExchangeMechanism.HttpCookie)
            {
                this.OnReceiveHttpCookies(message);
            }
            else
            {
                this.OnReceiveSoapContextHeader(message);
            }
            int headerIndex = message.Headers.FindHeader("CallbackContext", "http://schemas.microsoft.com/ws/2008/02/context");

            if (headerIndex > 0)
            {
                CallbackContextMessageProperty property = CallbackContextMessageHeader.ParseCallbackContextHeader(message.Headers.GetReaderAtHeader(headerIndex), message.Version.Addressing);
                message.Properties.Add(CallbackContextMessageProperty.Name, property);
            }
            ContextExchangeCorrelationHelper.AddIncomingContextCorrelationData(message);
        }