0

I am getting following UniSubroutineException on following line of code while executing the Call() of UniSubroutine.

try
        {
            if ((txtEmail.Text != "") && (txtPass.Text != ""))
            {
                if (txtPass.Text == txtPass2.Text)
                {

                    Connection CONN = new Connection();
                    UniSession us = UniObjects.OpenSession(CONN.IP(), CONN.UNAME(), CONN.PASS(), CONN.ACCT());
                    UniFile PRACTICES = us.CreateUniFile("PRACTICES");
                    UniFile BCPARAMS = us.CreateUniFile("BC.PARAMS");
                    string OPRICE = BCPARAMS.ReadField("OPTIONS", 2).ToString();
                    if (OPRICE == "")
                    {
                        OPRICE = "19900";
                    }
                    UniSubroutine CHECKNEWEMAIL = us.CreateUniSubroutine("CHECK.NEW.EMAIL", 2);
                    CHECKNEWEMAIL.SetArg(0, txtEmail.Text);
                    CHECKNEWEMAIL.Call();
                    string ERSP = CHECKNEWEMAIL.GetArg(1).ToString();
                    if (ERSP == "")
                    {

                        UniDynArray IN = new UniDynArray(us);
                        IN.Replace(2, txtBName.Text);
                        IN.Replace(3, txtBAddr.Text);
                        IN.Replace(4, txtCity.Text);
                        if (ddCountry.SelectedValue == "US")
                        {
                            IN.Replace(6, txtZip.Text);
                        }
                        if (ddCountry.SelectedValue == "AU")
                        {
                            IN.Replace(5, txtState.Text);
                        }
                        IN.Replace(8, txtName.Text);
                        IN.Replace(9, txtEmail.Text.Replace(" ", ""));
                        IN.Replace(10, txtPass.Text);
                        IN.Replace(11, txtEmail.Text);
                        IN.Replace(12, "");
                        IN.Replace(20, "M");
                        IN.Replace(70, "NOT VERIFIED");
                        IN.Replace(86, "");
                        try
                        {
                            IN.Replace(25, ddHear.SelectedValue);
                        }
                        catch
                        {
                            IN.Replace(25, "");
                        }
                        IN.Replace(53, us.Iconv(DateTime.Now.AddDays(30).ToShortDateString(), "D2/"));
                        IN.Replace(54, OPRICE);
                        if (txtGroupNum.Text != "")
                        {
                            UniSubroutine GIDTOPID = us.CreateUniSubroutine("GID.TO.PID", 3);
                            GIDTOPID.SetArg(0, txtGroupNum.Text);
                            GIDTOPID.Call();
                            string PID = GIDTOPID.GetArg(1).ToString();
                            string PRICE = GIDTOPID.GetArg(2).ToString();
                            IN.Replace(86, PID);
                            IN.Replace(54, PRICE);
                        }
                        IN.Replace(90, ViewState["AFID"].ToString());
                        IN.Replace(115, ddCountry.SelectedValue);
                        IN.Replace(120, ViewState["CURR"].ToString());
                        string MVIN = IN.ToString();

                        UniSubroutine NEWUSER = us.CreateUniSubroutine("NEW.USER.V2", 3);
                        NEWUSER.SetArg(0, MVIN);
                        NEWUSER.Call();

                        string UID = NEWUSER.GetArg(1).ToString();

                        string SEC = Security.CreateSecurity(DateTime.Now.AddHours(8), UID);
                        Response.Redirect("Verify.aspx?SEC=" + SEC);
                    }
                    else
                    {
                        UniObjects.CloseSession(us);
                        lblMSGBox.Text = "Invalid Email Address";
                        RadNotification1.Show();
                    }
                }
                else
                {
                    lblMSGBox.Text = "Passwords do not match";
                    RadNotification1.Show();
                }
            }
            else
            {
                lblMSGBox.Text = "Email and Password are required";
                RadNotification1.Show();
            }
        }
        catch (Exception ex)
        {
        }
    }

Error: An exception of type 'IBMU2.UODOTNET.UniSubroutineException' occurred in UODOTNET.dll but was not handled in user code

Additional information: [Rocket U2][UODOTNET - UNICLIENT][ErrorCode=30107] The subroutine failed to complete successfully

Please suggest me how can I fix this issue.

  • Have you tried adding an exception handler to your code (to catch all possible exceptions that may be thrown by the APIs being used - UniException ) ? – mao Jul 04 '18 at 13:57
  • Yes, getting the same error. Do you need any specific detail from me to catch the issue? – Vaibhav Vanawala Jul 04 '18 at 14:25
  • EDIT your question to Show your code that throws the exception, including the try/catch block . Also consider adding tags for u2, u2netdk, rocket-u2 , and whatever your programming-language is. – mao Jul 04 '18 at 14:36
  • I have updated the details. Please have a look on it. – Vaibhav Vanawala Jul 04 '18 at 14:49
  • Suggest you widen the scope of the try/catch block , because you are calling at least 1 subroutine CreateUniSubroutine that may be throwing an exception and it won't be caught. Same for other methods being invoked in the constructor. – mao Jul 04 '18 at 15:11
  • I have added the try block into the complete code but the system is throwing the exception from code "NEWUSER.Call();" – Vaibhav Vanawala Jul 04 '18 at 16:06
  • You have not updated the question to show your revised code. Time to debug your code . You do not have a Db2 problem. Most likely you have a coding error. – mao Jul 04 '18 at 18:46
  • Hi Mao, I have updated the question with the complete code. I am getting this error form code NEWUSER.Call(); Please take a look at it. – Vaibhav Vanawala Jul 05 '18 at 13:59
  • Are you sure the exception is the same as the one in your question (if your catch block is empty...). Have you enabled tracing in the config file to look deeper? – mao Jul 05 '18 at 15:09
  • Yes, the exception is same and happing from the same line of place. I am running the application in the debug mode. – Vaibhav Vanawala Jul 05 '18 at 17:20
  • Enable tracing for the U2 component(s) and look deeper. You should also EDIT your question to *specify* exactly what versions of each software involved (the operating-system, the .net framework, the U2/rocket software components, the Visual-Studio/programming-language versions etc. – mao Jul 05 '18 at 17:27
  • Can you verify that the Subroutine (NEW.USER.V2) runs on the backend (in Universe or Unidata) when provided the same parameters in the account you have in your context? It looks like the problem is there. – Van Amburg Jul 05 '18 at 20:18
  • I got the issue. It was from the DB end the an migrated file in the Database was corrupted and not able to detect by the SUBROUTINE. I have removed that file and added a clone of it. This solves my problem. Thank you guys for your help. – Vaibhav Vanawala Jul 06 '18 at 14:20

1 Answers1

0

The additional information supplied is the clue

[Rocket U2][UODOTNET - UNICLIENT][ErrorCode=30107] The subroutine failed to complete successfully

This indicates that the subroutine you called failed to return: Either the subroutine encountered a STOP, or it's execution aborted.
The end result is that UniRPC connection did not get a graceful response to the subroutine call and threw an error for you to investigate.