【发布时间】:2019-11-21 06:25:08
【问题描述】:
我有一个托管在 Windows 服务上的 WCF 服务,该服务使用自己的凭据在同一网络上运行。安全并不重要。但是,速度和可靠性很重要。
所以,我尝试使用netTcpBinding 绑定。但是,我注意到当我将服务引用到客户端时。它将identity标签添加到配置文件中,其中包含运行服务的帐户信息:
<identity>
<userPrincipalName value="account@domain" />
</identity>
我真的不想在客户端的配置文件中包含它,也不想以编程方式传递它。
当我改用basicHttpBinding 时,我注意到它没有添加这个标签。但是,我仍然想坚持使用 net.tcp。所以,我的下一个尝试是使用customBinding
所以,这就是我的问题所在。我无法将自定义绑定引用到客户端。有人可以验证我的配置吗?还。这足以完全忽略身份标签吗?如果这不是正确的方法,那么正确的方法是什么?谢谢
<system.serviceModel>
<services>
<service name="LicenseServiceLogic.LicenseService">
<endpoint address="net.tcp://localhost:8000/LicenseService"
binding="myCustomBinding"
contract="LicenseServiceLogic.ILicenseService">
</endpoint>
</service>
</services>
<bindings>
<customBinding>
<binding name="myCustomBinding">
<compactMessageEncoding>
<binaryMessageEncoding/>
</compactMessageEncoding>
<tcpTransport listenBacklog ="100"
maxBufferPoolSize ="524288"
maxBufferSize ="2147483647"
maxReceivedMessageSize ="2147483647"/>
</binding>
</customBinding>
</bindings>
<client>
<endpoint binding="customBinding"
bindingConfiguration="myCustomBinding"
contract="IMetadataExchange"
name="http" />
</client>
</system.serviceModel>
【问题讨论】:
标签: c# .net wcf configuration app-config