wcf 宿主iis,[WCF]NetTcpBinding在IIS中使用的详细配置方法

 2023-09-20 阅读 29 评论 0

摘要:wcf 宿主iis。在WCF的配置过程中,常常会遇到各种各样的错误。 如:找不到具有绑定 NetTcpBinding 的终结点的与方案 net.tcp 匹配的基址。注册的基址方案是 [http]。 网络上存在各种各样的方法,但很少有能够全面解决的。 现举例来

 

wcf 宿主iis。在WCF的配置过程中,常常会遇到各种各样的错误。

如:找不到具有绑定 NetTcpBinding 的终结点的与方案 net.tcp 匹配的基址。注册的基址方案是 [http]。

网络上存在各种各样的方法,但很少有能够全面解决的。

现举例来配置NetTcpBinding的方法:

首先尽量要保证你的配置文件是正确的,如:

<?xml version="1.0" encoding="utf-8"?>
<configuration><system.web><compilation debug="true" targetFramework="4.0" /></system.web><system.serviceModel><bindings><netTcpBinding><binding name="ShuiMoNet_Service.FileOperation.binding" closeTimeout="00:30:00"openTimeout="00:30:00" receiveTimeout="00:30:00" sendTimeout="00:30:00"transactionFlow="false" transferMode="Streamed" transactionProtocol="OleTransactions"hostNameComparisonMode="StrongWildcard" listenBacklog="10"maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxConnections="10"maxReceivedMessageSize="2147483647"><readerQuotas maxDepth="2147483647"  maxStringContentLength="2147483647" maxArrayLength="2147483647"                     maxBytesPerRead="2147483647"   maxNameTableCharCount="2147483647" /><reliableSession ordered="true"  inactivityTimeout="00:01:00" enabled="false" /><security mode="None"><transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"></transport><message clientCredentialType="Windows" /></security></binding></netTcpBinding></bindings><services><service name="ShuiMoNet_Service.FileOperation" behaviorConfiguration="ShuiMoNet_Service.FileOperation.Behavior"><endpoint binding="netTcpBinding"  bindingConfiguration="ShuiMoNet_Service.FileOperation.binding" contract="ShuiMoNet_Service.IFileOperation" address="FileOperation"></endpoint><endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /><host><baseAddresses><add baseAddress="net.tcp://localhost:8001/"/><add baseAddress="http://localhost:8002/"/></baseAddresses></host></service></services><behaviors><serviceBehaviors><behavior name="ShuiMoNet_Service.FileOperation.Behavior"><serviceMetadata httpGetEnabled="false"/><serviceDebug includeExceptionDetailInFaults="true"/><dataContractSerializer maxItemsInObjectGraph="6553600"/></behavior></serviceBehaviors></behaviors><serviceHostingEnvironment multipleSiteBindingsEnabled="true"/></system.serviceModel><system.webServer><modules runAllManagedModulesForAllRequests="true"/></system.webServer></configuration>


配置,基本上如上已经够全面了。

 

其次,我们首先应该检查你是否启用了WCF功能:

 

接着检查是否在IIS中启用了net.tcp协议:

 

最后我们应该在站点绑定中如下配置net.tcp路由:

 

这样我们的NetTcpBinding协议就受到支持了。如上Bug也已经解决。

 

更多WEB开发技术请加群:Asp.Net高级群 号码:261882616

博主以及同事和你共同探讨感兴趣的话题。



转载于:https://www.cnblogs.com/chamy/archive/2012/11/02/2751367.html

版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。

原文链接:https://hbdhgg.com/4/80694.html

发表评论:

本站为非赢利网站,部分文章来源或改编自互联网及其他公众平台,主要目的在于分享信息,版权归原作者所有,内容仅供读者参考,如有侵权请联系我们删除!

Copyright © 2022 匯編語言學習筆記 Inc. 保留所有权利。

底部版权信息