c# - Calling a web service from a windows service -


I'm sure there is a beautiful solution to this problem, but I can not find my head around it. I'm trying to call a web service call from within the Windows service, the web service is secure (using Windows authentication) the Windows service that runs in that account has the right to call the web service, but I Do not know how to get those credentials and send them to the web service. The web service is WCF and is hosted in the same machine (IIS) as a Windows service.

You should be able to use something like this:

 < Code> var myService = new myThing.Service (); MyService.Credentials = System.Net.CredentialCache.DefaultCredentials;  

Comments