Esempio n. 1
0
        internal MessageRpc(RequestContext requestContext, Message request, DispatchOperationRuntime operation,
                            ServiceChannel channel, ChannelHandler channelHandler, bool cleanThread,
                            OperationContext operationContext, InstanceContext instanceContext, EventTraceActivity eventTraceActivity)
        {
            Fx.Assert((operationContext != null), "System.ServiceModel.Dispatcher.MessageRpc.MessageRpc(), operationContext == null");
            Fx.Assert(channelHandler != null, "System.ServiceModel.Dispatcher.MessageRpc.MessageRpc(), channelHandler == null");

            this.Activity           = null;
            this.EventTraceActivity = eventTraceActivity;
            this.AsyncResult        = null;
            this.CanSendReply       = true;
            this.Channel            = channel;
            this.channelHandler     = channelHandler;
            this.Correlation        = EmptyArray <object> .Allocate(operation.Parent.CorrelationCount);

            this.DidDeserializeRequestBody = false;
            this.Error              = null;
            this.ErrorProcessor     = null;
            this.FaultInfo          = new ErrorHandlerFaultInfo(request.Version.Addressing.DefaultFaultAction);
            this.HasSecurityContext = false;
            this.Instance           = null;
            this.MessageRpcOwnsInstanceContextThrottle = false;
            this.NextProcessor        = null;
            this.NotUnderstoodHeaders = null;
            this.Operation            = operation;
            this.OperationContext     = operationContext;
            _paused = false;
            this.ParametersDisposed         = false;
            this.Request                    = request;
            this.RequestContext             = requestContext;
            this.RequestContextThrewOnReply = false;
            this.SuccessfullySendReply      = false;
            this.RequestVersion             = request.Version;
            this.Reply = null;
            this.ReplyTimeoutHelper              = new TimeoutHelper();
            this.SecurityContext                 = null;
            this.InstanceContext                 = instanceContext;
            this.SuccessfullyBoundInstance       = false;
            this.SuccessfullyIncrementedActivity = false;
            this.SuccessfullyLockedInstance      = false;
            _switchedThreads            = !cleanThread;
            this.InputParameters        = null;
            this.OutputParameters       = null;
            this.ReturnParameter        = null;
            _isInstanceContextSingleton = false;
            _invokeContinueGate         = null;

            if (!operation.IsOneWay && !operation.Parent.ManualAddressing)
            {
                this.RequestID   = request.Headers.MessageId;
                this.ReplyToInfo = new RequestReplyCorrelator.ReplyToInfo(request);
            }
            else
            {
                this.RequestID   = null;
                this.ReplyToInfo = new RequestReplyCorrelator.ReplyToInfo();
            }

            if (DiagnosticUtility.ShouldUseActivity)
            {
                this.Activity = TraceUtility.ExtractActivity(this.Request);
            }

            if (DiagnosticUtility.ShouldUseActivity || TraceUtility.ShouldPropagateActivity)
            {
                this.ResponseActivityId = ActivityIdHeader.ExtractActivityId(this.Request);
            }
            else
            {
                this.ResponseActivityId = Guid.Empty;
            }

            this.InvokeNotification = new MessageRpcInvokeNotification(this.Activity, this.channelHandler);

            if (this.EventTraceActivity == null && FxTrace.Trace.IsEnd2EndActivityTracingEnabled)
            {
                if (this.Request != null)
                {
                    this.EventTraceActivity = EventTraceActivityHelper.TryExtractActivity(this.Request, true);
                }
            }
        }
Esempio n. 2
0
        internal MessageRpc(RequestContext requestContext, Message request, DispatchOperationRuntime operation,
                            ServiceChannel channel, ServiceHostBase host, ChannelHandler channelHandler, bool cleanThread,
                            OperationContext operationContext, InstanceContext instanceContext /*, EventTraceActivity eventTraceActivity*/)
        {
            Fx.Assert((operationContext != null), "correwcf.Dispatcher.MessageRpc.MessageRpc(), operationContext == null");
            // TODO: ChannelHandler supplied an ErrorHandler, need to supply this some other way.
            //Fx.Assert(channelHandler != null, "System.ServiceModel.Dispatcher.MessageRpc.MessageRpc(), channelHandler == null");

            //this.Activity = null;
            //this.EventTraceActivity = eventTraceActivity;
            AsyncResult               = null;
            TaskResult                = null;
            CanSendReply              = true;
            Channel                   = channel;
            this.channelHandler       = channelHandler;
            Correlation               = EmptyArray.Allocate(operation.Parent.CorrelationCount);
            DidDeserializeRequestBody = false;
            Error              = null;
            ErrorProcessor     = null;
            FaultInfo          = new ErrorHandlerFaultInfo(request.Version.Addressing.DefaultFaultAction);
            HasSecurityContext = false;
            Host                            = host;
            Instance                        = null;
            AsyncProcessor                  = null;
            NotUnderstoodHeaders            = null;
            Operation                       = operation;
            OperationContext                = operationContext;
            paused                          = false;
            ParametersDisposed              = false;
            Request                         = request;
            RequestContext                  = requestContext;
            RequestContextThrewOnReply      = false;
            SuccessfullySendReply           = false;
            RequestVersion                  = request.Version;
            Reply                           = null;
            ReplyTimeoutHelper              = new TimeoutHelper();
            SecurityContext                 = null;
            InstanceContext                 = instanceContext;
            SuccessfullyBoundInstance       = false;
            SuccessfullyIncrementedActivity = false;
            SuccessfullyLockedInstance      = false;
            switchedThreads                 = !cleanThread;
            //this.transaction = null;
            InputParameters            = null;
            OutputParameters           = null;
            ReturnParameter            = null;
            isInstanceContextSingleton = InstanceContextProviderBase.IsProviderSingleton(Channel.DispatchRuntime.InstanceContextProvider);
            invokeContinueGate         = null;

            if (!operation.IsOneWay && !operation.Parent.ManualAddressing)
            {
                RequestID   = request.Headers.MessageId;
                ReplyToInfo = new RequestReplyCorrelator.ReplyToInfo(request);
            }
            else
            {
                RequestID   = null;
                ReplyToInfo = new RequestReplyCorrelator.ReplyToInfo();
            }

            //if (DiagnosticUtility.ShouldUseActivity)
            //{
            //    this.Activity = TraceUtility.ExtractActivity(this.Request);
            //}

            //if (DiagnosticUtility.ShouldUseActivity || TraceUtility.ShouldPropagateActivity)
            //{
            //    this.ResponseActivityId = ActivityIdHeader.ExtractActivityId(this.Request);
            //}
            //else
            //{
            ResponseActivityId = Guid.Empty;
            //}

            //if (this.EventTraceActivity == null && FxTrace.Trace.IsEnd2EndActivityTracingEnabled)
            //{
            //    if (this.Request != null)
            //    {
            //        this.EventTraceActivity = EventTraceActivityHelper.TryExtractActivity(this.Request, true);
            //    }
            //}
        }
Esempio n. 3
0
 internal void PrepareInvokeContinueGate()
 {
     _invokeContinueGate = new SignalGate <IAsyncResult>();
 }
 internal MessageRpc(System.ServiceModel.Channels.RequestContext requestContext, Message request, DispatchOperationRuntime operation, ServiceChannel channel, ServiceHostBase host, ChannelHandler channelHandler, bool cleanThread, System.ServiceModel.OperationContext operationContext, System.ServiceModel.InstanceContext instanceContext)
 {
     this.Activity                   = null;
     this.AsyncResult                = null;
     this.CanSendReply               = true;
     this.Channel                    = channel;
     this.channelHandler             = channelHandler;
     this.Correlation                = EmptyArray.Allocate(operation.Parent.CorrelationCount);
     this.CorrelationCallback        = null;
     this.DidDeserializeRequestBody  = false;
     this.TransactionMessageProperty = null;
     this.TransactedBatchContext     = null;
     this.Error              = null;
     this.ErrorProcessor     = null;
     this.FaultInfo          = new ErrorHandlerFaultInfo(request.Version.Addressing.DefaultFaultAction);
     this.HasSecurityContext = false;
     this.Host     = host;
     this.Instance = null;
     this.MessageRpcOwnsInstanceContextThrottle = false;
     this.NextProcessor        = null;
     this.NotUnderstoodHeaders = null;
     this.Operation            = operation;
     this.OperationContext     = operationContext;
     this.paused                     = false;
     this.ParametersDisposed         = false;
     this.ReceiveContext             = null;
     this.Request                    = request;
     this.RequestContext             = requestContext;
     this.RequestContextThrewOnReply = false;
     this.SuccessfullySendReply      = false;
     this.RequestVersion             = request.Version;
     this.Reply = null;
     this.ReplyTimeoutHelper              = new TimeoutHelper();
     this.SecurityContext                 = null;
     this.InstanceContext                 = instanceContext;
     this.SuccessfullyBoundInstance       = false;
     this.SuccessfullyIncrementedActivity = false;
     this.SuccessfullyLockedInstance      = false;
     this.switchedThreads                 = !cleanThread;
     this.transaction                = null;
     this.InputParameters            = null;
     this.OutputParameters           = null;
     this.ReturnParameter            = null;
     this.isInstanceContextSingleton = InstanceContextProviderBase.IsProviderSingleton(this.Channel.DispatchRuntime.InstanceContextProvider);
     this.invokeContinueGate         = null;
     if (!operation.IsOneWay && !operation.Parent.ManualAddressing)
     {
         this.RequestID   = request.Headers.MessageId;
         this.ReplyToInfo = new System.ServiceModel.Channels.RequestReplyCorrelator.ReplyToInfo(request);
     }
     else
     {
         this.RequestID   = null;
         this.ReplyToInfo = new System.ServiceModel.Channels.RequestReplyCorrelator.ReplyToInfo();
     }
     this.HostingProperty = AspNetEnvironment.Current.PrepareMessageForDispatch(request);
     if (DiagnosticUtility.ShouldUseActivity)
     {
         this.Activity = TraceUtility.ExtractActivity(this.Request);
     }
     if (DiagnosticUtility.ShouldUseActivity || TraceUtility.ShouldPropagateActivity)
     {
         this.ResponseActivityId = ActivityIdHeader.ExtractActivityId(this.Request);
     }
     else
     {
         this.ResponseActivityId = Guid.Empty;
     }
     this.InvokeNotification = new MessageRpcInvokeNotification(this.Activity, this.channelHandler);
 }