示例#1
0
 /// <remarks/>
 public void createAsync(CreateWorkspaceRequest createRequest, object userState) {
     if ((this.createOperationCompleted == null)) {
         this.createOperationCompleted = new System.Threading.SendOrPostCallback(this.OncreateOperationCompleted);
     }
     this.InvokeAsync("create", new object[] {
                 createRequest}, this.createOperationCompleted, userState);
 }
示例#2
0
        /// <summary>
        /// create work space 
        /// </summary>
        /// <param name="contactDatabaseId">contactDatabaseID </param>
        /// <param name="customerName">customerName </param>
        /// <returns>workspace id</returns>
        public String createWorkspace(String contactDatabaseId, String customerName)
        {
            if (logger.IsDebugEnabled)
            {
                logger.Debug("createWorkspace:contactDatabaseID=" + contactDatabaseId + ",customerName=" + customerName);
            }

            Workspace[] allWorkSpace = this.getWorkspaceByDatabaseId(contactDatabaseId);
            if (allWorkSpace != null)
            {
                foreach (Workspace workspace in allWorkSpace)
                {
                    if (!String.IsNullOrEmpty(customerName) && workspace.label.Equals(customerName))
                    {
                        return workspace.id;
                    }
                }
            }

            String result;

            cn.tripolis.dialogue.workspace.CreateWorkspaceRequest request = new CreateWorkspaceRequest();
            try
            {
                request.label = customerName;
                request.name = customerName;
                request.contactDatabaseId = contactDatabaseId;
                cn.tripolis.dialogue.workspace.IDResponse response = workspaceService.create(request);
                result = response.id;

            }
            catch (System.Web.Services.Protocols.SoapException ex)
            {
                if (logger.IsDebugEnabled)
                {
                    logger.Debug("error happens in creating contact database, error is" + ex.Detail.InnerXml);
                }
                throw new Exception(ex.Detail.InnerXml);
            }
            return result;

        }
示例#3
0
 /// <remarks/>
 public void createAsync(CreateWorkspaceRequest createRequest) {
     this.createAsync(createRequest, null);
 }