开发者

No endpoint listening at net.pipe exception

开发者 https://www.devze.com 2023-03-25 16:24 出处:网络
I have many WCF services and I need to call one service from another. I decided to use netNamedPipeBinding for this purpose.

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.Create开发者_开发技巧Channel();
                            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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号