public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.MessageInspectors.Add(new ExceptionMessageInspector());
 }
Ejemplo n.º 2
0
 void System.ServiceModel.Description.IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
 }
        private void InitializeFactories()
        {
            ISecurityCapabilities      securityCapabilities = BootstrapSecurityBindingElement.GetProperty <ISecurityCapabilities>(IssuerBindingContext);
            SecurityCredentialsManager securityCredentials  = IssuerBindingContext.BindingParameters.Find <SecurityCredentialsManager>();

            if (securityCredentials == null)
            {
                securityCredentials = ClientCredentials.CreateDefaultCredentials();
            }

            BindingContext context = IssuerBindingContext;

            _bootstrapSecurityBindingElement.ReaderQuotas = context.GetInnerProperty <XmlDictionaryReaderQuotas>();
            if (_bootstrapSecurityBindingElement.ReaderQuotas == null)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new InvalidOperationException(SR.EncodingBindingElementDoesNotHandleReaderQuotas));
            }

            TransportBindingElement transportBindingElement = context.RemainingBindingElements.Find <TransportBindingElement>();

            if (transportBindingElement != null)
            {
                _bootstrapSecurityBindingElement.MaxReceivedMessageSize = transportBindingElement.MaxReceivedMessageSize;
            }

            SecurityProtocolFactory securityProtocolFactory = BootstrapSecurityBindingElement.CreateSecurityProtocolFactory <IRequestChannel>(IssuerBindingContext.Clone(), securityCredentials, false, IssuerBindingContext.Clone());

            if (_localAddress != null)
            {
                MessageFilter issueAndRenewFilter = new SessionActionFilter(_standardsManager, IssueResponseAction.Value, RenewResponseAction.Value);
                context.BindingParameters.Add(new LocalAddressProvider(_localAddress, issueAndRenewFilter));
            }

            ChannelBuilder  channelBuilder = new ChannelBuilder(context, true);
            IChannelFactory innerChannelFactory;

            // if the underlying transport does not support request/reply, wrap it inside
            // a service channel factory.
            if (channelBuilder.CanBuildChannelFactory <IRequestChannel>())
            {
                innerChannelFactory            = channelBuilder.BuildChannelFactory <IRequestChannel>();
                _requiresManualReplyAddressing = true;
            }
            else
            {
                ClientRuntime clientRuntime = new ClientRuntime("RequestSecuritySession", NamingHelper.DefaultNamespace);
                clientRuntime.UseSynchronizationContext    = false;
                clientRuntime.AddTransactionFlowProperties = false;
                clientRuntime.ValidateMustUnderstand       = false;
                ServiceChannelFactory serviceChannelFactory = ServiceChannelFactory.BuildChannelFactory(channelBuilder, clientRuntime);

                ClientOperation issueOperation = new ClientOperation(serviceChannelFactory.ClientRuntime, "Issue", IssueAction.Value);
                issueOperation.Formatter = s_operationFormatter;
                serviceChannelFactory.ClientRuntime.Operations.Add(issueOperation);

                ClientOperation renewOperation = new ClientOperation(serviceChannelFactory.ClientRuntime, "Renew", RenewAction.Value);
                renewOperation.Formatter = s_operationFormatter;
                serviceChannelFactory.ClientRuntime.Operations.Add(renewOperation);
                innerChannelFactory            = new RequestChannelFactory(serviceChannelFactory);
                _requiresManualReplyAddressing = false;
            }

            SecurityChannelFactory <IAsyncRequestChannel> securityChannelFactory = new SecurityChannelFactory <IAsyncRequestChannel>(
                securityCapabilities, IssuerBindingContext, channelBuilder, securityProtocolFactory, innerChannelFactory);

            // attach the ExtendedProtectionPolicy to the securityProtcolFactory so it will be
            // available when building the channel.
            if (transportBindingElement != null)
            {
                if (securityChannelFactory.SecurityProtocolFactory != null)
                {
                    securityChannelFactory.SecurityProtocolFactory.ExtendedProtectionPolicy = transportBindingElement.GetProperty <ExtendedProtectionPolicy>(context);
                }
            }

            _rstChannelFactory = securityChannelFactory;
            MessageVersion     = securityChannelFactory.MessageVersion;
        }
Ejemplo n.º 4
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.MessageInspectors.Add(this);
 }
Ejemplo n.º 5
0
        protected override void AddClientErrorInspector(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
        {
            clientRuntime.ClientMessageInspectors.Add(new WfClientErrorInspector());

            base.AddClientErrorInspector(endpoint, clientRuntime);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Implements a modification or extension of the client across an endpoint.
 /// </summary>
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.ClientMessageInspectors.Add(new WcfMessageInspector());
 }
 public void ApplyClientBehavior(ContractDescription description, ServiceEndpoint endpoint, ClientRuntime proxy)
 {
     return;
 }
Ejemplo n.º 8
0
 public void ApplyClientBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
 }
Ejemplo n.º 9
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.MessageInspectors.Add(performanceCounterInterceptor);
 }
Ejemplo n.º 10
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     //Logger.WriteLogEntry("Inside the ApplyClientBehavior");
 }
Ejemplo n.º 11
0
 public void ApplyClientBehavior(System.ServiceModel.Description.ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.ClientMessageInspectors.Add(this);
 }
Ejemplo n.º 12
0
 void IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime) => clientRuntime.ClientMessageInspectors.Add(this);
Ejemplo n.º 13
0
 public void ApplyClientBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
                                 ClientRuntime clientRuntime)
 {
     this.CreateMyDataContractSerializerOperationBehaviors(contractDescription);
 }
Ejemplo n.º 14
0
 public override void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     base.ApplyClientBehavior(endpoint, clientRuntime);
 }
 void IContractBehavior.ApplyClientBehavior(ContractDescription description, ServiceEndpoint endpoint, ClientRuntime proxy)
 {
 }
Ejemplo n.º 16
0
 void IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
 }
Ejemplo n.º 17
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.MessageInspectors.Add(new MessageHttpHeaderInspector(this.userName, this.password));
 }
Ejemplo n.º 18
0
 public void ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.MessageInspectors.Add(new AmazonSigningMessageInspector(accessKeyId, secretKey));
 }
 void IEndpointBehavior.ApplyClientBehavior(ServiceEndpoint serviceEndpoint, ClientRuntime behavior)
 {
 }
Ejemplo n.º 20
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     myMessageInspector.ModifyTags = ModifyTags;
     clientRuntime.ClientMessageInspectors.Add(myMessageInspector);
 }
Ejemplo n.º 21
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.ClientMessageInspectors.Add(new PasswordDigestMessageInspector(Usuario, Password));
 }
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.MessageInspectors.Add(new nfeCabecMsgFixer());
 }
Ejemplo n.º 23
0
    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    {
        var inspector = new HttpHeaderMessageInspector(this._httpHeaders);

        clientRuntime.ClientMessageInspectors.Add(inspector);
    }
Ejemplo n.º 24
0
    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    {
        ClientMessageLogger inspector = new ClientMessageLogger();

        clientRuntime.ClientMessageInspectors.Add(inspector);
    }
Ejemplo n.º 25
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     throw new Exception("Behavior not supported on the consumer side!");
 }
Ejemplo n.º 26
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
 }
Ejemplo n.º 27
0
 protected override void AddClientErrorInspector(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     base.AddClientErrorInspector(endpoint, clientRuntime);
 }
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     Counter++;
 }
Ejemplo n.º 29
0
 public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
 {
     clientRuntime.ClientMessageInspectors.Add(new CustomMessageInspector(_sessionId, _epicorUserId));
 }