private static int DoGet(IntPtr aPtr, IntPtr aInvocation)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvProviderAvOpenhomeOrgCredentials1 self = (DvProviderAvOpenhomeOrgCredentials1)gch.Target;
            DvInvocation invocation = new DvInvocation(aInvocation);
            string       id;
            string       userName;

            byte[] password;
            bool   enabled;
            string status;
            string data;

            try
            {
                invocation.ReadStart();
                id = invocation.ReadString("Id");
                invocation.ReadEnd();
                self.Get(invocation, id, out userName, out password, out enabled, out status, out data);
            }
            catch (ActionError e)
            {
                invocation.ReportActionError(e, "Get");
                return(-1);
            }
            catch (PropertyUpdateError)
            {
                invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Get" }));
                return(-1);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Get" });
                System.Diagnostics.Debug.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
                return(-1);
            }
            try
            {
                invocation.WriteStart();
                invocation.WriteString("UserName", userName);
                invocation.WriteBinary("Password", password);
                invocation.WriteBool("Enabled", enabled);
                invocation.WriteString("Status", status);
                invocation.WriteString("Data", data);
                invocation.WriteEnd();
            }
            catch (ActionError)
            {
                return(-1);
            }
            catch (System.Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Get" });
                System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
            }
            return(0);
        }
        private static int DoReLogin(IntPtr aPtr, IntPtr aInvocation)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvProviderAvOpenhomeOrgCredentials1 self = (DvProviderAvOpenhomeOrgCredentials1)gch.Target;
            DvInvocation invocation = new DvInvocation(aInvocation);
            string       id;
            string       currentToken;
            string       newToken;

            try
            {
                invocation.ReadStart();
                id           = invocation.ReadString("Id");
                currentToken = invocation.ReadString("CurrentToken");
                invocation.ReadEnd();
                self.ReLogin(invocation, id, currentToken, out newToken);
            }
            catch (ActionError e)
            {
                invocation.ReportActionError(e, "ReLogin");
                return(-1);
            }
            catch (PropertyUpdateError)
            {
                invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "ReLogin" }));
                return(-1);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "ReLogin" });
                System.Diagnostics.Debug.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
                return(-1);
            }
            try
            {
                invocation.WriteStart();
                invocation.WriteString("NewToken", newToken);
                invocation.WriteEnd();
            }
            catch (ActionError)
            {
                return(-1);
            }
            catch (System.Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "ReLogin" });
                System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
            }
            return(0);
        }
        private static int DoSet(IntPtr aPtr, IntPtr aInvocation)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvProviderAvOpenhomeOrgCredentials1 self = (DvProviderAvOpenhomeOrgCredentials1)gch.Target;
            DvInvocation invocation = new DvInvocation(aInvocation);
            string       id;
            string       userName;

            byte[] password;
            try
            {
                invocation.ReadStart();
                id       = invocation.ReadString("Id");
                userName = invocation.ReadString("UserName");
                password = invocation.ReadBinary("Password");
                invocation.ReadEnd();
                self.Set(invocation, id, userName, password);
            }
            catch (ActionError e)
            {
                invocation.ReportActionError(e, "Set");
                return(-1);
            }
            catch (PropertyUpdateError)
            {
                invocation.ReportError(501, String.Format("Invalid value for property {0}", "Set"));
                return(-1);
            }
            catch (Exception e)
            {
                Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "Set", e.TargetSite.Name);
                Console.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
                return(-1);
            }
            try
            {
                invocation.WriteStart();
                invocation.WriteEnd();
            }
            catch (ActionError)
            {
                return(-1);
            }
            catch (System.Exception e)
            {
                Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "Set", e.TargetSite.Name);
                Console.WriteLine("       Only ActionError can be thrown by action response writer");
            }
            return(0);
        }
        private static int DoGetSequenceNumber(IntPtr aPtr, IntPtr aInvocation)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvProviderAvOpenhomeOrgCredentials1 self = (DvProviderAvOpenhomeOrgCredentials1)gch.Target;
            DvInvocation invocation = new DvInvocation(aInvocation);
            uint         sequenceNumber;

            try
            {
                invocation.ReadStart();
                invocation.ReadEnd();
                self.GetSequenceNumber(invocation, out sequenceNumber);
            }
            catch (ActionError e)
            {
                invocation.ReportActionError(e, "GetSequenceNumber");
                return(-1);
            }
            catch (PropertyUpdateError)
            {
                invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "GetSequenceNumber" }));
                return(-1);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetSequenceNumber" });
                System.Diagnostics.Debug.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
                return(-1);
            }
            try
            {
                invocation.WriteStart();
                invocation.WriteUint("SequenceNumber", sequenceNumber);
                invocation.WriteEnd();
            }
            catch (ActionError)
            {
                return(-1);
            }
            catch (System.Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "GetSequenceNumber" });
                System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
            }
            return(0);
        }
        private static int DoGetSequenceNumber(IntPtr aPtr, IntPtr aInvocation)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvProviderAvOpenhomeOrgCredentials1 self = (DvProviderAvOpenhomeOrgCredentials1)gch.Target;
            DvInvocation invocation = new DvInvocation(aInvocation);
            uint         sequenceNumber;

            try
            {
                invocation.ReadStart();
                invocation.ReadEnd();
                self.GetSequenceNumber(invocation, out sequenceNumber);
            }
            catch (ActionError e)
            {
                invocation.ReportActionError(e, "GetSequenceNumber");
                return(-1);
            }
            catch (PropertyUpdateError)
            {
                invocation.ReportError(501, String.Format("Invalid value for property {0}", "GetSequenceNumber"));
                return(-1);
            }
            catch (Exception e)
            {
                Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "GetSequenceNumber", e.TargetSite.Name);
                Console.WriteLine("         Only ActionError or PropertyUpdateError should be thrown by actions");
                return(-1);
            }
            try
            {
                invocation.WriteStart();
                invocation.WriteUint("SequenceNumber", sequenceNumber);
                invocation.WriteEnd();
            }
            catch (ActionError)
            {
                return(-1);
            }
            catch (System.Exception e)
            {
                Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "GetSequenceNumber", e.TargetSite.Name);
                Console.WriteLine("       Only ActionError can be thrown by action response writer");
            }
            return(0);
        }