示例#1
0
        /// <summary>
        /// Implements a modification or extension of the client across an endpoint.
        /// </summary>
        /// <param name="endpoint">The endpoint that exposes the contract.</param>
        /// <param name="endpointDispatcher">The endpoint dispatcher to be modified or extended.</param>
        public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
        {
            var channelDispatcher = endpointDispatcher.ChannelDispatcher;

            if (channelDispatcher == null)
            {
                return;
            }
            foreach (var ed in channelDispatcher.Endpoints)
            {
                var inspector = new WcfUserSessionBehaviour();
                ed.DispatchRuntime.MessageInspectors.Add(inspector);
            }
        }
示例#2
0
        /// <summary>
        /// Implements a modification or extension of the client across an endpoint. (Nothing is done here)
        /// </summary>
        /// <param name="endpoint">The endpoint that is to be customized.</param>
        /// <param name="clientRuntime">The client runtime to be customized.</param>
        public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
        {
            var inspector = new WcfUserSessionBehaviour();

            clientRuntime.MessageInspectors.Add(inspector);
        }