Ejemplo n.º 1
0
        /// <summary>
        /// Get sms id by sms type id and sms name.
        /// </summary>
        /// <param name="smsTypeId">sms type id</param>
        /// <param name="smsName">sms name</param>
        /// <returns>sms id</returns>
        public String getSmsMessageId(String smsTypeId, String smsName)
        {
            if (logger.IsDebugEnabled)
            {
                logger.Debug("getSmsMessageId:smsTypeId=" + smsTypeId + ",smsName=" + smsName);
            }

            String result = "";

            SmsTypeIDRequest request = new SmsTypeIDRequest();
            try
            {
                request.smsTypeId = smsTypeId;
                SmsMessageListResponse response = smsMessageService.getBySmsMessageTypeId(request);

                foreach (SmsMessage item in response.smsMessages)
                {
                    if (item.name.Equals(smsName))
                    {
                        return item.id;
                    }
                }

            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                if (logger.IsDebugEnabled)
                {
                    logger.Debug("error happens in getting sms type id, error is" + result);
                }
                throw new Exception(ex.Detail.InnerXml);
            }
            return result;
        }
Ejemplo n.º 2
0
 /// <remarks/>
 public void getBySmsMessageTypeIdAsync(SmsTypeIDRequest getBySmsMessageTypeIdRequest, object userState) {
     if ((this.getBySmsMessageTypeIdOperationCompleted == null)) {
         this.getBySmsMessageTypeIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OngetBySmsMessageTypeIdOperationCompleted);
     }
     this.InvokeAsync("getBySmsMessageTypeId", new object[] {
                 getBySmsMessageTypeIdRequest}, this.getBySmsMessageTypeIdOperationCompleted, userState);
 }
Ejemplo n.º 3
0
 /// <remarks/>
 public void getBySmsMessageTypeIdAsync(SmsTypeIDRequest getBySmsMessageTypeIdRequest) {
     this.getBySmsMessageTypeIdAsync(getBySmsMessageTypeIdRequest, null);
 }