简体   繁体   English

将WCF配置为IIS7上托管的命名管道

[英]Configure WCF as Named Pipe hosted on IIS7

I have two different WCF services hosted on IIS7. 我在IIS7上托管了两个不同的WCF服务。 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. 托管在同一台计算机上的其他服务正在通过命名管道访问第一个服务,并将其配置为在webhttp上运行。

however when i call the database service from another service i get the following error 但是,当我从另一个服务调用数据库服务时,出现以下错误

"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." “没有端点在“ net.pipe:// localhost / iSPYDBService”上侦听可以接受该消息的端点。这通常是由错误的地址或SOAP操作引起的。有关更多详细信息,请参阅InnerException(如果存在)。”

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();

Both services are hosted on IIS. 两种服务都托管在IIS上。 i have already given the binding for net.pipe in database service and also add "http,net.pipe" in "enabled protocols". 我已经在数据库服务中为net.pipe提供了绑定,并且还在“已启用的协议”中添加了“ http,net.pipe”。

  1. You cannot use IIS Express. 您不能使用IIS Express。

  2. In IIS (full, not express) ... go to your website. 在IIS中(完整而不是表示)...转到您的网站。

Follow this bread crumb: 遵循面包屑:

WCF Host Web Site > Manage Application > advanced Settings > Enabled Protocols WCF主机网站>管理应用程序>高级设置>启用的协议

You probably have "http" or "http,net.tcp" already set. 您可能已经设置了“ http”或“ http,net.tcp”。

Add "net.pipe" (with a comma before it) 添加“ net.pipe”(前面带有逗号)

As seen below. 如下所示。 Note, do not add any spaces. 注意,请勿添加任何空格。

http,net.tcp,net.pipe

The magic is the correct value ("net.pipe") in this case. 在这种情况下,魔术是正确的值(“ net.pipe”)。

You can read more about it here 你可以在这里读更多关于它的内容

Could not find a base address that matches scheme net.tcp 找不到与方案net.tcp匹配的基址

The following should help: 以下内容应有所帮助:

  1. Clear the address in the service config like address="" 清除服务配置中的地址,例如address=""
  2. Edit the bindings of your site in IIS and add or update the site bindings of the net.pipe type and give the "Binding information" a proper name 在IIS中编辑站点的绑定,并添加或更新net.pipe类型的站点绑定,并为“绑定信息”指定一个适当的名称
  3. Update your client config to address="net.pipe://PROPER_NAME/YOUR_SERVICE.svc" 将您的客户端配置更新为address="net.pipe://PROPER_NAME/YOUR_SERVICE.svc"
  4. Set the security mode to None for the bindings on both the client and the service end. 将客户端和服务端上的绑定的安全模式都设置为“无”。
  5. Make sure the Windows Features are enabled for Named Pipe Activation for WCF 4.5 or the Non-HTTP Activation for WCF 3.5 确保为WCF 4.5的命名管道激活或WCF 3.5的非HTTP激活启用Windows功能

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试从IIS中托管的Web应用程序连接到具有命名管道端点的WCF服务时,没有端点侦听错误 - No endpoint listening error when trying to connect to a WCF service with named pipe endpoint from Web application hosted in IIS 为什么/如何将自托管WCF服务迁移到IIS7? - Why/how to migrate self-hosted WCF service to IIS7? WCF应用程序在IIS7上托管时返回400错误请求 - WCF Application returning 400 Bad Request when hosted on IIS7 创建在IIS7之间托管的WCF服务的请求之间是否还存在? - Create a WCF service hosted in IIS7 alive between request? 在iis7中托管的wcf服务时,在ApplyDispatchBehavior方法上放置一个断点 - put a breakpoint at ApplyDispatchBehavior method while wcf service hosted in iis7 如何从 IIS7 中托管的另一个 WCF 服务评估托管 WCF 服务的 Windows 服务? - How to assess a Windows Service hosted WCF service from another WCF service hosted in IIS7? 使用反向代理使用SSL(https)配置IIS托管的WCF服务 - Using reverse proxy to configure IIS hosted WCF services with SSL(https) IIS7中托管的WCF MSMQ在我手动点击该服务之前不会自动检索邮件 - WCF MSMQ hosted in IIS7 WAS not retrieving messages automatically until I MANUALLY hit the service iis7托管的wcf服务:避免将dll放入system32文件夹中 - iis7 hosted wcf service : avoid placing dll in system32 folder jquery 与 wcf 不在 IIS 上托管 - jquery with wcf not hosted on IIS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM