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

    解决方案: 

       打开web.config 配置文件  ctrl+f 键  查找"endpoint"  然后手工删除掉原有的才能正常运行。

    错误原因:

      当在vs 2010中添加服务引用后,如果“更新”服务引用,或“删除”该服务引用后再次加入后,在运行时会出现此错误。这是因为在“更新/删除”服务引用时,app.config文件并不会自动修改,在“更新”或再次“加入”后,会生成两个同样的“endpoint”,需要手工删除掉原有的才能正常运行。

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    
    namespace WebUI.Page11
    {
        public partial class 手机号查询 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
    
            }
    
            protected void Button1_Click(object sender, EventArgs e)
            {
                MoblieServiceReference.MobileCodeWSSoapClient moblie = new MoblieServiceReference.MobileCodeWSSoapClient();
                string text = moblie.getMobileCodeInfo(this.TextBox1.Text, "");
                Response.Write(text);
            }
        }
    }
    
    

     当代码执行到“MoblieServiceReference.MobileCodeWSSoapClient moblie = new MoblieServiceReference.MobileCodeWSSoapClient();“时抛出无法加载协定为“ServiceReference1.LanguageService””的终结点配置部分,因为找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分。

  • 相关阅读:
    Spring系列-JDBC实例
    postman-记录cookies信息
    根据URL获取参数值得出json结果集,对外给一个接口让别人调用
    linux 软硬链接
    第一个shell程序
    Argparse简易教程
    SQLAlchemy 教程 —— 基础入门篇
    人机对战初体验—四子棋游戏
    python的Flask 介绍
    python的项目结构
  • 原文地址:https://www.cnblogs.com/chenghu/p/2362957.html
Copyright © 2011-2022 走看看