我有一个和客户端,它们在本地主机上工作得很好,但是当我将服务器安装到另一台计算机时,客户端会在希望上传文件时引发异常。例外是:
服务器拒绝凭据。
我在客户端的配置文件中添加了一个新服务器的IP (172.18.20.25)。
这是我的客户端配置文件:
<?xml version="1.0"?>
<configuration>
<system.serviceModel>
<client>
<endpoint name="FileRepositoryService"
address="net.tcp://172.18.20.25:5000" binding="netTcpBinding"
contract="FileServer.Services.IFileRepositoryService"
bindingConfiguration="customTcpBinding"/>
</client>
<bindings>
<netTcpBinding>
<binding name="customTcpBinding"
maxReceivedMessageSize="2147483648" transferMode="Streamed"/>
</netTcpBinding>
</bindings>
</system.serviceModel>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>这是我的服务器的配置:
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<appSettings>
<add key="RepositoryDirectory" value="storage"/>
</appSettings>
<system.serviceModel>
<services>
<service name="FileServer.Services.FileRepositoryService">
<endpoint name="" binding="netTcpBinding"
address="net.tcp://localhost:5000"
contract="FileServer.Services.IFileRepositoryService"
bindingConfiguration="customTcpBinding" />
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="customTcpBinding" transferMode="Streamed"
maxReceivedMessageSize="2147483648" />
</netTcpBinding>
</bindings>
</system.serviceModel>
</configuration>如前所述,当客户端和服务器在一台机器上运行时,它可以正常工作。我读过关于向服务器添加一个新的WSDL端点的文章,我不确定它,也不知道如何添加它。你的建议是什么?
发布于 2012-02-09 08:11:29
检查您在服务器上是否具有读写访问权限。
发布于 2012-02-09 08:19:29
这条线
address="net.tcp://localhost:5000"把它改成
net.tcp://172.18.20.25:5000试一试。
另一个建议,尝试设置您的net.tcp身份验证配置。
https://stackoverflow.com/questions/9207264
复制相似问题