As the title alludes my project keeps telling me it can't find the default endpoint element but it is right there. I mean obviously I must be missing something but I can't figure it out???!!!
Full error msg: The error message was 'Could not find default endpoint element that references contract 'WebChatSvc.ChatServiceSoap' in the ServiceModel client configuration section. This might be....
WebChatSvc is the namespace I chose when I created my web reference.
My app config:
...
<appSettings>
<add key="ChatServiceSoap" value="http://localhost:1856/ChatService/ChatService.asmx" />
<add key="LogFilePath" value="" />
<add key="ConString" value="W2K8R2_SQL2K8R2;XXX;YYYY;TTTTT" />
<add key="ClientSettingsProvider.ServiceUri" value="http://localhost:1856/ChatService/ChatService.asmx" />
</appSettings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ChatServiceSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:1856/ChatService/ChatService.asmx" binding="basicHttpBinding" bindingConfiguration="ChatServiceSoap" contract="WebChatSvc.ChatServiceSoap" name="ChatServiceSoap" />
</client>
</system.serviceModel>
<applicationSettings>
<ChatClientControl.Properties.Settings>
<setting name="ChatServiceSoap" serializeAs="String">
<value>http://localhost:1856/ChatService/ChatService.asmx</value>
</setting>
</ChatClientControl.Properties.Settings>
</applicationSettings>
</configuration>
I've tried many different variations of the naming possibilities and just can't quite figure it out so any pointers would be greatly appreciated.
TIA JB
You created a service reference. You need to create a web reference.
Delete your currently added service reference. This will remove your endpoint configuration.
In your Solution Explorer, right click on references, then select "Add Service Reference" Then click "Advanced" (lower left button). Then click "Add Web Reference" (lower left button)
Then add the service. This will put in a different configuration for the web service with the URL.
While you can do it with a service reference, it is a little more work. I think if you just add the asmx web service as a web reference, it will spare you some grief.