一个类库引用了web service A,用另一个EXE做承载时,访问这个web service A时就提示:“在 ServiceModel 客户端配置部分中,找不到引用协定“IpsBarcode.ScanService”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。”

解决:把类库的App.config中<system.serviceModel>节点下的<bindings>和<client>配置节复制到EXE程序的App.config中(WindowsFormsHost.exe.config):

<?xml version="1.0" encoding="utf-8" ?>
<configuration> <system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="WSOrderQuerySoapBinding" />
<binding name="WSRefundSoapBinding" />
<binding name="WSScanSoapBinding" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://newpay.ips.com.cn:80/psfp-entry/services/order"
binding="basicHttpBinding" bindingConfiguration="WSOrderQuerySoapBinding"
contract="IpsOderQuery.OrderQueryService" name="WSOrderQuerySoap" />
<endpoint address="http://newpay.ips.com.cn:80/psfp-entry/services/refund"
binding="basicHttpBinding" bindingConfiguration="WSRefundSoapBinding"
contract="IpsRefund.RefundService" name="WSRefundSoap" />
<endpoint address="http://thumbpay.e-years.com/psfp-webscan/services/scan"
binding="basicHttpBinding" bindingConfiguration="WSScanSoapBinding"
contract="IpsBarcode.ScanService" name="WSScanSoap" />
</client> </system.serviceModel> </configuration>

在 ServiceModel 客户端配置部分中,找不到引用协定“IpsBarcode.ScanService”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。的更多相关文章

  1. 在 ServiceModel 客户端配置部分中,找不到引用协定“WebServiceTest.WebServiceSoap”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素

    原文  http://blog.csdn.net/bugdemo/article/details/9083497 主题 技术 在引用WebService后,程序运行到实例化WebService时报错, ...

  2. 在 ServiceModel 客户端配置部分中,找不到引用协定“WebServiceSoap”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素找不到与此协定匹配的终结点元素(转)

    按语: 在项目中实现自动升级过程,在类库中调用webservice取升级update.xml文件,添加服务调用,但在类库中调用时就出现异常,但在简单的测试工程中没有问题.解决方法采用下面介绍的方法 在 ...

  3. 在 ServiceModel 客户端配置部分中,找不到引用协定“myservice.Service1Soap”的默认终结点元素。这可能是因为未找到应用程序的配置文件,或者是因为客户端元素中找不到与此协定匹配的终结点元素。

    在做项目的时候遇到这个问题,当我在web网站中引用webservice时,很正常,但是当我在一个类库里引用并调用webservice方法后,然后网站调用这个类库里的方法,就会报标题这样的错误.最后纠结 ...

  4. MacOs 10.14.3 Matlab2018b 解决“找不到已安装的编译器 'Xcode Clang++'。错误使用mex,未找到合适的编译器”问题

    这是目前网上state of the art 的解决方案: 最开始用的是matlab2017,结果爆了这么一个问题“找不到已安装的编译器 'Xcode Clang++'.错误使用mex,未找到合适的编 ...

  5. 未找到导入的项目,请确认 <Import> 声明中的路径正确

    当使用vs出现下列情况: D:\xxxx\Web\Web.csproj : error  : 无法读取项目文件“Web.csproj”. D:\xxxx\WebServiceManager\Web\W ...

  6. vs未找到导入的项目,请确认 <Import> 声明中的路径正确

    当使用vs出现下列情况: D:\xxxx\Web\Web.csproj : error  : 无法读取项目文件“Web.csproj”. D:\xxxx\WebServiceManager\Web\W ...

  7. 在 ServiceModel 客户端配置部分中,找不到引用协定“PmWs.PmWebServiceSoap”的默认终结点元素

    System.Exception: ConfigManager.LoadConfigurationFromDb ServiceFactory.GetPmWebService 在 ServiceMode ...

  8. 在 ServiceModel 客户端配置部分中,找不到引用协定“XX”的默认终结点元素的解决方法

    今天在CRM2011中写Plugin的的时调用WCF报错,错误如下:"在 ServiceModel 客户端配置部分中,找不到引用协定"XX"的默认终结点元素.这可能是因为 ...

  9. 类库文件引用web服务报错解决方法-在 ServiceModel 客户端配置部分中,找不到引用协定的默认终结点元素

    由于需求,需要改造原有应用,因原有应用是写在console下面的,现在需要开放至web下, 想到BIZ层应用代码都是一样的,又不想在web下在添加引用,而重复写代码,故将原有的console下的服务和 ...

随机推荐

  1. Ubuntu16.04通过GPT挂载硬盘

    一般而言,服务器上挂载的硬盘都是比较大的,传统的对硬盘进行分区需要在终端敲sudo fdisk进行操作,但是, 当挂载的硬盘的容量大于2T的时候,是无法通过sudo fdisk进行挂载的,这个时候必须 ...

  2. 两个Inline-block元素不对齐

    可能是有一个元素用了overflow:hidden,(给另一个元素也加上) 也有可能是基线没对齐,用vertical-align:top可以

  3. CH0101 a^b、 CH0102 64位整数乘法(快速幂、快速乘)【模板题】

    题目链接:传送门    //a^b   传送门    //64位整数乘法 题目: 描述 求 a 的 b 次方对 p 取模的值,其中 ≤a,b,p≤^ 输入格式 三个用空格隔开的整数a,b和p. 输出格 ...

  4. tomcat服务器安装方法

    tomcat: 链接:https://pan.baidu.com/s/1pMEu0hP 密码:g0ah      (tomcat7) jdk :链接:https://pan.baidu.com/s/1 ...

  5. lamp 相关

    1.LAMP = linux + apache + mysql(mariadb/mongodb) + php 2.mysql 安装:先下载安装包: wget -c http://mirrors.soh ...

  6. MergeKLists

    public ListNode mergeKLists(ListNode[] lists) { if(lists==null||lists.length==0) return null; Priori ...

  7. generator插件配置方式使用

    generator插件配置方式使用 <build> <plugins> <plugin> <groupId>org.mybatis.generator& ...

  8. (2)Django入门

    web框架:把一个请求拆成几部分,每部分做相同的事 python中常用的框架 1.Django:大而全的框架 2.flask:微框架又叫轻量级的框架 3.Tornado:高性能框架 pycharm创建 ...

  9. 线程---同步(synchronized)

    实现线程同步的一种方式介绍: 思路: 首先,需要被协调的类,先实现线程,并重写run方法 然后,在被协调的类中私有化控制器,控制器实例化,由构造器带入. 其次,由控制器对象具体负责调用. 举例:循环输 ...

  10. Mybatis(二,三)

    参考孤傲苍狼的博客,地址如下: http://www.cnblogs.com/xdp-gacl/p/4264301.html 在此声明,自己写博客,是为了学习总结过程中的记录.没有侵权和偷懒的意思. ...