Web 服务/Web 配置问题
因此,当我尝试创建 Web 服务的新实例时,会抛出一个异常,其中显示:
“在 ServiceModel 客户端配置部分中找不到引用协定“KBBVehicleService.IVehicleInformationService”的默认端点元素。这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素。”
这是一个将连接到 Kelley Blue Book 的 Web 服务。
我知道我的 Web.Config 中需要一个新的端点条目,但这是什么样的?
我添加的看起来像这样:
<endpoint address="http://localhost:3300/KBB.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_Default" contract="Services.Client.IVehicleInformationService"/>
但它不起作用。仍然在同一位置抛出相同的异常。
有什么想法吗?
So I get thrown an exception right when I try to create a new instance of my Web Service that says:
"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."
This is a web service that will connect to Kelley Blue Book.
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.
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 ServiceModel 客户端配置部分中找不到引用协定“ServiceReference.IWebService”的默认端点元素。这可能是因为找不到应用程序的配置文件,或者因为在客户端元素中找不到与此协定匹配的端点元素。
Could not find default endpoint element that references contract 'ServiceReference.IWebService' 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.
正如异常消息建议您使用正确的合约类型:
As the exception message suggest you, use the proper contract type: