Troubleshooting: the caller is not authenticated by the Service.

Source: Internet
Author: User

Troubleshooting: the caller is not authenticated by the Service.

I have been working on both the WCF Service and client on one computer. I called it on another computer today and found a new problem: "The caller is not authenticated by the Service ",

I checked a lot of information on the Internet, and did not find anyone explaining the reasons. I just found a solution, but I personally feel that it is not the best solution, so we are still exploring.

As mentioned in the solution, you can set the security authentication to "none" on the server and the client respectively. You have tried it several times and it has not been successful. but theoretically it is okay.

 

In addition, I found such a solution. I don't know if I have any other opinions.

 

Deploying the WCF server and client on different machines separately may trigger the following exceptions.
System. ServiceModel. Security. SecurityNegotiationException not handled
Message = "the server has rejected client creden. "
Source = "mscorlib"
The solution is to adjust the server Binding security mode, for example, set it to "None ".
NetTcpBinding binding = new NetTcpBinding ();
Binding. Security. Mode = SecurityMode. None;

ServiceHost host = new ServiceHost (typeof (MyService ));
Host. AddServiceEndpoint (typeof (IService), binding, "net. tcp: // 192.168.0.112: 8081 ");

ServiceMetadataBehavior metadata = new ServiceMetadataBehavior ();
Metadata. HttpGetUrl = new Uri ("http: // 192.168.0.112: 8080 ");
Metadata. HttpGetEnabled = true;
Host. Description. Behaviors. Add (metadata );

Host. Open ();
Or set it in the configuration file.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.