zoukankan      html  css  js  c++  java
  • 无法加载协定为“ServiceReference1.xxxxx”的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分

    原因是config节点中有多个endpoint相同节点,提示按名称指示首选的终结点,说明程序不知道选那个节点。

    解决办法,实例化service服务对象时,通过name值指定创建它。

    config文件部分

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

    ServiceReference1.WeatherWSSoapClient wwsc = new ServiceReference1.WeatherWSSoapClient("WeatherWSSoap");
    string[] provinces = wwsc.getRegionProvince();

  • 相关阅读:
    数据库调优2
    数据库调优
    SQL优化
    支付宝/阿里面试题
    Servlet 工程 web.xml 中的 servlet 和 servlet-mapping 标签 《转载》
    《转载》struts旅程《2》
    《转载》struts旅程《1》
    jsp 自定义标签
    body-content取值的意义
    jsp页面中jstl标签详解
  • 原文地址:https://www.cnblogs.com/han1982/p/4871475.html
Copyright © 2011-2022 走看看