'Microsoft.ServiceBus.TransportClientCredentialType' is obsolete

Once you upgrade to the Windows Azure SDK 1.6 you also get the updated Microsoft Service Bus assemblies (version 1.6.0.0) that you can use for working with Windows Azure Service Bus (yeah, no longer AppFabric Service Bus)

One of the standard implementations of Service Bus is  to use the CredentialType, Credentials (the service bus namespace and the issuer key and issuer name) to create the service bus namespace URI.

Once you upgrade to Windows Azure Service Bus (Microsoft.ServiceBus) version 1.6.0.0, the following are the errors you might encounter.  These are rather warnings.

'Microsoft.ServiceBus.TransportClientCredentialType' is obsolete

'Microsoft.ServiceBus.TransportClientEndpointBehavior.CredentialType' is obsolete: '"This property is deprecated. Please use TransportClientEndpointBehavior.TokenProvider instead."'

'Microsoft.ServiceBus.TransportClientEndpointBehavior.Credentials' is obsolete: '"This property is deprecated. Please use TransportClientEndpointBehavior.TokenProvider instead."'

'Microsoft.ServiceBus.TransportClientEndpointBehavior.Credentials' is obsolete: '"This property is deprecated. Please use TransportClientEndpointBehavior.TokenProvider instead."'

While this is nicely documented in the release notes, the new equivalent for this is Token Provider.  So here below is a sample implementation code which uses Token Provider and TransportClientEndPointBehaviour namespaces.

Uri serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "SERVICE NAME”);

// create the credentials object for the endpoint

TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior();

TokenProvider tokenProvider = tokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerSecret);

sharedSecretServiceBusCredential.TokenProvider = tokenProvider;

// create the channel factory loading the configuration

ChannelFactory<IDirectoryService> channelFactory = new ChannelFactory<IDirectoryService>("DirectoryEndpoint", new EndpointAddress(serviceUri));

channelFactory.Endpoint.Behaviors.Add(sharedSecretServiceBusCredential);

Cheers!!!

Print | posted on Tuesday, January 10, 2012 10:51 PM

Comments on this post

# re: 'Microsoft.ServiceBus.TransportClientCredentialType' is obsolete

Requesting Gravatar...
this is real! wow i not think is obsolete.Windows Azure Service Bus work perfect at the moment for me.

regards.
Left by maquinas de coser on Mar 20, 2012 4:43 PM

# re: 'Microsoft.ServiceBus.TransportClientCredentialType' is obsolete

Requesting Gravatar...
Great posting thank you!
Left by FJ on Mar 21, 2012 9:08 PM

# re: 'Microsoft.ServiceBus.TransportClientCredentialType' is obsolete

Requesting Gravatar...
This is nice update. Thank you for posting it here. Indeed, I made an upgrade when I found this post. pmp boot camp hartford
Left by Kristin Williams on Apr 20, 2012 5:31 PM

# re: 'Microsoft.ServiceBus.TransportClientCredentialType' is obsolete

Requesting Gravatar...
wayanad resorts is the ultimate destination to wind up and relax.
Left by resorts in wayanad on Jul 07, 2012 10:07 AM

Your comment:

 (will show your gravatar)