コード例 #1
0
        public T GetService <T>() where T : WebServicesClientProtocol, new()
        {
            var serviceWse = new T
            {
                Url = path + "/Services/" + typeof(T).Name + ".asmx"
            };

            CredentialInitializer.InitCredentials(serviceWse, false, login, password);
            return(serviceWse);
        }
コード例 #2
0
        public static T GetService <T>() where T : WebServicesClientProtocol, new()
        {
            log.DebugFormat("Getting service proxy '{0}'", typeof(T));
            var serviceWse = new T
            {
                Url = Settings.TargetProcessPath + "/Services/" + typeof(T).Name + ".asmx"
            };

            log.DebugFormat("Service URL is '{0}'", serviceWse.Url);
            CredentialInitializer.InitCredentials(serviceWse, Settings.ActiveDirectoryMode, Settings.Login, Settings.Password);
            return(serviceWse);
        }