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

一、问题

在调用远程web services接口时出现了以下问题:

 

二、可能的原因和解决方法

网站根目录里的web.config文件缺少了相应的配置信息

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="OSSysServiceSoap" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://127.0.0.1/vsappgdhr/gdhr/webservices/OSSysService.asmx"
          binding="basicHttpBinding" bindingConfiguration="OSSysServiceSoap"
          contract="OSSysService.OSSysServiceSoap" name="OSSysServiceSoap" />
    </client>
  </system.serviceModel>
</configuration>

 

posted @ 2017-04-21 21:52  吖然-jronny  阅读(14362)  评论(0编辑  收藏  举报