2013-02-08 99 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

相关问题