1

我在 IIS 7 上部署了 WCF 服务,并支持启用非 HTTP

在一个项目中,我公开了 8 种不同的服务,其wsHttp端点工作正常。

我还想公开NetNamedPipe相同服务的绑定。

我的示例NetNamedPipe绑定。. .

<netNamedPipeBinding>
    <binding name="PassportIPCBasicEndpoint" 
         closeTimeout="00:05:00" openTimeout="00:05:00" receiveTimeout="00:10:00" 
         sendTimeout="00:05:00"
         maxBufferSize="2147483647" maxBufferPoolSize="2147483647" 
         maxReceivedMessageSize="2147483647" transferMode="Buffered"
         hostNameComparisonMode="Exact"  >
      <readerQuotas
           maxDepth="2147483647" maxStringContentLength="2147483647" 
           maxArrayLength="2147483647" maxBytesPerRead="2147483647" 
           maxNameTableCharCount="2147483647"/>
      <security mode="Transport">
         <transport protectionLevel="None" />
      </security>
   </binding>
</netNamedPipeBinding>

还有我的服务标签

<service behaviorConfiguration="default" name="MyAccountService.AccountService">
   <host>
      <baseAddresses>
         <add baseAddress="http://localhost/MyAccountService/v1.0/AccountService.svc" />
      </baseAddresses>
   </host>
   <endpoint name="PassportIPCBasicEndpoint" 
       address="net.pipe://localhost/MyAccountService/v1.0/AccountService.svc" 
       binding="netNamedPipeBinding" 
       bindingConfiguration="PassportIPCBasicEndpoint" 
       contract="MyAccountService.IAccountService"/>
</service>

这给了我以下异常:

不支持协议“net.pipe”。

[InvalidOperationException:不支持协议“net.pipe”。] System.ServiceModel.Activation.HostedTransportConfigurationManager.InternalGetConfiguration(字符串方案)

[InvalidOperationException:'net.pipe://localhost/MyAccountService/v1.0/AccountService.svc' 上的 ChannelDispatcher 与合同 '"IAccountService"' 无法打开其 IChannelListener。]

我在 IIS 的高级站点设置中添加了 http,net.pipe 条目。

还通过控制面板设置安装和启用对 WCF 服务的非 HTTP 支持。

在 8 个 .svc 服务中,只有一个这样的服务能够获取端口,我可以浏览它的 .SVC 端点

为 netnamedPipe 绑定配置的所有其他服务都会给我上述错误。

有人可以指导我吗,需要做些什么才能使它们都停在港口并可以使用。

4

2 回答 2

3

这个问题是在正确的地方启用协议。以前我在站点级别启用了 net.pipe 协议。

在托管服务的每个虚拟路径上启用 net.pipe 协议后。有效。

于 2012-02-25T13:19:56.887 回答
0

netNamedPipe绑定用于同一台机器上的通信 - 您不能从远程机器调用这样的端点。

那是你想要做的吗??

netNamedPipe绑定非常适合同一台机器上的应用程序内部通信——但实际上不适用于其他任何东西。

于 2012-02-09T16:16:23.357 回答