var ws = new localhost.WebService();
ws.Credentials = CredentialCache.DefaultCredentials;
ws.PreAuthenticate = true;
These settings will let you connect to the service.
If you need to you can manually specify credentials or use the credentials of the the calling application.