locked
Received error during call HTTPS wsdl RRS feed

  • Question

  • User-665585339 posted

    Hi i invoke client wsdl file and via HTTPS called, but received following error:-

    #The HTTP request was forbidden with client authentication scheme 'Anonymous'.#

    Any ideas?

    Monday, February 10, 2014 5:53 AM

Answers

All replies

  • User-265225665 posted

    You havent posted any code, so it will be quite difficult to find cause of error, but this error comes due to invalid user, means the file which you are requested needs authentication. 

    If you are requesting third party wsdl than you need to go thorugh the documentation, they might have provided the way to request the resource.

    Monday, February 10, 2014 8:16 AM
  • User-665585339 posted

    Hi,

    My certificate path -> C:\MyCert\cert.cer

    My code ->

    ServiceClient service = new ServiceClient();

      ServicePointManager.ServerCertificateValidationCallback = delegate
                    { return true; };

               
                    FileStream fs = File.Open("C:\\MyCert\\cert.cer", FileMode.Open, FileAccess.Read);
                    byte[] buffer = new byte[fs.Length];
                    int count = fs.Read(buffer, 0, buffer.Length);
                    fs.Close();
                    X509Certificate2 cert = new X509Certificate2(buffer);
                    service.ClientCredentials.ClientCertificate.Certificate = cert;

                   //Call the service

                   ***

    Tuesday, February 11, 2014 12:57 AM
  • User-417640953 posted

    Hi johnlim35,

    Thank you post the issue.

    The HTTP request was forbidden with client authentication scheme 'Anonymous'

    That error message means the server side authenticated the client failed. Below are similar issues.

    http://stackoverflow.com/questions/1044034/wcftestclient-the-http-request-is-unauthorized-with-client-authentication-scheme

    From you code provided, I see the service has a transport certificate security model. And you should provide the x509certification.

    If you call the third part service, you should contact the server admin for the help.

    If the service is your own project, please refer to below article for How to: Use Certificate Authentication and Transport Security in WCF Calling from Windows Forms.

    http://msdn.microsoft.com/en-us/library/ff650785.aspx

    http://www.youtube.com/watch?v=ugpPSNxtAmY

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 13, 2014 2:40 AM