我有很多WCF服务,我需要从另一个WCF调用一个服务。为此,我决定使用netNamedPipeBinding。
我的web.config文件看起来像这样。(我没有抄袭不相关的东西。)
<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>web.config文件中的客户端部分如下所示:
<client>
<endpoint address="net.pipe://localhost/TestSite/AuthorizationService.svc"
binding="netNamedPipeBinding" contract="ServiceContracts.IAuthorizationService" name="AuthorizationServiceNamedPipe" />
</client>我试图像这样调用一个OperationContracts (GetDetails):
using (ChannelFactory<IAuthorizationService> authorizationChannel = new ChannelFactory<IAuthorizationService>("AuthorizationServiceNamedPipe"))
{
IAuthorizationService authorizationService = authorizationChannel.CreateChannel();
var response = authorizationService.GetDetails(new GetDetailsRequestMessage());
}当我执行这段代码时,我在调用OperationContract GetDetails的行中得到异常:
在net.pipe://localhost/TestSite/AuthorizationService.svc没有可以接收消息的端点侦听。这通常是由不正确的地址或SOAP操作造成的。有关更多细节,请参见InnerException (如果有的话)。
我找不到确切的问题。也没有InnerException。我使用的是Windows7机器,IIS7.5是IIS7.5版本。请注意,我可以调用此服务从我的Winform应用程序,没有任何问题。将net.pipe绑定添加到IIS中的网站绑定中。
如何确保服务使用net.pipe传输正常工作?在HTTP的情况下,我们可以在IE中浏览并确保它。
发布于 2011-08-08 12:49:50
在从Windows Communication Foundation Non-HTTP Activation中激活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组件后,解决了这个问题。
当它被激活并使用非HTTP绑定时,会自动使用WAS。
我犯了一个非常基本的、愚蠢的错误,但它帮助我学到了很多东西。以下文章对我有很大帮助:
将WCF服务扩展到HTTP以外的WCF服务
在Windows激活服务中托管WCF服务
当使用者尝试调用托管在虚拟机上的WCF服务调用时,WCF将被拒绝访问
最后一个链接给了我一个指针,表明与服务器证书相关的配置可能会带来麻烦。我为服务添加了一个行为(在问题中没有看到)。这种行为是使用服务器证书。
发布于 2013-12-17 17:11:28
我们在2013年的SharePoint上也遇到了同样的问题。在安装过程中发生了一些事情,激活设置没有打开。我不确定这是应用服务器特性的问题还是其他问题。
所以谢谢你的贴子!我们也纠正了SP 2013的问题。这是我们所看到的例外,对于那些可能会遇到它的人来说:
System.ServiceModel.EndpointNotFoundException:没有侦听net.pipe://localhost/SecurityTokenServiceApplication/appsts.svc的端点可以接受消息。这通常是由不正确的地址或SOAP操作造成的。有关更多细节,请参见InnerException (如果存在)。->
'net.pipe://localhost/SecurityTokenServiceApplication/appsts.svc‘:在本地计算机上找不到管道端点System.IO.PipeException.
https://stackoverflow.com/questions/6940400
复制相似问题