Exemplo n.º 1
0
        public void OnRfcServerError(Object server, RfcServerErrorEventArgs errorEventData)
        {
            RfcServer rfcServer = server as RfcServer;
            RfcServerApplicationException appEx = errorEventData.Error as RfcServerApplicationException;

            if (appEx != null)
            {
                Console.WriteLine("RfcServerApplicationError occured in RFC server {0} :", rfcServer.Name);
            }
            else
            {
                Console.WriteLine("RfcServerError occured in RFC server {0} :", rfcServer.Name);
            }


            if (errorEventData.ServerContextInfo != null)
            {
                Console.WriteLine("RFC Caller System ID: {0} ", errorEventData.ServerContextInfo.SystemAttributes.SystemID);
                Console.WriteLine("RFC function Name: {0} ", errorEventData.ServerContextInfo.FunctionName);
            }

            Console.WriteLine("Error type: {0}", errorEventData.Error.GetType().Name);
            Console.WriteLine("Error message: {0}", errorEventData.Error.Message);

            if (appEx != null)
            {
                Console.WriteLine("Inner exception type: {0}", appEx.InnerException.GetType().Name);
                Console.WriteLine("Inner exception message: {0}", appEx.InnerException.Message);
            }
        }
Exemplo n.º 2
0
        //
        // This method is used as the event handler for internal server errors. Internal server errors are errors
        // that are not caused by the application, but are incurred by NCO3. Such errors include, but are not limited to,
        // communication errors (e.g., loss of connections), out of memory, etc.
        //
        private static void OnRfcServerError(Object server, RfcServerErrorEventArgs errorEventData)
        {
            RfcServer rfcServer = server as RfcServer;

            Console.WriteLine();
            Console.WriteLine(">>>>> RfcServerError occurred in RFC server {0}:", rfcServer.Name);
            ShowErrorEventData(errorEventData);
        }
Exemplo n.º 3
0
 private static void ShowErrorEventData(RfcServerErrorEventArgs errorEventData)
 {
     if (errorEventData.ServerContextInfo != null)
     {
         Console.WriteLine("RFC Caller System ID: {0} ", errorEventData.ServerContextInfo.SystemAttributes.SystemID);
         Console.WriteLine("RFC function Name: {0} ", errorEventData.ServerContextInfo.FunctionName);
     }
     Console.WriteLine("Error type: {0}", errorEventData.Error.GetType().Name);
     Console.WriteLine("Error message: {0}", errorEventData.Error.Message);
 }
Exemplo n.º 4
0
        //
        // This method is used as the event handler for application errors raised while a server processes a requested function.
        // As opposed to internal errors these errors occur in application coding outside NCO3. Note that the application can throw
        // whichever type of exception it sees fit. It will be wrapped in a RfcServerApplicationException and made available as its
        // inner exception.
        //
        private static void OnRfcServerApplicationError(Object server, RfcServerErrorEventArgs errorEventData)
        {
            RfcServer rfcServer = server as RfcServer;

            Console.WriteLine();
            Console.WriteLine(">>>>> RfcServerApplicationError occurred in RFC server {0}:", rfcServer.Name);
            ShowErrorEventData(errorEventData);
            RfcServerApplicationException appEx = errorEventData.Error as RfcServerApplicationException;

            if (appEx != null)
            {
                Console.WriteLine("Inner exception type: {0}", appEx.InnerException.GetType().Name);
                Console.WriteLine("Inner exception message: {0}", appEx.InnerException.Message);
            }
            else
            {
                Console.WriteLine("WARNING: errorEventData.Error is not an instance of RfcServerApplicationError");
            }
        }
Exemplo n.º 5
0
 private static void OnRfcServerError(Object server, RfcServerErrorEventArgs errorEventData)
 {
     RfcServer rfcServer = server as RfcServer;
     Console.WriteLine();
     Console.WriteLine(">>>>> RfcServerError occurred in RFC server {0}:", rfcServer.Name);
     Console.WriteLine(errorEventData.Error);
     //  ShowErrorEventData(errorEventData);
 }
Exemplo n.º 6
0
 private static void OnRfcServerApplicationError(Object server, RfcServerErrorEventArgs errorEventData)
 {
     RfcServer rfcServer = server as RfcServer;
     Console.WriteLine();
     Console.WriteLine(">>>>> RfcServerApplicationError occurred in RFC server {0}:", rfcServer.Name);
     Console.WriteLine(errorEventData.Error);
     // ShowErrorEventData(errorEventData);
     RfcServerApplicationException appEx = errorEventData.Error as RfcServerApplicationException;
     if (appEx != null)
     {
         Console.WriteLine("Inner exception type: {0}", appEx.InnerException.GetType().Name);
         Console.WriteLine("Inner exception message: {0}", appEx.InnerException.Message);
     }
     else
     {
         Console.WriteLine("WARNING: errorEventData.Error is not an instance of RfcServerApplicationError");
     }
 }