By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,175 Members | 1,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,175 IT Pros & Developers. It's quick & easy.

Access Problem connecting to Web Service from Windows Service

P: n/a
I have a C# Web Service (anonymous access has been disabled) that I would
like to connect to with a standard Windows Service, also in C# as part of a
scheduled synchronization system.

I have configured my windows service to run as a particular user account. I
would like to use that account's credentials with the web service proxy, but
I can't seem to make it work.

The following code works:

webServiceProxy.PreAuthenticate = true;
webServiceProxy.Credentials = new System.Net.NetworkCredential("service user
name", "service user password", "service user domain");
webServiceProxy.DoStuff();

I've tried using

webServiceProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;

but that seems to always point to the currently logged-on user rather than
the user the windows service is set to run as, which is a problem.

I haven't been able to find any information on how to use the windows
service's credentials to connect to the web service -- anyone have any
suggestions?

Thanks,
Steve DeLong
sd*****@mantechnss.com
Nov 23 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.