Question

I have installed Service Bus for Windows Server 1.1 (Not Azure Service Bus) that is having a default namespace. I have downloded the sample from http://code.msdn.microsoft.com/windowsazure/Relayed-Messaging-Bindings-ca039161 and change the following code to generate the token.

var machineName = Dns.GetHostEntry(string.Empty).HostName;
        var networkCredential = new NetworkCredential(WindowsUsername, WindowsPassword, WindowsDomain);


        string serviceNamespace = "ServiceBusDefaultNamespace";


        // The TransportClientEndpointBehavior specifies the Service Bus credentials for a particular endpoint
        var stsUris = new List<Uri> { new Uri(string.Format(CultureInfo.InvariantCulture, "https://{0}:9355/", machineName)) };
        TransportClientEndpointBehavior relayCredentials = new TransportClientEndpointBehavior
        {
            TokenProvider = TokenProvider.CreateOAuthTokenProvider(stsUris, networkCredential)
        };

        //TransportClientEndpointBehavior relayCredentials = new TransportClientEndpointBehavior();
        //relayCredentials.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerSecret);    

        Uri address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "HelloService");

But it is throwing the following error "Unable to reach servicebusdefaultnamespace.servicebus.windows.net via TCP (9351, 9352) or HTTP (80, 443)"

I have also tried the same sample with BasicHTTPRelayBinding,But that doesn't work.

Do i need to do some other configuration for relay binding Please suggest !!!

Thanks in advance.

Était-ce utile?

La solution

Currently the Service Bus Relay features are NOT available on Service Bus 1.1 for Windows Server. It is only available in Azure Service Bus.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top