控制台托管的WCF未与Azure Seviceus对话
我有以下控制台应用程序控制台托管的WCF未与Azure Seviceus对话,wcf,wcf-binding,azureservicebus,Wcf,Wcf Binding,Azureservicebus,我有以下控制台应用程序 static void Main(string[] args) { ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect; Console.WriteLine("**** Client Management Service ****"); string serviceNamespace = "abcdef"; string issuerNa
static void Main(string[] args)
{
ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect;
Console.WriteLine("**** Client Management Service ****");
string serviceNamespace = "abcdef";
string issuerName = "owner";
string issuerSecret = "abcdef...";
// Create the credentials object for the endpoint.
TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior();
sharedSecretServiceBusCredential.TokenProvider = TokenProvider.CreateSharedSecretTokenProvider(issuerName, issuerSecret);
// Create the service URI based on the service namespace.
Uri address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "management.getallclients");
//// Create the ServiceRegistrySettings behavior for the endpoint.
IEndpointBehavior serviceRegistrySettings = new ServiceRegistrySettings(DiscoveryType.Public);
var host = new ServiceHost(typeof(ManagementService), address);
host.AddServiceEndpoint(typeof(IManagementService), new NetMessagingBinding(), address);
// Add the Service Bus credentials to all endpoints specified in configuration.
foreach (ServiceEndpoint endpoint in host.Description.Endpoints)
{
endpoint.Behaviors.Add(serviceRegistrySettings);
endpoint.Behaviors.Add(sharedSecretServiceBusCredential);
}
// Open the service.
host.Open();
Console.WriteLine("Press [Enter] to exit");
Console.ReadLine();
host.Close();
}
服务定义是
[ServiceContract(Name = "IManagementService")]
public interface IManagementService
{
[OperationContract(IsOneWay = true)]
void GetAllClients(string correlationId);
}
这将很好地打开主机并将其放置在那里,但是没有发送到服务总线主题“management.getAllClient”的消息到达它
使用服务总线资源管理器,我不确信主机实际上是连接到服务总线的,因为在我运行控制台应用程序时,“上次访问的”时间戳没有改变
知道我为什么没有看到消息吗?科林,
这仍然是一个问题还是与以下方面有关:
问候,
-阿披实