Web服务/网络配置问题 [英] Web Service/Web Config Issues

查看:317
本文介绍了Web服务/网络配置问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我得到抛出的异常权当我尝试创建我的Web服务的一个新实例,说:

So I get thrown an exception right when I try to create a new instance of my Web Service that says:

找不到,在ServiceModel客户端配置部分引用合同'KBBVehicleService.IVehicleInformationService默认终结点元素。这可能是因为没有配置文件,发现你的应用程序,或者是因为匹配这份合同没有终结点元素可以中找到客户端的元素。

"Could not find default endpoint element that references contract 'KBBVehicleService.IVehicleInformationService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."

这是一个Web服务将连接到凯利蓝皮书。

This is a web service that will connect to Kelley Blue Book.

我知道我需要在我的web.config一个新的端点进入,但是是什么样子呢?

I know I need a new endpoint entry in my Web.Config, but what does this look like?

一个我加入这个样子的:

The one I added looks like this:

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

但它不工作。还是投在同一地点相同的异常。

But it doesn't work. Still throws the same exception at the same place.

任何想法?

推荐答案

由于异常消息建议你,使用适当的合同类型:

As the exception message suggest you, use the proper contract type:

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

这篇关于Web服务/网络配置问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆