Prasanna PG

Prasanna PG

  • NA
  • 1
  • 0

Getting 401 unauthorized error

Jun 6 2007 8:36 AM
Hi

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();

}

}


Answers (2)