Emil’s Blog

Programming Windows, .Net, EPiServer and whatnot…

[Powered by WordPress.]

May 12, 2006

Set credentials on a WebService connection

by @ 13:47. Filed under .Net programming

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;

[powered by WordPress.]

jour·nal n. A personal record of occurrences, experiences, and reflections kept on a regular basis; a diary.

Internal links:

Categories:

Search blog:

Archives:

May 2006
M T W T F S S
« Apr   Jun »
1234567
891011121314
15161718192021
22232425262728
293031  


View Emil Åström's profile on LinkedIn

General links:

I read:

Visitors

Recent Comments

Spam caught

Other:

Clicky Web Analytics

36 queries. 0.598 seconds