internal ClientRuntime(System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime, SharedRuntimeState shared) : this(dispatchRuntime.EndpointDispatcher.ContractName, dispatchRuntime.EndpointDispatcher.ContractNamespace, shared)
 {
     if (dispatchRuntime == null)
     {
         throw DiagnosticUtility.ExceptionUtility.ThrowHelperArgumentNull("dispatchRuntime");
     }
     this.dispatchRuntime = dispatchRuntime;
     this.shared          = shared;
 }
Beispiel #2
0
 public EndpointDispatcher(System.ServiceModel.EndpointAddress address, string contractName, string contractNamespace, bool isSystemEndpoint)
 {
     this.originalAddress   = address;
     this.contractName      = contractName;
     this.contractNamespace = contractNamespace;
     if (address != null)
     {
         this.addressFilter = new EndpointAddressMessageFilter(address);
     }
     else
     {
         this.addressFilter = new MatchAllMessageFilter();
     }
     this.contractFilter   = new MatchAllMessageFilter();
     this.dispatchRuntime  = new System.ServiceModel.Dispatcher.DispatchRuntime(this);
     this.filterPriority   = 0;
     this.isSystemEndpoint = isSystemEndpoint;
 }
Beispiel #3
0
        private EndpointDispatcher(EndpointDispatcher baseEndpoint, IEnumerable <AddressHeader> headers)
        {
            EndpointAddressBuilder builder = new EndpointAddressBuilder(baseEndpoint.EndpointAddress);

            foreach (AddressHeader header in headers)
            {
                builder.Headers.Add(header);
            }
            System.ServiceModel.EndpointAddress address = builder.ToEndpointAddress();
            this.addressFilter     = new EndpointAddressMessageFilter(address);
            this.contractFilter    = baseEndpoint.ContractFilter;
            this.contractName      = baseEndpoint.ContractName;
            this.contractNamespace = baseEndpoint.ContractNamespace;
            this.dispatchRuntime   = baseEndpoint.DispatchRuntime;
            this.filterPriority    = baseEndpoint.FilterPriority + 1;
            this.originalAddress   = address;
            if (PerformanceCounters.PerformanceCountersEnabled)
            {
                this.perfCounterId     = baseEndpoint.perfCounterId;
                this.perfCounterBaseId = baseEndpoint.perfCounterBaseId;
            }
            this.id = baseEndpoint.id;
        }
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     //throw new NotImplementedException();
 }
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     dispatchRuntime.ChannelDispatcher.ChannelInitializers.Add(this);
 }
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     _ob = _ob ?? CreateBehavior(contractDescription.Name);
     if (_ob == null)
     {
         throw new ArgumentException("no behavior instance was found to inject");
     }
     foreach (OperationDescription opDescription in contractDescription.Operations)
     {
         opDescription.Behaviors.Add(_ob);
     }
 }
Beispiel #7
0
 void IContractBehavior.ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
 }
Beispiel #8
0
 public void ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatch)
 {
     foreach (OperationDescription opDesc in description.Operations)
     {
         ApplyDataContractSurrogate(opDesc);
     }
 }
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     return;
 }
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     dispatchRuntime.InstanceProvider = new UnityInstanceProvider(contractDescription.ContractType, this.ContainerName);
 }
        public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
        {
            // We iterate over the operation descriptions in the contract and
            // record the QName of the request body child element and corresponding operation name
            // to the dictionary to be used for dispatch
            Dictionary <XmlQualifiedName, string> dispatchDictionary = new Dictionary <XmlQualifiedName, string>();

            foreach (OperationDescription operationDescription in contractDescription.Operations)
            {
                XmlQualifiedName qname =
                    new XmlQualifiedName(operationDescription.Messages[0].Body.WrapperName, operationDescription.Messages[0].Body.WrapperNamespace);

                dispatchDictionary.Add(qname, operationDescription.Name);
            }

            // Lastly, we create and assign and instance of our operation selector that
            // gets the dispatch dictionary we've just created.
            dispatchRuntime.OperationSelector =
                new DispatchByBodyElementOperationSelector(dispatchDictionary);
        }
        internal static IInstanceContextProvider GetProviderForMode(InstanceContextMode instanceMode, System.ServiceModel.Dispatcher.DispatchRuntime runtime)
        {
            switch (instanceMode)
            {
            case InstanceContextMode.PerSession:
                return(new PerSessionInstanceContextProvider(runtime));

            case InstanceContextMode.PerCall:
                return(new PerCallInstanceContextProvider(runtime));

            case InstanceContextMode.Single:
                return(new SingletonInstanceContextProvider(runtime));
            }
            DiagnosticUtility.FailFast("InstanceContextProviderBase.GetProviderForMode: default");
            return(null);
        }
 internal InstanceContextProviderBase(System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     this.dispatchRuntime = dispatchRuntime;
 }
        public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
        {
            Type serviceContractType = contractDescription.ContractType;

            dispatchRuntime.InstanceProvider = new PolicyInjectionInstanceProvider(serviceContractType, this.PolicyInjectorName);
        }
Beispiel #15
0
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     dispatchRuntime.InstanceProvider = new SampleInstanceProvider();
 }
Beispiel #16
0
 /// <summary>
 /// Implements a modification or extension of the client across a contract.
 /// </summary>
 /// <param name="contractDescription">The contract description to be modified.</param>
 /// <param name="endpoint">The endpoint that exposes the contract.</param>
 /// <param name="dispatchRuntime">The dispatch runtime that controls service execution.</param>
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     ReplaceSerializerOperationBehavior(contractDescription);
 }
 void IContractBehavior.ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     dispatchRuntime.MessageInspectors.Add(new Inspectors.MessageInspector());
 }
Beispiel #18
0
 public void ApplyDispatchBehavior(System.ServiceModel.Description.ContractDescription contractDescription, System.ServiceModel.Description.ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     dispatchRuntime.InstanceProvider = this;
 }
 void System.ServiceModel.Description.IContractBehavior.ApplyDispatchBehavior(System.ServiceModel.Description.ContractDescription description, System.ServiceModel.Description.ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatch)
 {
 }
 public RequestInfo(System.ServiceModel.Dispatcher.ChannelHandler channelHandler)
 {
     this.Endpoint = null;
     this.ExistingInstanceContext = null;
     this.Channel = null;
     this.EndpointLookupDone = false;
     this.DispatchRuntime = null;
     this.RequestContext = null;
     this.ChannelHandler = channelHandler;
     this.ChannelHandlerOwnsCallThrottle = false;
     this.ChannelHandlerOwnsInstanceContextThrottle = false;
 }
        public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
        {
            List <string> operations = new List <string>();

            foreach (OperationDescription operationDescription in contractDescription.Operations)
            {
                operations.Add(operationDescription.Name);
            }

            dispatchRuntime.OperationSelector = new DispatchByBodyElementOperationSelector(operations, dispatchRuntime.UnhandledDispatchOperation.Name);
        }
Beispiel #22
0
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     if (this.Enable)
     {
         _contractDescription = contractDescription;
         foreach (OperationDescription description in contractDescription.Operations)
         {
             ApplyDataContractSurrogate(description, this.IsBehaviorExtensions, this.ExportAsText);
         }
     }
 }
Beispiel #23
0
 void IContractBehavior.ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     dispatchRuntime.SynchronizationContext = mStaContext;
 }
 internal InstanceContextProviderBase(System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     this.dispatchRuntime = dispatchRuntime;
 }
Beispiel #25
0
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     foreach (var operation in contractDescription.Operations)
     {
         ReplaceDataContractSerializerOperationBehavior(operation);
     }
 }
Beispiel #26
0
 void IContractBehavior.ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     this._contractDescription = contractDescription;
     CyclicReferencesAwareContractBehavior.ReplaceDataContractSerializerOperationBehaviors(contractDescription, On);
 }
 public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.DispatchRuntime dispatchRuntime)
 {
     dispatchRuntime.OperationSelector =
         new DispatchByBodyElementOperationSelector();
 }