integrated windows authentication

Topics: Developer Forum
Jan 27, 2007 at 11:07 PM
I'm getting the error "The remote server returned an error: (401) Unauthorized." when calling the second line below. The web service is defined in IIS with windows authentication and my client app a winform. How do I tell the proxy factory to use the credentials of the current user when interogating the Uri?

Uri uri = new Uri("http://localhost/MyProject/Service.asmx?WSDL");
ProxyFactory<IClass1> _proxyFactory = new ProxyFactory<IClass1>(uri);
Feb 2, 2007 at 11:11 PM
anyone supporting this product...?
Feb 18, 2007 at 10:00 PM
Thank you for submitting this issue. I'm going to convert your post to work item.
A specific property (Credentials) will be probably added to the ProxyFactory class.
Feb 18, 2007 at 10:01 PM
This discussion has been copied to Work Item 8341. You may wish to continue further discussion there.
Feb 28, 2007 at 1:33 PM
A new release is available. The integrated windows authentication is henceforth supported.

ProxyFactory<IService> __serviceFactory = new ProxyFactory<IService>("MyService");
ICredentials __credentials = new NetworkCredential("username", "password", "domain");
__serviceFactory.SetPropertyValue(WebServicesPropertyMetadata.CredentialsProperty, __credentials);
IService __service = __serviceFactory.CreateProxy();
string __text = __service.HelloWorld();

<?xml version="1.0" encoding="utf-8" ?>
<endpoint name="MyService"
contract="MyContracts.IService, MyContracts"
address="http://localhost/MyProject/Service.asmx?WSDL" />

Any feedback is welcome.