Merge pull request #757 from mlintner/master
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Dispatcher / InputOrReplyRequestProcessor.cs
index 94cb7f7a1e7203f3bbad87e573076e472aa82e42..9210e3b10db56105cec8251fc35bc78aab25795c 100644 (file)
@@ -9,10 +9,13 @@ using System.ServiceModel.MonoInternal;
 
 namespace System.ServiceModel.Dispatcher
 {
+       // Its lifetime is per-call.
+       // ServiceRuntimeChannel's lifetime is per-session.
        internal class InputOrReplyRequestProcessor : BaseRequestProcessor
        {
                DispatchRuntime dispatch_runtime;
                IChannel reply_or_input;
+               IContextChannel context_channel;
 
                public InputOrReplyRequestProcessor (DispatchRuntime runtime, IChannel replyOrInput)
                {
@@ -41,14 +44,14 @@ namespace System.ServiceModel.Dispatcher
                public void ProcessInput (Message message)
                {
                        OperationContext opcx = CreateOperationContext (message);
-                       ProcessRequest (new MessageProcessingContext (opcx));
+                       ProcessRequest (new MessageProcessingContext (opcx, reply_or_input));
                }
 
                public void ProcessReply (RequestContext rc)
                {
                        OperationContext opcx = CreateOperationContext (rc.RequestMessage);
                        opcx.RequestContext = rc;
-                       ProcessRequest (new MessageProcessingContext (opcx));
+                       ProcessRequest (new MessageProcessingContext (opcx, reply_or_input));
                }
 
                OperationContext CreateOperationContext (Message incoming)
@@ -68,6 +71,7 @@ namespace System.ServiceModel.Dispatcher
                        OperationContext opCtx = new OperationContext (contextChannel);
                        opCtx.IncomingMessage = incoming;
                        opCtx.EndpointDispatcher = dispatch_runtime.EndpointDispatcher;
+                       context_channel = contextChannel;
                        return opCtx;
                }
        }