Ejemplo n.º 1
0
 /// <remarks/>
 public void createAsync(CreateSmsMessageRequest createRequest) {
     this.createAsync(createRequest, null);
 }
Ejemplo n.º 2
0
 /// <remarks/>
 public void createAsync(CreateSmsMessageRequest createRequest, object userState) {
     if ((this.createOperationCompleted == null)) {
         this.createOperationCompleted = new System.Threading.SendOrPostCallback(this.OncreateOperationCompleted);
     }
     this.InvokeAsync("create", new object[] {
                 createRequest}, this.createOperationCompleted, userState);
 }
Ejemplo n.º 3
0
        /// <summary>
        /// create direct sms
        /// </summary>
        /// <param name="smsTypeId">direct sms type id</param>
        /// <param name="smsLabel">sms label</param>
        /// <param name="smsName">sms name</param>
        /// <param name="subject">subject</param>
        /// <param name="description">decription</param>
        /// <param name="fromName">sender name</param>
        /// <param name="fromAddress">from address</param>
        /// <param name="htmlSource">html source</param>
        /// <returns>direct sms id</returns>
        public String createsmsMessage(String smsTypeId, String smsLabel, String smsName, String description, String fromName, String message, String alternativeMessage)
        {
            if (logger.IsDebugEnabled)
            {
                logger.Debug("createsmsMessage:smsTypeId=" + smsTypeId + ",smsLabel=" + smsLabel + ",smsName=" + smsName +  ",description=" + description + ",fromName=" + fromName + ",message=" + message);
            }
            String result;
            String smsId = getSmsMessageId(smsTypeId, smsName);
            //Check if the sms type is already exist.
            if (!smsId.Equals(""))
            {
                return smsId;
            }

            CreateSmsMessageRequest request = new CreateSmsMessageRequest();
            try
            {
                request.smsTypeId = smsTypeId;
                request.label = smsLabel;
                request.name = smsName;
               
                request.description = description;
                request.originator = fromName;
                request.message = message;
                request.alternativeMessage = alternativeMessage;
              
                
                //request.
                IDResponse response = smsMessageService.create(request);

                result = response.id;


            }
            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 creating direct sms, error is" + result);
                    }
                    throw new Exception(ex.Detail.InnerXml);
                }
                result = Util.getExistId(ex.Detail);

            }
            return result;
        }