【发布时间】:2014-08-22 07:57:27
【问题描述】:
按照this 指南,我尝试使用TCP 在Windows 服务中托管WCF service。
这在我的计算机上运行良好,但是在同一网络中的其他计算机上安装此服务时出现错误:服务器已拒绝客户端凭据
我尝试禁用防火墙但仍然出现相同的错误(并且服务正在运行......)
从客户端添加服务参考工作正常并识别服务。
这是我的 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地址。
【问题讨论】:
-
当您运行 WinForm 应用程序(客户端)时,您在什么凭据下运行它?您可能需要在具有管理员权限的域帐户下运行它。