【发布时间】:2017-06-07 16:38:31
【问题描述】:
我的 Windows 桌面应用程序找不到客户端 Web 服务 API 参考合同的默认端点元素。
客户端应用可以在Visual Studio IDE上正确执行,但是在客户端的环境中遇到了问题。
服务器和客户端都是 Windows 操作系统,都运行在同一个本地网络上。
我尝试使用 Chrome 浏览器从客户端连接到网络服务,所以我认为我们可以假设没有网络问题。
如果这是与配置有关的问题,那么我应该如何处理配置文件?
我在互联网上搜索了两天。 但是这个问题一直没有解决。
客户端app.config中的sn-p:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="RemoteAccessWSSoap" maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:49172/RemoteAccessWS.asmx"
binding="basicHttpBinding" bindingConfiguration="RemoteAccessWSSoap"
contract="RemoteAccessWS.RemoteAccessWSSoap" name="RemoteAccessWSSoap" />
</client>
</system.serviceModel>
来自服务器端 Web.config 的 sn-p :
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="WebService1Soap" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" />
<binding name="Service1Soap" receiveTimeout="00:10:00" sendTimeout="00:10:00" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:49172/RemoteAccessWS.asmx"
binding="basicHttpBinding" bindingConfiguration="RemoteAccessWSSoap"
contract="RemoteAccessWS.RemoteAccessWSSoap" name="RemoteAccessWSSoap" />
</client>
来自服务器端 Web API '.asmx.cs' 文件的 sn-p:
[OperationContract(Name = "HelloWorld")]
string HelloWorld();
[OperationContract(Name = "AddDouble")]
string AddDouble(string a, string b);
请帮我一个忙。非常感谢。
【问题讨论】:
-
你能发布你得到的完整错误吗?
标签: c# asp.net windows web-services service-model