ECL Webservice Metastorm BPM v9

Hi everyone!

 

Anyone who has any documentation orSkype downloadsample code about how to use the ECL Webservice in version 9.  I need to be able to start and submit a blank form action with c# code.

 

 

Appreciate any help,

Tagged:

Comments

  • In the SDK v9 you will find samples and documentation how to use the ECL Thilo

  • try
                {
    
                    ServiceSessionState eclServiceSession = new ServiceSessionState();
                    ServiceClient eclWS = new ServiceClient();
    
                    FormField[] loginData = new FormField[] { 
                    new TextField() { Name = "username", Value = "SysAdmin", Culture = CultureInfo.InvariantCulture.ToString() }, 
                    new TextField() { Name = "password", Value = Common.PasswordEncrypt(""), Culture = CultureInfo.InvariantCulture.ToString() }
                };
    
                    eclServiceSession = eclWS.Login("WEB;", 0, "", loginData);
    
                    if (eclWS.IsLoggedIn(eclServiceSession))
                    {
    
                        //Must increase the maxStringContentLength from default in app.config to accomodate even the most meager response
                        ActionResponse response = eclWS.StartAction(eclServiceSession, "", "RefreshEditGridProc", "FirstAction", false, null);
    
                        (response.Action.Fields[0] as TextField).Value = "Tony";
                        (response.Action.Fields[1] as TextField).Value = "11111 BPM Ave.";
                        (response.Action.Fields[2] as TextField).Value = "Tampa";
                        (response.Action.Fields[3] as TextField).Value = "813-BPM-5555";
    
                        ActionResponse submitResponse = eclWS.SubmitAction(eclServiceSession, response.Action.FolderID, "FirstAction", "Form1", response.Action.ServerData, response.Action.Fields);
                        MessageBox.Show(submitResponse.ResponseType.ToString());
                    }
                    else
                    {
                        MessageBox.Show("Cannot log you in.");
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
    

     More demo code is in the SDK, but this demonstrates a very basic log in, starting of a blank form, filling the formfields with data and submitting the action with that data. Please note the password used must be MD5 hashed like this:

     

    public static string PasswordEncrypt(string passwordInput)
            {
                string result = passwordInput;
                MD5 md5 = new MD5CryptoServiceProvider();
                byte[] byteArray = new byte[passwordInput.Length];
    
                for (int i = 0; i < passwordInput.Length; i++)
                {
                    byteArray[i] = (byte)passwordInput[i];
                }
    
                byte[] digest = md5.ComputeHash(byteArray);
                StringBuilder hexString = new StringBuilder();
    
                for (int i = 0; i < digest.Length; i++)
                {
                    int val = 0xFF & digest[i];
                    String hex = val.ToString("x", CultureInfo.InvariantCulture);
    
                    if (hex.Length == 1)
                    {
                        hexString.Append("0" + hex);
                    }
                    else
                    {
                        hexString.Append(hex);
                    }
                }
    
                return hexString.ToString().ToUpper(CultureInfo.InvariantCulture);
    
            }