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 you're using a self hosted site like me, the way to avoid this problem (as described above) is to stipulate on both the host and client side that the wsHttpBinding security mode = NONE.
When creating the binding, both on the client and the host, you can use this code:
Dim binding as System.ServiceModel.WSHttpBinding
binding= New System.ServiceModel.WSHttpBinding(System.ServiceModel.SecurityMode.None)
or
System.ServiceModel.WSHttpBinding binding
binding = new System.ServiceModel.WSHttpBinding(System.ServiceModel.SecurityMode.None);
Why can't you just remove the security setting altogether for wsHttpBinding ("none" instead of "message" or "transport")?
set anonymous access in your virtual directory
write following credentials to your service
ADTService.ServiceClient adtService = new ADTService.ServiceClient();
adtService.ClientCredentials.Windows.ClientCredential.UserName="windowsuseraccountname";
adtService.ClientCredentials.Windows.ClientCredential.Password="windowsuseraccountpassword";
adtService.ClientCredentials.Windows.ClientCredential.Domain="windowspcname";
after that you call your webservice methods.
Have you tried using basicHttpBinding instead of wsHttpBinding? If do not need any authentication and the Ws-* implementations are not required, you'd probably be better off with plain old basicHttpBinding. WsHttpBinding implements WS-Security for message security and authentication.
I was able to resolve the shared issue by following below steps:
I also had the same problem in wsHtppBinding
. And I just had to add security
mode pointing to none
, that solved my problem and no need to switch to basicHttpBinding
. Check Here and check how to disable WCF security. Check the below config change for reference:
<wsHttpBinding>
<binding name="soapBinding">
<security mode="None">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>