【问题标题】:Web Service/Web Config IssuesWeb 服务/Web 配置问题
【发布时间】:2011-04-07 12:23:39
【问题描述】:

因此,当我尝试创建 Web 服务的新实例时,我得到了一个异常:

“在 ServiceModel 客户端配置部分中找不到引用合同 'KBBVehicleService.IVehicleInformationService' 的默认端点元素。这可能是因为找不到您的应用程序的配置文件,或者因为找不到与此合同匹配的端点元素客户端元素。”

这是一个将连接到 Kelley Blue Book 的网络服务。

我知道我的 Web.Config 中需要一个新的端点条目,但这是什么样的?

我添加的那个是这样的:

<endpoint address="http://localhost:3300/KBB.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Default" contract="Services.Client.IVehicleInformationService"/>

但它不起作用。仍然在同一个地方抛出同样的异常。

有什么想法吗?

【问题讨论】:

    标签: asp.net-mvc vb.net web-config webservice-client


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

      按照异常消息的建议,使用正确的合同类型:

      <endpoint 
          address="http://localhost:3300/KBB.svc" 
          binding="basicHttpBinding" 
          bindingConfiguration="BasicHttpBinding_Default" 
          contract="KBBVehicleService.IVehicleInformationService"
      />
      

      【讨论】:

        猜你喜欢
        • 2011-08-14
        • 1970-01-01
        • 2011-02-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多