private static int DoSetAssociated(IntPtr aPtr, IntPtr aInvocation)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvProviderLinnCoUkCloud1 self       = (DvProviderLinnCoUkCloud1)gch.Target;
            DvInvocation             invocation = new DvInvocation(aInvocation);

            byte[] aesKeyRsaEncrypted;
            byte[] initVectorRsaEncrypted;
            byte[] tokenAesEncrypted;
            bool   associated;

            try
            {
                invocation.ReadStart();
                aesKeyRsaEncrypted     = invocation.ReadBinary("AesKeyRsaEncrypted");
                initVectorRsaEncrypted = invocation.ReadBinary("InitVectorRsaEncrypted");
                tokenAesEncrypted      = invocation.ReadBinary("TokenAesEncrypted");
                associated             = invocation.ReadBool("Associated");
                invocation.ReadEnd();
                self.SetAssociated(invocation, aesKeyRsaEncrypted, initVectorRsaEncrypted, tokenAesEncrypted, associated);
            }
            catch (ActionError e)
            {
                invocation.ReportActionError(e, "SetAssociated");
                return(-1);
            }
            catch (PropertyUpdateError)
            {
                invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "SetAssociated" }));
                return(-1);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "SetAssociated" });
                System.Diagnostics.Debug.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)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "SetAssociated" });
                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}", new object[] { "Set" }));
                return(-1);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Set" });
                System.Diagnostics.Debug.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)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Set" });
                System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
            }
            return(0);
        }
        private static int DoWrite(IntPtr aPtr, IntPtr aInvocation)
        {
            GCHandle gch = GCHandle.FromIntPtr(aPtr);
            DvProviderLinnCoUkFlash1 self       = (DvProviderLinnCoUkFlash1)gch.Target;
            DvInvocation             invocation = new DvInvocation(aInvocation);
            uint aId;
            uint aAddress;

            byte[] aSource;
            try
            {
                invocation.ReadStart();
                aId      = invocation.ReadUint("aId");
                aAddress = invocation.ReadUint("aAddress");
                aSource  = invocation.ReadBinary("aSource");
                invocation.ReadEnd();
                self.Write(invocation, aId, aAddress, aSource);
            }
            catch (ActionError e)
            {
                invocation.ReportActionError(e, "Write");
                return(-1);
            }
            catch (PropertyUpdateError)
            {
                invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "Write" }));
                return(-1);
            }
            catch (Exception e)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Write" });
                System.Diagnostics.Debug.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)
            {
                System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "Write" });
                System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
            }
            return(0);
        }
Пример #4
0
 private static int DoSetBinary(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     byte[] valueBin;
     try
     {
         invocation.ReadStart();
         valueBin = invocation.ReadBinary("ValueBin");
         invocation.ReadEnd();
         self.SetBinary(invocation, valueBin);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "SetBinary");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", new object[] { "SetBinary" }));
         return -1;
     }
     catch (Exception e)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "SetBinary" });
         System.Diagnostics.Debug.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)
     {
         System.Diagnostics.Debug.WriteLine("WARNING: unexpected exception {0} thrown by {1}", new object[] { e, "SetBinary" });
         System.Diagnostics.Debug.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
Пример #5
0
 private static int DoSetBinary(IntPtr aPtr, IntPtr aInvocation)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     byte[] valueBin;
     try
     {
         invocation.ReadStart();
         valueBin = invocation.ReadBinary("ValueBin");
         invocation.ReadEnd();
         self.SetBinary(invocation, valueBin);
     }
     catch (ActionError e)
     {
         invocation.ReportActionError(e, "SetBinary");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, String.Format("Invalid value for property {0}", "SetBinary"));
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2} in {3}", e.GetType(), e.Message, "SetBinary", 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, "SetBinary", e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
     }
     return 0;
 }
Пример #6
0
 private static int DoEchoBinary(IntPtr aPtr, IntPtr aInvocation, uint aVersion)
 {
     GCHandle gch = GCHandle.FromIntPtr(aPtr);
     DvProviderOpenhomeOrgTestBasic1 self = (DvProviderOpenhomeOrgTestBasic1)gch.Target;
     DvInvocation invocation = new DvInvocation(aInvocation);
     byte[] value;
     byte[] result;
     try
     {
         invocation.ReadStart();
         value = invocation.ReadBinary("Value");
         invocation.ReadEnd();
         self.EchoBinary(aVersion, value, out result);
     }
     catch (ActionError)
     {
         invocation.ReportError(501, "Invalid XML");
         return -1;
     }
     catch (PropertyUpdateError)
     {
         invocation.ReportError(501, "Invalid XML");
         return -1;
     }
     catch (Exception e)
     {
         Console.WriteLine("WARNING: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
         Console.WriteLine("         Only ActionError or PropertyUpdateError can be thrown by actions");
         return -1;
     }
     try
     {
         invocation.WriteStart();
         invocation.WriteBinary("Result", result);
         invocation.WriteEnd();
     }
     catch (ActionError)
     {
         return -1;
     }
     catch (System.Exception e)
     {
         Console.WriteLine("ERROR: unexpected exception {0}(\"{1}\") thrown by {2}", e.GetType(), e.Message, e.TargetSite.Name);
         Console.WriteLine("       Only ActionError can be thrown by action response writer");
         System.Diagnostics.Process.GetCurrentProcess().Kill();
     }
     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;
 }