Remoting XML WebServices Request Failed HTTP 401 Access Denied From Client

  • Thread starter Thread starter Empire City
  • Start date Start date
E

Empire City

Regarding the QuickStart MathService Tutorial at: http://samples.gotdotnet.com/quickstart/aspplus/

When I try to access MathService from the MathServiceClient project after adding it as a reference I get the 401 error in the generated proxy class at this line:

object[] results = this.Invoke("Add", new object[] { a, b});



Rummaging about MSDN and having installed the Duwamish sample in the remote scenario at one point, I came to the conclusion that at the very least I need something like this:



<channel ref="http" useDefaultCredentials="true" />



In a new file named MathServiceClient.exe.config Both the MathService and MathServiceClient web.config don't seem like the place to put this.



Could someone tell me the changes if any that need to be put into either web.config files and also what the *.exe.config file(s) should be named and look like and in which project they should go?



Thank you.
 
No doubt there are multiple better ways however putting these two lines after instantiating the service works:



ICredentials credentials = new NetworkCredential("username","password","");

service.Credentials = credentials;



--

Regarding the QuickStart MathService Tutorial at: http://samples.gotdotnet.com/quickstart/aspplus/

When I try to access MathService from the MathServiceClient project after adding it as a reference I get the 401 error in the generated proxy class at this line:

object[] results = this.Invoke("Add", new object[] { a, b});



Rummaging about MSDN and having installed the Duwamish sample in the remote scenario at one point, I came to the conclusion that at the very least I need something like this:



<channel ref="http" useDefaultCredentials="true" />



In a new file named MathServiceClient.exe.config Both the MathService and MathServiceClient web.config don't seem like the place to put this.



Could someone tell me the changes if any that need to be put into either web.config files and also what the *.exe.config file(s) should be named and look like and in which project they should go?



Thank you.
 
Back
Top