public Utility(ClarifySessionWS session)
 {
     this.session = session;
     supportWS = new SupportToolkitWS(session);
     interfacesWS = new InterfacesToolkitWS(session);
 }
        private void CreateNewCase()
        {
            this.EnsureChildControls();

            try
            {
                EnableValidators();
                Page.Validate();

                if( Page.IsValid )
                {
                    // Create new Support Toolkit web service client
                    SupportToolkitWS supportWS = new SupportToolkitWS( Global.ClarifySessWS );

                    // Create setup object for creating a case
                    CreateCaseSetupWS setup = new CreateCaseSetupWS(
                        siteID.Text, firstName.Text, lastName.Text, phoneNumber.Text );

                    // Set additional information
                    setup.CaseType = caseType.SelectedValue;
                    setup.PhoneLogNotes = phoneLog.Text;
                    setup.Title = title.Text;

                    // Invoke web service to create case
                    ToolkitResultProtocol result = supportWS.CreateCase( setup );

                    // Show result ID
                    this.messageLabel.Text = String.Format("<b>Case {0} created successfully.</b>", result.IDNum);

                    ClearEntryFields();

                    // Fire event to let the Page know that the DataGrid need to be rebinded so that our new case will appear there.
                    this.OnCaseCreated(EventArgs.Empty);
                }
            }
            catch(SoapException ex)
            {
                string message = ex.Detail.InnerText.Trim().Length > 0 ? ex.Detail.InnerText.Trim() : ex.Message;
                this.messageLabel.Text += String.Format("<b>Error adding case.</b><br/>{0}", message.Replace("\n","<br/>") );
            }
        }