Am very new to webservices.. I was trying to consume a simple we service in my console application. Whie trying to invoke web method, i have written i am getting "401 unauthorised exception.. what is the work around for this? Any help will be much appreciated.. I have copied my code down
Thanks in advance
Prasanna
web service :
[WebMethod]
public int add(int i, int j){
return i+j;}
Console app :
[STAThread]
static void Main(string[] args){
try{
localhost1.Service1 sr =
new localhost1.Service1(); int i = sr.add(3,4);Console.WriteLine(i);
Console.ReadLine();
}
catch (Exception ex){
ex.ToString();
}
}
Mahesh ChandPosted Aug 3, 2007, 1:09 PM
Here is an article on it:
http://www.c-sharpcorner.com/UploadFile/mahesh/40107282006095201AM/401.aspx
Munir ShaikhPosted Aug 3, 2007, 5:38 AM
SYMPTOMS
This problem occurs when a Web service uses Integrated Windows authentication, and the client passes the appropriate credentials correctly.
Additionally, this problem may occur more frequently when multiple threads on the client try to connect to the network at the same time.
For HotFix check this URL
http://support.microsoft.com/contactus/?ws=support
Enjoy!!