1

When I try to call the method in the WCF host I get this error:

There was no endpoint listening at net.pipe://localhost/PipeReverse that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

I have a class that starts the WCF host:

public class ProcessUnderMouseServer
{
    public ProcessUnderMouseServer()
    {
        using (host = new ServiceHost(
            typeof(PrcoessUnderMouse),
            new Uri[]
            {
                new Uri("net.pipe://localhost")
            }))
        {  
                host.AddServiceEndpoint(
                    typeof(IPrcoessUnderMouse),
                    new NetNamedPipeBinding(),
                    "PipeReverse");

                host.Open();
        }
    }
}

this class is in a different library project than the consuming project

Then I try to consume it like this:

ProcessUnderMouseServer ProcessUnderMouseServer = new ProcessUnderMouseServer();

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

            IPrcoessUnderMouse pipeProxy = pipeFactory.CreateChannel();
            string str = Console.ReadLine();

            Console.WriteLine("pipe: " + pipeProxy.GetProcessUnderMouse());

Shouldn't

host.AddServiceEndpoint(typeof(IPrcoessUnderMouse),new NetNamedPipeBinding(), "PipeReverse");

be sufficient to add the end point? why it says that no endpoint listening at net.pipe://localhost/PipeReverse ??

shwartz
  • 631
  • 3
  • 13
  • 29
simo
  • 23,342
  • 38
  • 121
  • 218

0 Answers0