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

一个类库引用了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>

 

转载于:https://www.cnblogs.com/runliuv/p/6645903.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值