3
votes

I'm using WCF with .NET 3.5 I am using named pipes but keep getting the error

There was no endpoint listening at net.pipe://localhost/Test that could accept the message. This is often caused by an incorrect address or SOAP action.

I followed the tutorial http://www.switchonthecode.com/tutorials/wcf-tutorial-basic-interprocess-communication but the problem remains. The endpoints on both the client and server are the same (I checked spelling etc). There is no config file for this project but the config is in the code.

EDIT: Code (client):

  ChannelFactory<ITest> pipeFactory =
    new ChannelFactory<ITest>(
    new NetNamedPipeBinding(),
    new EndpointAddress(
    "net.pipe://localhost/test"));

       ITest test= pipeFactory.CreateChannel();

            test.doStuff();

SERVER:

        serviceHost = new ServiceHost(typeof(Test), new Uri("net.pipe://localhost"));

        serviceHost.AddServiceEndpoint(typeof(ITest), new NetNamedPipeBinding(), "test");

        File.Create(@"C:\test.txt");

        serviceHost.Open();

Thanks

3
I think you will have to show the code. What is hosting the service? The fact that you have https: means that it is looking for https transport, not named pipe.ColWhi
Hi, Sorry I took the same error message from somewhere else. My error message is:There was no endpoint listening at net.pipe://localhost/Test that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more detailsblade33
Have you got the Console.ReadLine on the server side, if not the server will just be exiting.ColWhi
obviously not, it isn't working. Basically do you know that your windows service is up and running?ColWhi
I think that we have come to the end of the help that can be given then. Sorry.ColWhi

3 Answers

5
votes

On the server side don't include base addresses when you create the ServiceHost instance. Instead, provide the fully qualified endpoint address when you add the service endpoint:

serviceHost = new ServiceHost(typeof(Test));
serviceHost.AddServiceEndpoint(typeof(ITest), new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/test"));
File.Create(@"C:\\test.txt");
serviceHost.Open();
1
votes

This could be:

  • You are running it as a windows service and the service is not running
  • You are running it as a console app and there is no console.readline, so it just exists
  • You are running client and server on two different machines so that localhost is not going to the machine with the service.
0
votes

Another possibility to fix this root issue if you are getting an error that no net.pipe address can be found at your url (i.e. http://localhost:1234/MyService/etc/) is to make sure that the Net.Pipe Listener Adapter Windows Service is started. (I also started Net.Tcp Listener Adapter)

The service does not seem to be enabled or started in some scenarios especially when deploying out to a remote server that might not of had a lot of the development tools installed that actively use these services. Starting the service fixed the issue.