0 out of 1 rated this helpful - Rate this topic

TransportClientEndpointBehavior Class

Describes the WCF endpoint behavior that is used to specify the Service Bus credentials for a particular endpoint.

System.Object
  Microsoft.ServiceBus.TransportClientEndpointBehavior

Namespace:  Microsoft.ServiceBus
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)
public sealed class TransportClientEndpointBehavior : IEndpointBehavior

The TransportClientEndpointBehavior type exposes the following members.

  Name Description
Public method TransportClientEndpointBehavior() Initializes a new instance of the TransportClientEndpointBehavior class.
Public method TransportClientEndpointBehavior(TokenProvider) Initializes a new instance of the TransportClientEndpointBehavior class.
Top
  Name Description
Public property Credentials Obsolete. Gets the credentials for the endpoint.
Public property CredentialType Obsolete. Gets or sets a value that specifies which of the credentials specified on the composite TransportClientCredentials instance referred to by the Credentials property is effective in this behavior.
Public property TokenProvider Gets or sets the token provider that is used as a binding parameter.
Top
  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetType (Inherited from Object.)
Protected method MemberwiseClone (Inherited from Object.)
Public method ToString (Inherited from Object.)
Top
  Name Description
Explicit interface implemetation Private method IEndpointBehavior.AddBindingParameters Passes the specified data at runtime to the specified binding to support Service Bus credential behavior.
Explicit interface implemetation Private method IEndpointBehavior.ApplyClientBehavior Implements a modification or extension of the client across an endpoint.
Explicit interface implemetation Private method IEndpointBehavior.ApplyDispatchBehavior Implements a modification or extension of the service across an endpoint.
Explicit interface implemetation Private method IEndpointBehavior.Validate Confirms that the endpoint is a valid Service Bus endpoint that can be modified by the behavior of this instance.
Top

Service Bus supports only Full Trust code access security.

Instances of this behavior are shareable across endpoints so that the descriptions of multiple endpoints (listener and channels) using the same Service Bus credentials can be populated with the same configured instance of this class.

The behavior can be defined and applied to endpoints in code and in configuration files. For more information, see Configuring an AppFabric Service Bus Application.

The following code example defines a behavior for a service endpoint that specifies shared secret credentials and adds this behavior to the service host before opening it.

Uri address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespaceDomain, "SharedSecretAuthenticationService");

TransportClientEndpointBehavior behavior = new TransportClientEndpointBehavior();
behavior.CredentialType = TransportClientCredentialType.SharedSecret;
behavior.Credentials.SharedSecret.IssuerName = issuerName;
behavior.Credentials.SharedSecret.IssuerSecret = issuerSecret;

ServiceHost host = new ServiceHost(typeof(EchoService), address);
host.Description.Endpoints[0].Behaviors.Add(behavior);
host.Open();

Dim address As Uri = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespaceDomain, "SharedSecretAuthenticationService")

Dim behavior As New TransportClientEndpointBehavior()
behavior.CredentialType = TransportClientCredentialType.SharedSecret
behavior.Credentials.SharedSecret.IssuerName = issuerName
behavior.Credentials.SharedSecret.IssuerSecret = issuerSecret

Dim host As New ServiceHost(GetType(EchoService), address)
host.Description.Endpoints(0).Behaviors.Add(behavior)
host.Open()
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)