There isn't a whole lot of information on using Service References over Web References when it comes to passing in username and password credentials.
Normally with a Web Reference you'd do this:
MyWebRef.MyClient webClient = new MyWebRef.MyClient();
NetworkCredential credentials = new NetworkCredential("myUser", "myPassword");
webClient.Credentials = credentials;
The Alternative code to that:
MyServiceRef.MyClient client = new MyServiceRef.MyClient();
client.ClientCredentials.UserName.UserName = "myUser";
client.ClientCredentials.UserName.Password = "myPassword";
While this may not seem much different, it isn't immediately obvious where to look for setting the username and password inside the Service Reference.
068a2f3c-bfb2-4b4e-851c-58435d8c2394|0|.0
Tags:
There may be instances where you need to move data from one server to another using a Windows service. Typically your reasons for doing so are to keep certain files sychronized from a common source - for instance, a content management system may need to push files up to multiple web servers, or a BI engine may need file drops moved to a staging folder. Whatever your reason, it isn't difficult to setup if you follow a list of basics that need to be accomplished:
1) Create your Windows service that can move files around locally. If you can do this, then you can move files between servers too.
2) Assuming the above works, then you'll need to setup a common username/password on all servers. When doing so, make sure the common username has access to all the folders where files are being read and written.
3) Install your service on one of your servers, ensuring that your service is running under common username/password
That's it. Three steps, and you can move files around between non-domain servers.
b3dc68d2-56c9-4439-aef1-70e189d5812c|0|.0