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

来源:互联网 发布:通达oa迁移linux 编辑:程序博客网 时间:2024/04/29 17:03

很多初次使用该webservice的人,初次运行时都会报出这样的错误,其根本原因是在webservce在web.config里配置了两次,

 例如:

<client>
      <endpoint address="http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx"
        binding="basicHttpBinding" bindingConfiguration="WeatherWSSoap"
        contract="WeatherWS.WeatherWSSoap" name="WeatherWSSoap" />
   

<endpoint address="http://webservice.webxml.com.cn/WebServices/WeatherWS.asmx"
        binding="basicHttpBinding" bindingConfiguration="WeatherWSSoap"
        contract="WeatherWS.WeatherWSSoap" name="WeatherWSSoap" />
   
    </client>

只需要删除一个<endpoint>节点就可以正常运行了!

0 0
原创粉丝点击