I have added ServiceReference with WSDL file, Client is throwing error:
Could not find endpoint element with name 'Endpoint1' and contract 'ServiceReference.IService' 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 name could be found in the client element.
I am not sure why the app.config endpoint is not picked up?
app.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="wsHttpPoint">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="UserName" establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="https://example.com:5555/Service.svc"
binding="wsHttpBinding" bindingConfiguration="wsHttpPoint" contract="ServiceReference.IService"
name="Endpoint1" />
</client>
</system.serviceModel>
</configuration>
Manually creating Proxy:
WSHttpBinding binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Transport;
EndpointAddress address = new EndpointAddress("https://example.com:5555/Service.svc");
Client.ClientCredentials.UserName.UserName = "";
Client.ClientCredentials.UserName.Password = "";
Client = new ConnectionServiceClient(binding, address);
Now there is a new error:
connectionSecure channel cannot be opened because security negotiation with the remote endpoint has failed. This may be due to absent or incorrectly specified EndpointIdentity in the EndpointAddress used to create the channel. Please verify the EndpointIdentity specified or implied by the EndpointAddress correctly identifies the remote endpoint.
Am I setting the Binding correctly? Every post I see talks about basichttpBinding, is there any wsHttpbinding example for Security Transport?