我想使用 netTCPbinding,所以我改变了我的网络配置,如下所示。我遇到这个错误:
找不到与绑定 NetTcpBinding 的终结点的方案 net.tcp 相匹配的基地址。注册的基地址方案是[http]。
如何解决这个问题?
<services>
<service name="DXDirectory.DXDirectoryService" behaviorConfiguration="DXDirectory.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="" binding="netTcpBinding" bindingConfiguration="WindowsSecured" contract="DXDirectory.IDXDirectoryService">
<!--
Upon deployment, the following identity element should be removed or replaced to reflect the
identity under which the deployed service runs. If removed, WCF will infer an appropriate identity
automatically.
-->
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:2582/DXDirectoryService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DXDirectory.Service1Behavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="false" />
<!-- 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" />
<serviceAuthorization principalPermissionMode="UseWindowsGroups" />
<!--<serviceCredentials>-->
<!--<userNameAuthentication userNamePasswordValidationMode="Custom"
membershipProviderName="CustomUserNameValidator"/>-->
<!--</serviceCredentials>-->
</behavior>
</serviceBehaviors>
</behaviors>
嗯...您已经将基地址添加到您的服务/主机部分了。
简单问题:您是自托管还是托管在 IIS 中? IIS 是哪个版本?
IIS5/6 仅支持 HTTP 连接 - 您无法在 IIS 5/6 中托管 NetTCP。
在 IIS7 中,您必须手动执行一系列步骤才能启用非 HTTP 绑定,但这是可能的。看这篇 MSDN 文章关于如何实现这一目标。
自托管是最好的选择 - 您可以获得所有绑定并完全控制托管的服务。
Marc
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)