.NET Service Bus Walkthrough

Topics: Technical Questions, Usage Scenarios
Mar 9, 2010 at 7:30 AM

Hello,

 

I am attempting .NET Services Walkthrough (as published in May release of MSE).

 

I believe that Microsoft.MSE.Behaviors.DotNetServiceBusTransportCredentials assembly needs to update to use the current AppFabric authentication model.

 

Do you have an updated version of it or source coud. Alternatively do you have alternate policy XAML file for it?

 

Many Thanks

 

Alex

Mar 11, 2010 at 3:33 PM

I have got it working and love it.

Microsoft.MSE.Behaviors.DotNetServiceBusTransportCredentials.dll needed to be slightly modified:

using Microsoft.ServiceBus;
using Microsoft.ServiceBus.Description;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.CompilerServices;
using System.ServiceModel.Channels;
using System.ServiceModel.Description;
using System.ServiceModel.Dispatcher;

namespace Microsoft.MSE.Behaviors.DotNetServiceBusTransportCredentials
{
    public class SolutionConfigurationBehavior : IEndpointBehavior
    {

        public string SolutionName
        {
            get;
            set;
        }

        private string Password
        {
            get;
            set;
        }

        public SolutionConfigurationBehavior(string solName, string solPwd)
        {
            SolutionName = solName;
            Password = solPwd;
        }

        public virtual void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
        {
        }

        public virtual void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
        {
            TransportClientEndpointBehavior transportClientEndpointBehavior = new TransportClientEndpointBehavior();
            transportClientEndpointBehavior.CredentialType = TransportClientCredentialType.SharedSecret;
            transportClientEndpointBehavior.Credentials.SharedSecret.IssuerName = SolutionName;
            transportClientEndpointBehavior.Credentials.SharedSecret.IssuerSecret = Password;
            endpoint.Behaviors.Add(transportClientEndpointBehavior);
        }

        public virtual void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
        {
        }

        public virtual void Validate(ServiceEndpoint endpoint)
        {
        }
    }

}

 

Also the included executables had to be updated as well.

Kind Regards

Alex