Web Service/Web Config Issues
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?
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:
<endpoint
address="http://localhost:3300/KBB.svc"
binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_Default"
contract="KBBVehicleService.IVehicleInformationService"
/>
精彩评论