将WCF配置为IIS7上托管的命名管道 [英] Configure WCF as Named Pipe hosted on IIS7

查看:72
本文介绍了将WCF配置为IIS7上托管的命名管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IIS7上托管了两个不同的WCF服务.一种是配置为在命名管道上运行的数据库服务.托管在同一台计算机上的其他服务正在通过命名管道访问第一个服务,并将其配置为在webhttp上运行.

I have two different WCF services hosted on IIS7. One is Database Service which is configured to run on namedpipe. The other service hosted on same machine is accessing the first service via named pipe and is configured to run on webhttp.

但是,当我从另一个服务调用数据库服务时,出现以下错误

however when i call the database service from another service i get the following error

没有侦听端点的"net.pipe://localhost/iSPYDBService"可以接受该消息.这通常是由不正确的地址或SOAP操作引起的.有关更多详细信息,请参见InnerException.

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

数据库服务配置文件摘录

Database Service Config file Snippet

<system.serviceModel>
<services>
  <service name="DBService.Service">
    <endpoint address="net.pipe://localhost/iSPYDBService" 
              binding="netNamedPipeBinding" 
              contract="DBService.Contracts.IDBService"  
              bindingConfiguration="Binding1" />
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior>
      <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
      <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
  </serviceBehaviors>
</behaviors>
<protocolMapping>
  <add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>

<bindings>
  <netNamedPipeBinding>
    <binding name="Binding1"                 
             closeTimeout="00:01:00"
             openTimeout="00:01:00"
             receiveTimeout="00:10:00"
             sendTimeout="00:01:00"
             transactionFlow="false"
             transferMode="Buffered"
             maxBufferPoolSize="524288"
             maxBufferSize="65536"
             maxConnections="10"
             maxReceivedMessageSize="65536">
      <security mode="Transport">
        <transport protectionLevel="EncryptAndSign" />
      </security>
    </binding>
  </netNamedPipeBinding>
</bindings>    
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

其他服务通过命名管道调用数据库服务会引发如上所述的错误.

The Other Service Calling the Database service via named pipe throws error as mentioned above.

       ChannelFactory<DBService.Contracts.IDBService> pipeFactory =
                new ChannelFactory<DBService.Contracts.IDBService>(
            new NetNamedPipeBinding(),
            new EndpointAddress("net.pipe://localhost/iSPYDBService"));

        pipeProxy = pipeFactory.CreateChannel();

        var categories = pipeProxy.GetCategories();

这两个服务都托管在IIS上.我已经给了net.pipe在数据库服务中的绑定,并且还在启用的协议"中添加了"http,net.pipe".

Both services are hosted on IIS. i have already given the binding for net.pipe in database service and also add "http,net.pipe" in "enabled protocols".

推荐答案

  1. 您不能使用IIS Express.

  1. You cannot use IIS Express.

在IIS中(完整的而不是快速的)...转到您的网站.

In IIS (full, not express) ... go to your website.

跟随面包屑:

WCF主机网站>管理应用程序>高级设置>启用的协议

WCF Host Web Site > Manage Application > advanced Settings > Enabled Protocols

您可能已经设置了"http"或"http,net.tcp".

You probably have "http" or "http,net.tcp" already set.

添加"net.pipe"(前面带有逗号)

Add "net.pipe" (with a comma before it)

如下所示.请注意,请勿添加任何空格.

As seen below. Note, do not add any spaces.

http,net.tcp,net.pipe

在这种情况下,魔术是正确的值("net.pipe").

The magic is the correct value ("net.pipe") in this case.

您可以在此处了解更多信息

You can read more about it here

找不到找到的基址匹配方案net.tcp

这篇关于将WCF配置为IIS7上托管的命名管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆