Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
控制台托管的WCF未与Azure Seviceus对话_Wcf_Wcf Binding_Azureservicebus - Fatal编程技术网

控制台托管的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”的消息到达它

使用服务总线资源管理器,我不确信主机实际上是连接到服务总线的,因为在我运行控制台应用程序时,“上次访问的”时间戳没有改变

知道我为什么没有看到消息吗?

科林, 这仍然是一个问题还是与以下方面有关:

问候,

-阿披实