I am trying to access my WCF service on a server from my client console application for testing. I am getting the following error:
The caller was no
if needed to specify domain(which authecticates username and password that client uses) in webconfig you can put this in system.serviceModel services service section:
<identity>
<servicePrincipalName value="example.com" />
</identity>
and in client specify domain and username and password:
client.ClientCredentials.Windows.ClientCredential.Domain = "example.com";
client.ClientCredentials.Windows.ClientCredential.UserName = "UserName ";
client.ClientCredentials.Windows.ClientCredential.Password = "Password";
I got it.
If you want to use wshttpbinding, u need to add windows credentials as below.
svc.ClientCredentials.Windows.ClientCredential.UserName = "abc";
svc.ClientCredentials.Windows.ClientCredential.Password = "xxx";
thanks
If you use basicHttpBinding, configure the endpoint security to "None" and transport clientCredintialType to "None."
<bindings>
<basicHttpBinding>
<binding name="MyBasicHttpBinding">
<security mode="None">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="MyServiceBehavior" name="MyService">
<endpoint
binding="basicHttpBinding"
bindingConfiguration="MyBasicHttpBinding"
name="basicEndPoint"
contract="IMyService"
/>
</service>
Also, make sure the directory Authentication Methods in IIS to Enable Anonymous access
This can be caused if the client is in a different domain than the server.
I encountered this when testing one of my applications from my PC(client) to my (cloud) testing server and the simplest solution i could think of was setting up a vpn.