Exemple #1
0
 /// <remarks/>
 public void addToContactGroupAsync(AddToContactGroupRequest addToContactGroupRequest, object userState) {
     if ((this.addToContactGroupOperationCompleted == null)) {
         this.addToContactGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnaddToContactGroupOperationCompleted);
     }
     this.InvokeAsync("addToContactGroup", new object[] {
                 addToContactGroupRequest}, this.addToContactGroupOperationCompleted, userState);
 }
Exemple #2
0
        /// <summary>
        /// add contact to group
        /// </summary>
        /// <param name="contactId">contact Id</param>
        /// <param name="contactGroupId">contact group id</param>
        /// <returns></returns>
        private String addContactToGroup(String contactId, String contactGroupId)
        {
            if (logger.IsDebugEnabled)
            {
                logger.Debug("addContactToGroup:contactId=" + contactId + ",contactGroupId=" + contactGroupId);
            }
            String result;
            cn.tripolis.dialogue.contact.AddToContactGroupRequest groupRequest = new cn.tripolis.dialogue.contact.AddToContactGroupRequest();

            try
            {
                cn.tripolis.dialogue.contact.ContactGroupSubscriptionRequestObject subOBject = new cn.tripolis.dialogue.contact.ContactGroupSubscriptionRequestObject();
                groupRequest.contactId = contactId;
                subOBject.contactGroupId = contactGroupId;//"MjYwMTMyNjAot_oDDCr0mA";
                subOBject.confirmed = true;
                groupRequest.contactGroupSubscriptions = new cn.tripolis.dialogue.contact.ContactGroupSubscriptionRequestObject[1];
                groupRequest.contactGroupSubscriptions.SetValue(subOBject, 0);

                cn.tripolis.dialogue.contact.IDResponse response = contactService.addToContactGroup(groupRequest);

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

            }
            return result;
        }
Exemple #3
0
 /// <remarks/>
 public void addToContactGroupAsync(AddToContactGroupRequest addToContactGroupRequest) {
     this.addToContactGroupAsync(addToContactGroupRequest, null);
 }