Note that there are some explanatory texts on larger screens.

plurals
  1. POAzure AppFabric Service Bus Echo sample not working
    text
    copied!<p>I'm trying to run the Echo sample between two machines on my local network. The sample uses the netTcpRelayBinding and it works fine if I run both the service and the client on the same machine. When I first compiled the services and put it on my other machine, a Windows 2003 Server with no dev tools installed. It wouldn't run because it didn't know what netTcpRelayBinding was in the app.config. So I moved the config to code only and the service started. I confirmed this with the Service Bus Explorer. I then tried to connect with my dev machine (through VS2010) but it won't work. I have tried to change stuff both on the service and the client, trying all the combination of settings I can think of, but nothing. I mostly get one of two errors on the client: </p> <p>"ContractDescription 'IEchoContract' has zero operations; a contract must have at least one operation." </p> <p>or </p> <p>"there was no endpoint listening that could accept the message".</p> <p>This is the server code, my change is between the custom comments.</p> <pre><code>// create the service URI based on the service namespace Uri address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "EchoService"); // create the credentials object for the endpoint TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior(); sharedSecretServiceBusCredential.CredentialType = TransportClientCredentialType.SharedSecret; sharedSecretServiceBusCredential.Credentials.SharedSecret.IssuerName = issuerName; sharedSecretServiceBusCredential.Credentials.SharedSecret.IssuerSecret = issuerSecret; // create the service host reading the configuration ServiceHost host = new ServiceHost(typeof(EchoService), address); // custom host.AddServiceEndpoint( typeof(IEchoContract), new NetTcpRelayBinding(), "EchoService" ); // custom end // create the ServiceRegistrySettings behavior for the endpoint IEndpointBehavior serviceRegistrySettings = new ServiceRegistrySettings(DiscoveryType.Public); // 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(); </code></pre> <p>This is the client code, my current change is between the custom comments:</p> <pre><code>// create the service URI based on the service namespace Uri serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "EchoService"); // create the credentials object for the endpoint TransportClientEndpointBehavior sharedSecretServiceBusCredential = new TransportClientEndpointBehavior(); sharedSecretServiceBusCredential.CredentialType = TransportClientCredentialType.SharedSecret; sharedSecretServiceBusCredential.Credentials.SharedSecret.IssuerName = issuerName; sharedSecretServiceBusCredential.Credentials.SharedSecret.IssuerSecret = issuerSecret; // create the channel factory loading the configuration //ChannelFactory&lt;IEchoChannel&gt; channelFactory = new ChannelFactory&lt;IEchoChannel&gt;("RelayEndpoint", new EndpointAddress(serviceUri)); // custom ServiceEndpoint endpoint = new ServiceEndpoint(new ContractDescription("IEchoContract", "Microsoft.ServiceBus.Samples"), new NetTcpRelayBinding(EndToEndSecurityMode.Transport, RelayClientAuthenticationType.None), new EndpointAddress(serviceUri)); ChannelFactory&lt;IEchoChannel&gt; channelFactory = new ChannelFactory&lt;IEchoChannel&gt;(endpoint); // custom end // apply the Service Bus credentials channelFactory.Endpoint.Behaviors.Add(sharedSecretServiceBusCredential); // create and open the client channel IEchoChannel channel = channelFactory.CreateChannel(); channel.Open(); </code></pre> <p>My app.config files are cleared of the settings. I haven't touched any other files.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload