2013-02-08 104 views
2

我正在開發我的第一個Azure實現,我已經設置了我的Azure帳戶,並且我使用NuGet將正確的DLL和配置安裝到我的應用程序中。當我把我的WCF客戶端指向服務總線隊列和運行的方法我得到這個異常:連接到Azure ServiceBus隊列

Microsoft.ServiceBus.ServerErrorException

at Microsoft.ServiceBus.RelayedSocketInitiator.Connect(Uri uri, TimeSpan timeout) 
    at Microsoft.ServiceBus.ConnectivityModeConnectionInitiator.Connect(Uri uri, TimeSpan timeout) 
    at Microsoft.ServiceBus.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout) 
    at Microsoft.ServiceBus.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout) 
    at Microsoft.ServiceBus.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at Microsoft.ServiceBus.Channels.LayeredChannel`1.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 

我的端點配置爲:

<endpoint address="sb://MyService.servicebus.windows.net/MyServicequeue" 
       binding="netTcpRelayBinding" contract="PaperlessImportServiceWCF.PaperlessImportServiceSoap" 
       name="MyServiceServiceSoap" behaviorConfiguration="sbTokenProvider"/> 

我的endpoint行爲是:

錯誤信息是非常通用的,我不知道什麼是我應該看看

回答

2

首先我覺得你有關於中繼服務是如何工作的一些誤解。根據您所顯示的配置,您正在使用NetTcpRelayBinding,它用於請求重播連接。但是,在您的端點中,您似乎將隊列地址用作端點。

a)如果您打算以請求回覆的方式使用您的服務/客戶端,那麼您需要創建一個服務總線中繼端點,並在您的端點中使用該地址。 This tutorial是這個服務總線功能的一個很好的起點。

b)如果你打算使用隊列,那麼你需要到NetMessagingBinding。 This post是如何執行所述場景的良好起點。

在這兩種情況下,它也似乎是你使用了錯誤的基地址。 'myservice'是你的服務總線命名空間的名字嗎?如果不是,那麼你應該用你的名字空間的名字替換它。基本服務總線地址的格式是:protocol://YOUR_NAMESPACE.servicebus.windows.net

+0

myservice不是我用myNamespace替換了我的真實姓名空間。是的,我想做b)。謝謝,我會看看我能做些什麼。 – greektreat 2013-02-09 03:55:22

相關問題