[英]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”。
You cannot use IIS Express. 您不能使用IIS Express。
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: 以下内容应有所帮助:
address=""
address=""
address="net.pipe://PROPER_NAME/YOUR_SERVICE.svc"
address="net.pipe://PROPER_NAME/YOUR_SERVICE.svc"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.