3

I have many WCF services and I need to call one service from another. I decided to use netNamedPipeBinding for this purpose.

My web.config file looks like this. (I have not copied irrelevant stuff here.)

 <services>
          <service             name="Services.AuthorizationService"    >
            <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" >
            <endpoint
              name="AuthorizationService"
              address=""
              binding="basicHttpBinding"               contract="ServiceContracts.IAuthorizationService" />
            <endpoint address="net.pipe://localhost/TestSite/AuthorizationService.svc"
                   binding="netNamedPipeBinding"                   contract="ServiceContracts.IAuthorizationService"
                   name="AuthorizationNamedPipeEndpoint"/>           
          </service>
</Services>

The client section in the web.config file looks like this:

<client>
      <endpoint address="net.pipe://localhost/TestSite/AuthorizationService.svc"
       binding="netNamedPipeBinding"            contract="ServiceContracts.IAuthorizationService" name="AuthorizationServiceNamedPipe" />
    </client>

I am trying to call one of the OperationContracts (GetDetails) like this:

  using (ChannelFactory<IAuthorizationService> authorizationChannel = new ChannelFactory<IAuthorizationService>("AuthorizationServiceNamedPipe"))
                        {
                            IAuthorizationService authorizationService = authorizationChannel.CreateChannel();
                            var response = authorizationService.GetDetails(new GetDetailsRequestMessage());
                        }

When I execute this code, I get the exception at the line I invoke the OperationContract GetDetails:

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

I am not able to find out the exact problem. There is no InnerException as well. I am using Windows7 machine and IIS version is IIS7.5. Please note that I can call this service from my Winform application without any problem. net.pipe binding is added to the website bindings in the IIS.

How to ensure that the service is working properly using the net.pipe transport? In case of HTTP, we can browse in IE and ensure it.

6
  • What I can find is that you didn't provide address or host base address on the server side. Is that a mistake?
    – Jack
    Aug 4, 2011 at 11:51
  • Even if i provide the address, it fails.
    – Learner
    Aug 4, 2011 at 12:02
  • Do you have any problem when the service is started?
    – Jack
    Aug 4, 2011 at 12:58
  • Are both services running on the same machine?
    – Franchesca
    Aug 4, 2011 at 13:21
  • @Franchesca: Yes, they are running on the IIS 7.5 on the same machine.
    – Learner
    Aug 5, 2011 at 6:30

2 Answers 2

9

This problem was solved after activating Windows Communication Foundation Non-HTTP Activation component from the Control Panel —> Programs and Features, and then click "Turn Windows Components On or Off" in the left pane. Expand the Microsoft .NET Framework 3.5.

When it's activated and you use non-HTTP binding, the WAS is automatically used.

I did a very basic & silly mistake but it helped me to learn many things. The following articles helped me a lot:

Extend Your WCF Services Beyond HTTP With WAS

Hosting WCF Services in Windows Activation Service

WCF gets Access denied when the consumer try invoke a WCF service calls hosted on Virtual Machine

The last link gave me a pointer that Server Certificate related configuration might be causing troubles. And I was adding a behavior (which is not seen in the question) for the service. That behaviour was using the Server Certificates.

1
  • I have a WCF service hosted outside IIS. From my RIA domain service which is running inside IIS I have to call this WCF service hosted outside IIS over nettcpnamedpipe binding. It does not seem to work. Did you face the same issue ?
    – Frank Q.
    Sep 27, 2012 at 7:27
0

We were getting the same issue in SharePoint 2013. Something happened during the install and the activation settings weren't turned on. I'm not sure if it was an issue with the application server feature or something else.

So thanks for the post! We were able to correct the SP 2013 problem too. Here's the exception we were seeing for those who might run into it also:

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

System.IO.PipeException: The pipe endpoint 'net.pipe://localhost/SecurityTokenServiceApplication/appsts.svc' could not be found on your local machine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.