.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

The HTTP request is unauthorized with client authentication scheme 'Anonymous'

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :.NET Framework
I am trying to do a soap request from a WebCTRL server. I went to add a service reference, entered the URL to my wsdl and (after prompting me for a username and password) it added the reference and I can create an instance of the service object and makes calls against it.   Dim eval As New WebCTRL_Eval.EvalClient eval.Open() Debug.Print(eval.getValue("#reception_40/lstat"))   I get this back from the server, on open and getvalue.   The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Basic realm="SOAP Access"'.   I understand that it is the HTTP authentication that I need to setup or configure, but just dont understand how to do it.   I have tried eval.ClientCredentials.UserName.UserName = "myusername" eval.ClientCredentials.UserName.Password = "mypassword"   How do I change the client authentication scheme and provide my credentials to it?   Here is what is on my app.config file.   <system.serviceModel>  <bindings>   <wsHttpBinding>    <binding name="EvalSoapBinding"     bypassProxyOnLocal="false"     transactionFlow="false"     hostNameComparisonMode="StrongWildcard"     maxBufferPoolSize="524288"     maxReceivedMessageSize="65536"     messageEncoding="Text"

View Complete Post

More Related Resource Links

The HTTP request is unauthorized with client authentication scheme 'Anonymous'.




I am receiving an error when i am callign the WCF service which is hosted in the IIS,


The HTTP request is unauthorized with client authentication scheme 'Anonymous'.The authentication header received from the server was 'Negotiate,NTLM' while calling service hosted in IIS.


Both check boxes are checkd in the properties->DirectorySecurity->Edit...

Anonymus and Integrated Windows.


Can anybody help me regarding thsi issue...






The HTTP request is unauthorized with client authentication scheme 'Anonymous' The authentication


Hi all,

The scenario is as follows.

I need to connect to a webservice hosten in a JBOSS server.

The server provides a certificate, besides it requires username and password to validate against an LDAP.

My part is to develop a client in .NET WCF that uses the constraints defined above.

Here is my client code:


service.ServiceModificarDomicilioContactoPersonasClient servicioJboss = new service.ServiceModificarDomicilioContactoPersonasClient();

service.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

service.ClientCredentials.UserName.Password = "******";
service.ClientCredentials.UserName.UserName = "******";

service.ClientCredentials.Windows.ClientCredential.UserName = "********";
service.ClientCredentials.Windows.ClientCredential.Password = "********";

service.modificarDomicilioResponse resp = new service.modificarDomicilioResponse();
service.modificarDomicilio metodo = new service.modificarDomicilio();
metodo.arg0 = 1;

metodo.arg1 = 1402251;

metodo.arg2 = 506907;

metodo.arg3 = 1;

metodo.arg4 = 999999;

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

I am trying to build a proof of concept of a WCF service utilisting a
wsHttpBinding with Transport Certificate security. I am having problems
connecting to it with a console client - everytime I try to open the channel
I get the following error: The HTTP request was forbidden with client authentication scheme 'Anonymous'.

can any one help me?
Thanks a lot
Frank Xu Lei--????,????
Focus on Distributed Applications Development and EAI based on .NET
?????????????:Welcome to My Chinese Technical Blog
??????WCF??????:Welcome to Microsoft Chinese WCF Forum
??????WCF??????:Welcome to Microsoft English WCF Forum

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



I was working on an application (test application) which requires client certificate for authentication using basicHttpBinding over secure channel. My Service Configuration is


<binding name="secureClientServer">
	<security mode ="Transport">
		<transport clientCredentialType ="Certificate"/>

WCf client request unauthorized with client authentication scheme 'Ntlm'. The authentication heade



I try to connect to a wcf service hosted in iis from a console application.

I have this message : The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'Negotiate,NTLM'. ---> System.Net.WebException: The remote server returned an error: (401) Unauthorized.

(By the way it works when my client is a silverlight application ...)

Web.config (iis 6.0 server configuration):

   <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

     <binding name="basicHttpBinding">
      <security mode="TransportCredentialOnly">
       <transport clientCredentialType="Windows" />
       <behavior name="DefaultServiceBehavior">
        <serviceMetadata httpGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
      <service name="WebApplication1.Service1" behaviorConfigur

Anonymous Web Site receives "The request failed with HTTP status 401: Unauthorized"


I set up a test website on my local box and was able to access sharepoint search using the querySearch web service from SP.  After I got it all working properly I transferred the code to the target website that is set up with anonymous access for all people on the fab floor.  However from this website I keep getting the 401 error.  It can't be SP because the same code worked from my local website "localhost".  Any suggestions?  we don't want to have to have the fab people log in so we can't not have the box anonymous.  I would appreciate any suggestions very much!!!

Using WSS 2007 with MOSS.


  private void GetDefaultCredentials()
      m_where = "get configuration data for credentials";
      string userid = ConfigurationManager.AppSettings[ "userid" ];
      string password = ConfigurationManager.AppSettings[ "password" ];
      string domain = ConfigurationManager.AppSettings[ "domain" ];

      m_where = "set search query credentials";
      m_query.Credentials = new NetworkCredential ( userid, password

How to bind a WCF Http client to a specific outbound IPAddress before making the request

I want my request to go out through a specific IP Addresses. Is there a way to do that in WCF. The explanation of why I need this is a little long winded so i'd rather not get into that. Here is sample code string ipAddress = ""; IService service; ChannelFactory<IOmlService> factory = new ChannelFactory<IService>(new BasicHttpBinding(), new EndpointAddress("http://" + IPAddress + ":6996/IService")); service = factory.CreateChannel(); service.Test(); Here is an example scenario to explain exactly what i'm looking for. Let's say I have two IPs on my machine ( and Both of them can hit If i run this code now, it will hit the IP (.32) from any of my IPs (.30 or .31). How can i force it to go through a specific IP of mine (say .30). Is there any way to do that using WCF? Thanks

While calling Web service gets exception "The request failed with HTTP status 401: Unauthorized"

Hi All, I created a ASP.NET web service, which was hosted on default visual studioserver, and on excecution of webservice it run .exe file which in turn update xml file. Now i hosted this webservice on IIS 6.0 server, and when i run the service, itfails to execute the exe.When i run it on debug mode, i never get any exception.Code...public string HelloWorld()    {        Process myProcess = new Process();        try        {            myProcess.StartInfo.UseShellExecute = false;            // You can start any process,             myProcess.StartInfo.FileName = @"E:\Projects\some.exe";            myProcess.StartInfo.CreateNoWindow = true;            myProcess.Start();            myProcess.Close();            myProcess.Dispose();            return "Suceess";         }&n

SQL Server Reporting Service 2008 R2 - The request failed with HTTP status 401: Unauthorized.

I got the error "The request failed with HTTP status 401: Unauthorized." when I call the Reporting Service Web Service.

The code is very simple:

// Initialise the reporting service Web Service

this.RSWebService = new ReportingService2010();

// Pass windos authentication credentials to Web Service

this.RSWebService.Credentials = System.Net.CredentialCache.DefaultCredentials;

// List children

List<CatalogItem> reports = this.RSWebService.ListChildren(folder, false).ToList();

The SQL Server is installed on a different machine (say server A) from the Web server (say server B). We are using Windows Server 2003.

The code work fine for all the scenario below:

i) Run locally (XP) to call the web service on the sql server

ii) Provide the Network Credentials with the username, password, and domain when calling the web service

iii) If the web server and sql server is using same server (i.e. not distributed)

I'm using windows authentication and impersonation. Any idea?

Webs Webservices problem : The request failed with HTTP status 401: Unauthorized

I am trying to run this code to get the web collection details. I am running this code in debug mode in Visual Studio 2005. I am running this code on sharepoint.acme.com, the same machine on which MOSS 2007 is installed.

        Webs websService = new Webs();
        System.Net.SystemNetworkCredential credentials =
        websService.Credentials = System.Net.CredentialCache.DefaultCredentials;
        websService.Url = "http://sharepoint.acme.com/_vti_bin/Webs.asmx";

        System.Xml.XmlNode myNode = websService.GetAllSubWebCollection();

I get this error. "The request failed with HTTP status 401: Unauthorized" in the last line while debug mode running. Earlier it used to work fine, but today I see this problem. Both acme\administrator and sharepoint\administrator can log into SharePoint. I tried running this code by logging in to my win2k3 desktop as acme\administrator once and launching Visual Studio 2005 and sharepoint\administrator another time. Both time it I got the same error.

Could someone please help me in resolving this error?

IIS7 anonymous authentication issues (401 Unauthorized Error)


I am trying to get anonymous access to my asp.net MVC web application.  My application pool is running as 'Network Service' adn I have given this account full access to my website root folder.  I have also enabled Anonymous Authentication within IIS for my website.  I have also given the 'IUSR' account full control of my website root folder (I understand that IIS runs as this account with anonymous access). 

What am I missing?  I continuously get the following 401 ERROR :

HTTP Error 401.0 - Unauthorized

You do not have permission to view this directory or page.

  • The authenticated user does not have access to a resource needed to process the request.
Logon Method  Anonymous
Logon User Anonymous
Module ManagedPipelineHandler
Notification ExecuteRequestHandler
Handler UrlRoutingHandler
Error Code


The request failed with HTTP status 407: Proxy Authentication Required (the ISA server requires auth


I'm new to webservice. I writed an example to work with a web service which is supplied on Internet (its url: http://ws.cdyne.com/delayedstockquote/delayedstockquote.asmx ) when i tried running i got an error message as System.Net.WebException was unhandled
  Message="The request failed with HTTP status 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy service is denied.  )."

I had found some solutions such as:
+ using ISA firewall
+ configuring proxy from Machine.config
+ inside coding

The first:  I used ISA firewall but i still got the same error, my problem didn't resolve. I guessed that is because ISA firewall needn't use Credentials (username/password).

The second:
 I tried coding in my source, it was okie. This solution is good because following this way i can get defaultCredentials from cache but needn't define straightforwardly my credentials as username/password
my code is as follows:

DelayedStockQuote wsStock =

How do I get the userName and passWord sent by a client using http basic authentication in a wcf se


Hello Guys,

I need to get the username and password that my java clients are passing using basic http authentication.

The message my clients are sending is the following:

POST http://localhost:1715/PanelService.svc/PanelService HTTP/1.1<br/>
Accept-Encoding: gzip,deflate<br/>
Content-Type: text/xml;charset=UTF-8<br/>
SOAPAction: "http://br/com/petrobras/operational/services/PanelService/getAverageByBusinessObject"<br/>
Authorization: Basic YWJjZGVmOjEyMzQ1Ng==<br/>
User-Agent: Jakarta Commons-HttpClient/3.1<br/>
Host: localhost:1715<br/>

Test Run: Web Application HTTP Request-Response Test Automation with JavaScript


Write a simple browser-based request-response test automation using JavaScript that's platform independent and useful when you are working in a highly dynamic environment.

James McCaffrey

MSDN Magazine January 2010

HTTP Pipelines: Securely Implement Request Processing, Filtering, and Content Redirection with HTTP


ASP.NET is a flexible and extensible framework for server-side HTTP programming. While most people think of ASP.NET in terms of pages served, there is a lower-level infrastructure sitting beneath this page model. The underlying plumbing is based on a pipeline of app, module, and handler objects. Understanding how this pipeline works is key if you want to get the most out of ASP.NET as an HTTP server platform, while making your process more efficient, and keeping your server secure. This article introduces the architecture of the pipeline and shows how you can use it to add sophisticated functionality to an ASP.NET-based app.

Tim Ewald and Keith Brown

MSDN Magazine September 2002

WinInet: Enable HTTP Communication in Windows-Based Client Applications


The Internet provides the infrastructure for applications to communicate, and that can include non-UI communication between Win32-based applications. If you think beyond the standard browser usage of HTTP, you can use this protocol to retrieve information from Win32-based applications and save it to a Web server. After explaining how HTTP can be used in this way, this article shows how to use Microsoft SQL Server, ASP, IIS, WinInet, and Visual Basic to implement two examples. The first reports usage data-how often an application is used and by whom. The second monitors application errors and reports error details for use by helpdesk staff or engineers in the debugging process.

Todd Meister

MSDN Magazine June 2001

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend