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

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

     

    原因是在web.config 文件中多次引用了“添加外部引用”

     <system.serviceModel>
      <bindings>
       <basicHttpBinding>
        <binding name="WebServiceSoap" />
        <binding name="WebServiceSoap1" />
       </basicHttpBinding>
      </bindings>
      <client>
       <endpoint address="http://10.29.68.32/WebService.asmx" binding="basicHttpBinding"
        bindingConfiguration="WebServiceSoap" contract="ServiceReference.WebServiceSoap"
        name="WebServiceSoap" />
       <endpoint address="http://10.29.68.32/WebService.asmx" binding="basicHttpBinding"
        bindingConfiguration="WebServiceSoap1" contract="ServiceReference.WebServiceSoap"
        name="WebServiceSoap1" />
      </client>
     </system.serviceModel> 

    所以删掉一个节点既可(如查引用的是WebServiceSoap,删掉WebServiceSoap1的有关节点,反之~)

    也可以在页面引用的时候指定bindingConfiguration名字:

    如:ServiceReference.WebServiceSoap web = new WebServiceSoapClient("WebServiceSoap1");

  • 相关阅读:
    Cordova-conifg.xml配置
    Cordova插件开发
    android shape的使用
    Cordova
    性能优化
    ionic默认样式android和ios差异
    在IIS中部署ASP.NET 5应用程序遭遇的问题
    Ionic命令大全
    IOS开发
    Cordova 8 架构使用sqlite
  • 原文地址:https://www.cnblogs.com/zxbzl/p/5849680.html
Copyright © 2011-2022 走看看