錯誤描述:無法加載協定為“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>節點即可。