Jan 30, 2009

Microsoft .NET Services (Azure .NET Service Bus) samples and relay bindings

After some initial issues getting a Microsoft .NET Services invitation code and creating a solution on partially non-working servers I finally wanted to run some samples from the SDK.

Being behind a NAT/firewall infrastructure (no open custom ports other than 80/443) of our organisation (yes, indeed the net.tcp samples all failed starting the service) I tried to get wsHttpRelayBinding sample working.

The service is quite simple:


        static void Main(string[] args)


        {


            string serviceBusSolutionName = GetServiceBusSolutionName();


            Uri address = new Uri(String.Format("http://{0}/services/{1}/EchoService/", ServiceBusEnvironment.DefaultRelayHostName, serviceBusSolutionName));


 


            ServiceHost host = new ServiceHost(typeof(EchoService), address);


            host.Open();


 


            Console.WriteLine("Service address: " + address);


            Console.WriteLine("Press [Enter] to exit");


            Console.ReadLine();


 


            host.Close();


        }




with the following username/password configuration:


<?xml version="1.0" encoding="utf-8" ?>


<configuration>


  <system.serviceModel>


    <behaviors>


      <endpointBehaviors>


        <behavior name="UserNamePasswordCredentials">


          <transportClientEndpointBehavior credentialType="UserNamePassword">


            <clientCredentials>


              <userNamePassword userName="solution" password="password" /> 


            </clientCredentials>


          </transportClientEndpointBehavior>


        </behavior>


      </endpointBehaviors>


    </behaviors>


 


    <bindings>


      <!-- Application Binding -->


      <wsHttpRelayBinding>


        <binding name="default">


          <security mode="None"/>


        </binding>


      </wsHttpRelayBinding>


    </bindings>


 


    <services>


      <!-- Application Service -->


      <service name="Microsoft.ServiceBus.Samples.EchoService">


        <endpoint name="RelayEndpoint"


                  contract="Microsoft.ServiceBus.Samples.IEchoContract"


                  binding="wsHttpRelayBinding"


                  bindingConfiguration="default"


                  behaviorConfiguration="UserNamePasswordCredentials"


                  address="" />


      </service>


    </services>


 


  </system.serviceModel>


</configuration>




Checking the code looks like HTTP communication to me, that should pass our security perimeter infrastructure. Getting the following exception mentioning about net.tcp gives me some thinking.

System.ServiceModel.EndpointNotFoundException was unhandled
Message="Could not connect to net.tcp://servicebus.windows.net:828/services/solution/UserNameAuthenticationService/. The connection attempt lasted for a time span of 00:00:21.0021000. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 65.55.54.16:828. "
Source="Microsoft.ServiceBus"
StackTrace:
at Microsoft.ServiceBus.RelayedOnewayTcpClient.Connect()
at Microsoft.ServiceBus.RelayedOnewayTcpClient.EnsureChannel()
at Microsoft.ServiceBus.RelayedOnewayTcpClient.OnOpen(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.CommunicationObject.Open(TimeSpan timeout)
at Microsoft.ServiceBus.Channels.CommunicationObject.Open()
at Microsoft.ServiceBus.RelayedOnewayTcpListener.OnOpen(TimeSpan timeout)
...

Using TCP port 828...

Is there some probing going on, even when specifying a HTTP binding? Trying again from home.

No comments:

Post a Comment