我们添加客户端服务引用的时候会出现这样的错误:
下载“http://localhost:8002/WCFService”时出错。
基础连接已经关闭: 接收时发生错误。
无法从传输连接中读取数据: 远程主机强迫关闭了一个现有的连接。。
远程主机强迫关闭了一个现有的连接。
Metadata contains a reference that cannot be resolved: 'http://localhost:8002/WCFService'.
Metadata contains a reference that cannot be resolved: 'http://localhost:8002/WCFService'.
If the service is defined in the current solution, try building the solution and adding the service reference again.
解决办法:
1.检查防火墙设置,服务端口是否已经设置为安全端口。
3.配置终结点基于HTTP协议,
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />