gpt4 book ai didi

c# - WCF 服务拒绝错误服务器已拒绝客户端凭据

转载 作者:太空宇宙 更新时间:2023-11-03 15:51:56 28 4
gpt4 key购买 nike

正在关注 this指导我尝试使用 TCP 在 Windows 服务中托管 WCF 服务。这在我的电脑上工作正常但是当在同一网络中的其他计算机上安装此服务时出现错误:服务器拒绝了客户端凭据我尝试禁用防火墙但仍然出现相同的错误(并且服务正在运行......)从客户端添加服务引用工作正常并识别该服务。这是我的 app.config 文件:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>

<system.web>
<compilation debug="true" />
</system.web>
<!-- When deploying the service library project, the content of the config file must be added to the host's
app.config file. System.Configuration does not support config files for libraries. -->
<system.serviceModel>
<services>
<service name="WcfServiceLibrary1.Service1">
<endpoint address="" binding="netTcpBinding" bindingConfiguration=""
contract="WcfServiceLibrary1.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://192.168.0.100:8523/Service1 " />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>

</configuration>

192.168.0.100是服务器机器IP地址。

最佳答案

尝试使用此配置进行 tcp 绑定(bind):

<bindings>
<netTcpBinding>
<binding name="customTcpBinding" maxReceivedMessageSize="20480000" transferMode="Streamed" >
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>

关于c# - WCF 服务拒绝错误服务器已拒绝客户端凭据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25442204/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com