【发布时间】:2015-07-22 10:30:54
【问题描述】:
我在 IIS7 上托管了两个不同的 WCF 服务。一种是配置为在命名管道上运行的数据库服务。托管在同一台机器上的另一个服务正在通过命名管道访问第一个服务,并配置为在 webhttp 上运行。
但是,当我从另一个服务调用数据库服务时,我收到以下错误
“在“net.pipe://localhost/iSPYDBService”上没有可以接受消息的端点侦听。这通常是由不正确的地址或 SOAP 操作引起的。有关更多详细信息,请参阅 InnerException(如果存在)。
数据库服务配置文件片段
<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" />
通过命名管道调用数据库服务的其他服务会引发上述错误。
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”。
【问题讨论】:
标签: c# web-services wcf iis-7 named-pipes