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 OperationContract
s (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.