예제 #1
0
        /// <summary>
        /// Initial the webservice API.
        /// </summary>
        /// <param name="client">client</param>
        /// <param name="userName">user name</param>
        /// <param name="password">password</param>
        public MailAdapter(String client, String userName, String password , System.Net.WebProxy oWebProxy)
        {
            this.client = client;
            this.userName = userName;
            this.password = password;
            this.oWebProxy = oWebProxy;
            exportService = new cn.tripolis.dialogue.export.ExportService();
            exportAuthInfo = new cn.tripolis.dialogue.export.AuthInfo
                {
                    client = client,
                    username = userName,
                    password = password
                };
            exportService.authInfo = exportAuthInfo;
            exportService.Proxy = oWebProxy;

            importService = new cn.tripolis.dialogue.import.ImportService();
            importAuthInfo = new cn.tripolis.dialogue.import.AuthInfo
                {
                    client = client,
                    username = userName,
                    password = password
                };
            importService.authInfo = importAuthInfo;
            importService.Proxy = oWebProxy;
        }
예제 #2
0
        /// <summary>
        /// Initial the webservice API.
        /// </summary>
        /// <param name="client">client</param>
        /// <param name="userName">user name</param>
        /// <param name="password">password</param>
        public DialogueService_new(String client, String userName, String password, System.Net.WebProxy oWebProxy)
        {
            this.client = client;
            this.userName = userName;
            this.password = password;
            this.oWebProxy = oWebProxy;
            //string strDomain = ConfigurationSettings.AppSettings["domain"].ToString();
            ////判断是否启用代理服务器
            //if (strDomain.Trim() != "")
            //{
            //    //域访问名
            //    string strUserName = ConfigurationSettings.AppSettings["UserName"].ToString();
            //    //域访问密码
            //    string strPassWord = ConfigurationSettings.AppSettings["PassWord"].ToString();
            //    //代理地址
            //    string strHost = ConfigurationSettings.AppSettings["Host"].ToString();
            //    //代理端口
            //    int strPort = Convert.ToInt32(ConfigurationSettings.AppSettings["Port"].ToString());
            //    //设置代理
            //    System.Net.WebProxy oWebProxy = new System.Net.WebProxy(strHost, strPort);
            //    // 获取或设置提交给代理服务器进行身份验证的凭据
            //    oWebProxy.Credentials = new System.Net.NetworkCredential(strUserName, strPassWord, strDomain);
            //    objService.Proxy = oWebProxy;
            //}
            subscriptionService = new cn.tripolis.dialogue.subscription.SubscriptionService();
            subscriptionAuthInfo = new cn.tripolis.dialogue.subscription.AuthInfo
                {
                    client = client,
                    username = userName,
                    password = password
                };
            subscriptionService.authInfo = subscriptionAuthInfo;
            subscriptionService.Proxy = oWebProxy;

            exportService = new cn.tripolis.dialogue.export.ExportService();
            exportAuthInfo = new cn.tripolis.dialogue.export.AuthInfo
                {
                    client = client,
                    username = userName,
                    password = password
                };
            exportService.authInfo = exportAuthInfo;
            exportService.Proxy = oWebProxy;

            importService = new cn.tripolis.dialogue.import.ImportService();
            importAuthInfo = new cn.tripolis.dialogue.import.AuthInfo
            {
                client = client,
                username = userName,
                password = password
            };
            importService.authInfo = importAuthInfo;
            importService.Proxy = oWebProxy;
        }