WSE: The request failed with HTTP status 401: Access Denied. When invoking a Web Service Method.
Posted on 2005-03-02
I have a ASP.NET Page to invoke Web Service which is in the same machine and I don't allow Anonymous Access, only Bais Authentication is enabled.
I integrated WSE 2.0 (Web Service Enhancement tool) to my ASP.NET project and pass a UsernameToken with credential to access the web method. When the execution goes to the point when I invoke a Web Method it get an Exception stating.
"The request failed with HTTP status 401: Access Denied."
Here is the code snippet.
ProjectListWse wseJobList = new ProjectListWse();
UsernameToken token = new UsernameToken(username, password, PasswordOption.SendNone); //Also tried all three passwordoption
wseJobList.RequestSoapContext.Security.Timestamp.TtlInSeconds = 60;
string xmldata = wseJobList.GetProjectList(); //Exception occurs at this point
Any help is greatly appreciated.
Thanks in advance