Monday, February 13, 2012

401 authorization denied error for web service proxy

all-
When I have a SQLXML 3.0 virtual directory set up on the same web server as the one that my application is in on my local machine, I can run the application. When I move the web reference (and the web service) to a different server, I can access the
application on my machine with http://localhost but not http://<machinename>.
I have tried setting various properties from the System.Web.Services library in addition to credentials. Here are the the things I have tried:
proxy.UnsafeAuthenticatedConnectionSharing = true;
proxy.Credentials = CredentialCache.DefaultCredentials;
proxy.PreAuthenticate = true;
Maybe the problem is with IIS, but the username does seem to be passed in correctly when it is localhost.
to recap
SAME BOX LOCAL WEB, REMOTE SQLXML BOTH REMOTE
http://localhost YES YES NO
http://<machinename> YES NO NO
After further troubleshooting I can say with some confidence that this is a problem with server-to-server communication.
I have found KB articles on ServerXMLHTTP and how to pass default credentials from server to server, but no examples in .NET.
I also tried every syntax of proxycfg that I could think of, all the way down to
proxycfg -d
Now all requests bypass the proxy server and I still can't pass default credentials.
Any help would be greatly appreciated.

No comments:

Post a Comment