Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5934331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:05:56+00:00 2026-05-22T15:05:56+00:00

I want to connect web service (as service reference) which is secured by certificate.

  • 0

I want to connect web service (as service reference) which is secured by certificate.

for this I’m doing this:

    ServiceClient service = new ServiceClient();
    service.ClientCredentials.ClientCertificate.SetCertificate (StoreLocation.CurrentUser, StoreName.Root, X509FindType.FindBySubjectName, "Subject Name");
    ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(ValidationCallBack);
    service.SomeMethod();

    private bool ValidationCallBack(object sender, X509Certificate cert, X509Chain chain, System.Net.Security.SslPolicyErrors error)
    {
         return true;
    }

When I call service.SomeMethod(); method, it throws an exception:

“The HTTP request was forbidden with
client authentication scheme
‘Anonymous’.”

What does this error means? And how can I avoid this to call web service method?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:05:57+00:00Added an answer on May 22, 2026 at 3:05 pm

    You’re doing the right things to connect via SSL (I assuming your server requires client certificates, usually not required), but it doesn’t look like you’re passing any credentials to the web service.

    Try adding this:

    service.Credentials = System.Net.CredentialCache.DefaultCredentials;
    

    This will pass the credentials of the currently logged on user to the service.

    As long as the current user has permissions to access the service, it should let you in. If the user with permissions on the service is different than the currently logged in user:

    credentialCache cache = new CredentialCache();
    cache.Add( new Uri(service.Url), // Web service URL
           "Negotiate",  // Kerberos or NTLM
           new NetworkCredential("username", "password", "domainname") );
    service.Credentials = cache;
    

    Things can get a bit more complicated if you’re using a proxy.

    http://man.ddvip.com/web/bsaspnetapp/LiB0087.html seemed like an ok writeup if you need more information.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to connect to this web service, http://aye.comp.nus.edu.sg/parsCit/wing.nus.wsdl So I clicked Add Service
I have a web-service which I secured using certificates. Now, I want to identify
Objective: I want to create a web service that allows me to connect to
When I want to connect to my web service If I write it like
If I want to connect to a third party web service via PHP using
I want to connect to a web service and display results in a WinJS
Since I just want to connect to a web service, in order to check
I am new to titanium and and want to call a web service from
I'm developing a Silverlight 3 Application which I want to connect to a webservice
I want to connect to DB2 from excel macro...This is my code, but it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.