Exemplo n.º 1
0
 /// <remarks/>
 public void importContactsFromFtpAsync(ImportContactsFromFtpRequest importContactsFromFtpRequest) {
     this.importContactsFromFtpAsync(importContactsFromFtpRequest, null);
 }
Exemplo n.º 2
0
 /// <remarks/>
 public void importContactsFromFtpAsync(ImportContactsFromFtpRequest importContactsFromFtpRequest, object userState) {
     if ((this.importContactsFromFtpOperationCompleted == null)) {
         this.importContactsFromFtpOperationCompleted = new System.Threading.SendOrPostCallback(this.OnimportContactsFromFtpOperationCompleted);
     }
     this.InvokeAsync("importContactsFromFtp", new object[] {
                 importContactsFromFtpRequest}, this.importContactsFromFtpOperationCompleted, userState);
 }
Exemplo n.º 3
0
        /// <summary>
        /// FTP contact file
        /// </summary>
        /// <param name="contactDatabaseId"> contactDatabaseId</param>
        /// <param name="groupId">groupId</param>
        /// <param name="fileName">fileName</param>
        /// <param name="reportReceiverAddress">reportReceiverAddress</param>
        /// <param name="ftpAccountId">ftpAccountId</param>
        /// <param name="scheduleAt">scheduleAt</param>
        /// <returns>message</returns>
        public String importContactFromFTP(String contactDatabaseId, String groupId, String fileName, String reportReceiverAddress, String ftpAccountId, DateTime scheduleAt)
        {
            if (logger.IsDebugEnabled)
            {
                logger.Debug("importContactFromFTP:contactDatabaseId=" + contactDatabaseId);
            }
            String result;
            cn.tripolis.dialogue.import.ImportContactsFromFtpRequest request = new cn.tripolis.dialogue.import.ImportContactsFromFtpRequest();
            try
            {

                request.contactDatabaseId = contactDatabaseId;
                string[] contactGroupIds = new string[1];
                contactGroupIds[0] = groupId;
                request.contactGroupIds = contactGroupIds;
                request.extension = cn.tripolis.dialogue.import.fileExtension.CSV;
                request.fileName = fileName;
                request.ftpAccountId = ftpAccountId;
                request.importMode = cn.tripolis.dialogue.import.importMode.ADD_TO_GROUP;
                request.reportReceiverAddress = reportReceiverAddress;
                request.scheduleAt= scheduleAt;

                cn.tripolis.dialogue.import.ImportIDResponse response = importService.importContactsFromFtp(request);

                result = response.importId;


            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                if (!Util.isCodeExist(ex.Detail) || Util.getExistId(ex.Detail).Equals(""))
                {
                    result = ex.Detail.InnerXml;
                    if (logger.IsDebugEnabled)
                    {
                        logger.Debug("error happens in ftp contact, error is" + result);
                    }
                    throw new Exception(ex.Detail.InnerXml);
                }
                result = Util.getExistId(ex.Detail);

            }
            return result;
        }