Hi:
I installed Service Bus for Windows server 1.1 on a windows server 2012 R2 which joined a windows domain.I built a application try to connect to that server from my windows 10 which not joined any windows domain.But I got a 401 exception.
below is my code:
string serverFqdn = "SB-160.moss.hnop.org"; int httpPort = 9355; int tcpPort = 9354; string serviceNamespace = "ServiceBusDefaultNamespace"; ServiceBusConnectionStringBuilder connBuilder = new ServiceBusConnectionStringBuilder(); connBuilder.ManagementPort = httpPort; connBuilder.RuntimePort = tcpPort; connBuilder.Endpoints.Add(new UriBuilder() { Scheme="sb",Host = serverFqdn,Path=serviceNamespace }.Uri); connBuilder.StsEndpoints.Add(new UriBuilder() { Scheme = "https", Host = serverFqdn, Path = serviceNamespace,Port=httpPort }.Uri); TokenProvider localUserTokenProvider = WindowsTokenProvider.CreateWindowsTokenProvider( connBuilder.StsEndpoints, new System.Net.NetworkCredential("adadmin", "abc@1234", "moss.hnop.org")); MessagingFactorySettings msgFactorySetting = new MessagingFactorySettings(); msgFactorySetting.TokenProvider = localUserTokenProvider; msgFactorySetting.OperationTimeout = new TimeSpan(50); NamespaceManagerSettings nmSetting = new NamespaceManagerSettings(); nmSetting.TokenProvider = localUserTokenProvider; MessagingFactory factory = MessagingFactory.Create( connBuilder.GetAbsoluteRuntimeEndpoints(),msgFactorySetting); NamespaceManager namespaceManager = new NamespaceManager( connBuilder.GetAbsoluteManagementEndpoints(), nmSetting); Console.WriteLine(namespaceManager.QueueExists("Test"));
Console.WriteLine(namespaceManager.QueueExists("Test")); Console.ReadLine();
can you help me ?thank you.
...