Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

Service bus relay NetTcpRelayBinding works but BasicHttpRelayBinding does not

$
0
0

I am trying out the service bus relay and when I use the following code at the server end it works fine.

host.AddServiceEndpoint( typeof(IMyServiceInterface), new NetTcpRelayBinding(), ServiceBusEnvironment.CreateServiceUri("sb", "<<mynamespace>>", ServiceName)) .Behaviors.Add(new TransportClientEndpointBehavior { TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("RootManageSharedAccessKey", "<<mykey>>") });

// This works

host.Open();

When I try the following code it fails after a while with the error "The request has timed out after 00:00:00 milliseconds. The successful completion of the request cannot be determined. Additional queries should be made to determine whether or not the operation has succeeded".  It also fails in the same way if I use "https".  Also the 00:00:00 time is wrong, it takes a minute or so to timeout.

host.AddServiceEndpoint( typeof(IMyServiceInterface), new BasicHttpRelayBinding(), ServiceBusEnvironment.CreateServiceUri("http", "<<mynamespace>>", ServiceName)) .Behaviors.Add(new TransportClientEndpointBehavior() { TokenProvider = TokenProvider.CreateSharedSecretTokenProvider("RootManageSharedAccessKey", "<<mykey>>") });

// Fails here after a delay

host.Open();

Why does the first one work and not the other?

Why would I want to use BasicHttpRelayBinding instead of NetTcpRelayBinding?  I assume I need to use BasicHttpRelayBinding because this will use port 80 or 443 which is more likely to get it out from behind a firewall.  I assume NetTcpRelayBinding uses some other ports but I have read conflicting things about that.



Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>