Remoting XML WebServices Request Failed HTTP 401 Access Denied From Client - QuickStart

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?
 
E

Empire City

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;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top