无法加载协定为“XXXWebServiceSoap”的终结点配置部分,因为找到了该协定的多个终结点配置

时间:2024-04-24 21:03:38

错误描述:无法加载协定为“XXXWebServiceSoap”的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分。

错误原因:该webservce在web.config里配置了两次:

<client>
<endpoint address="http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx" binding="basicHttpBinding" bindingConfiguration="MobileCodeWSSoap1" contract="webserver.Mobile.MobileCodeWSSoap" name="MobileCodeWSSoap1"/>
<endpoint address="http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx" binding="basicHttpBinding" bindingConfiguration="MobileCodeWSSoap1" contract="webserver.Mobile.MobileCodeWSSoap" name="MobileCodeWSSoap1"/>
</client>

处理方法:删除其中一个<endpoint>节点即可。