WCF error: The caller was not authenticated by the service

前端 未结 10 499
野性不改
野性不改 2020-12-01 03:53

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

10条回答
  •  一生所求
    2020-12-01 03:56

    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);
    

提交回复
热议问题