2014-04-17 4 views
1

내가콘솔은 WCF가

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

다음과 같은 콘솔 응용 프로그램입니다 한 푸른 SeviceBus 이야기하지 호스팅 서비스 버스 주제 "management.getallclients"가 도달합니다.

서비스 버스 탐색기를 사용하면 콘솔 응용 프로그램을 실행할 때 "마지막 액세스"타임 스탬프가 변경되지 않기 때문에 호스트가 서비스 버스에 실제로 연결되어 있다고 확신하지 않습니다.

메시지가 표시되지 않는 이유는 무엇입니까?

답변