Assuming that si
is a SoapHttpClientProtocol
instance, this is how set the credentials:
si.Credentials = CredentialCache.DefaultCredentials;
(If the client is a web application then impersonation must be enabled.)
or
NetworkCredential myCred = new NetworkCredential(username, password, domainName); CredentialCache myCache = new CredentialCache(); myCache.Add(new Uri(si.Url), "NTLM", myCred); si.Credentials = myCache; si.UnsafeAuthenticatedConnectionSharing = true; si.ConnectionGroupName = username;