朋友们,
我有一个 IIS 托管的 Web 服务(
http://localhost/Directory.Server/Services/v2/Directory.svc/ws
) 与 wsHttpBinding 一起使用。它由 WebApp 使用。我需要一个带有命名管道的相同服务的附加端点,以便我可以从在同一台机器上运行的另一个项目访问该服务。
我在 web.config 中进行了更改以公开命名管道端点。但是,甚至在我测试新的 namedpipe 端点之前,现有的 wsHttpBinding 端点就开始因此更改而引发错误。
来自使用 WebApp 的错误 - 无法激活请求的服务“”。有关详细信息,请参阅服务器的诊断跟踪日志。
毫无疑问,添加命名管道端点会导致问题。如果我修复了 namedpipe 问题,两个端点都可以工作。
这是我的 web.config 更改-
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<bindings>
<wsHttpBinding>
<binding name="wsHttp" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Mtom">
<readerQuotas maxDepth="0" maxStringContentLength="0" maxArrayLength="0" maxBytesPerRead="0" maxNameTableCharCount="0" />
<security mode="None">
<transport clientCredentialType="None" />
<message clientCredentialType="None" />
</security>
</binding>
</wsHttpBinding>
<netNamedPipeBinding>
<binding name="Binding10" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="10485760">
<security mode="Transport">
<transport protectionLevel="EncryptAndSign"/>
</security>
</binding>
</netNamedPipeBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="Default_Directory">
<dataContractSerializer maxItemsInObjectGraph="2147483647" />
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Default_Directory" name="Directory.Server.Services.v2.Directory">
<endpoint address="ws" binding="wsHttpBinding" bindingConfiguration="wsHttp" name="wsHttp_Directory" contract="Directory.Server.Services.v2.IDirectory" />
<endpoint address="mex" binding="mexHttpBinding" name="mex_Directory" contract="IMetadataExchange" />
<endpoint address="net.pipe://localhost/Directory.Server/Services/v2/Directory.svc/np" binding="netNamedPipeBinding" bindingConfiguration="Binding10" name="namedPipe_Directory" contract="Directory.Server.Services.v2.IDirectory" />
</service>
</services>
我究竟做错了什么?请帮忙。