2014-01-16 40 views
0

我已經安裝了具有默認名稱空間的Windows Server 1.1(不Azure服務總線)的Service Bus。 我已將來自 http://code.msdn.microsoft.com/windowsazure/Relayed-Messaging-Bindings-ca039161 的樣本降級並更改以下代碼以生成令牌。中繼綁定不適用於Window Server Service Bus 1.1

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"); 

但它投擲以下錯誤 「無法經由TCP(9351,9352)或HTTP(80,443)到達servicebusdefaultnamespace.servicebus.windows.net」

我還嘗試與BasicHTTPRelayBinding相同的示例,但這不起作用。

我是否需要爲繼電器綁定做一些其他配置 請推薦!!!

在此先感謝。

回答

1

當前服務總線中繼功能在Windows Server的Service Bus 1.1上不可用。它僅在Azure Service Bus中可用。

+0

您能否爲上述聲明提供任何Microsoft鏈接? –

+0

@RJ官方文檔不包括繼電器支持:http://msdn.microsoft.com/en-us/library/windowsazure/jj193027.aspx – TheDude

+0

這個問題也涵蓋了它:http://stackoverflow.com/questions/ 11644262 /服務總線爲Windows服務器服務總線-1-0-beta-support-relay-functio – TheDude

相關問題