示例#1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        //[STAThread]
        public static void Main(string[] args)
        {
            if (args == null || args.Length < 2)
            {
                Console.WriteLine(
                    "Usage : SimpleClient <webserviceurl> <username> <password>"
                    );
            }

            cb = AppUtil.AppUtil.initialize("SimpleClient", args);
            SimpleClient sc = new SimpleClient();

            try {
                // Connect to the Service
                cb.connect();
                // Create the Service Managed Object Reference
                sc.CreateServiceRef("SimpleClient", args);
                // Retrieve Container contents for all Managed Entities and their names
                sc.GetContainerContents();
                // Disconnect from the WebServcice
                cb.disConnect();
                Console.WriteLine("Press enter to exit ");
                Console.Read();
            } catch (SoapException se) {
                Console.WriteLine("Caught SoapException - " +
                                  " Actor : " + se.Actor +
                                  " Code : " + se.Code +
                                  " Detail XML : " + se.Detail.OuterXml);
                Console.Read();
            } catch (Exception e) {
                Console.WriteLine("Caught Exception : " +
                                  " Name : " + e.GetType().Name +
                                  " Message : " + e.Message +
                                  " Trace : " + e.StackTrace);
                Console.Read();
            }
        }
示例#2
0
      /// <summary>
      /// The main entry point for the application.
      /// </summary>
      //[STAThread]
      public static void Main(string[] args){
         if (args == null || args.Length < 2) 
         {
            Console.WriteLine(
               "Usage : SimpleClient <webserviceurl> <username> <password>"
               );
         }

         cb = AppUtil.AppUtil.initialize("SimpleClient", args);
         SimpleClient sc = new SimpleClient();
         
         try {
            // Connect to the Service
            cb.connect();
            // Create the Service Managed Object Reference
            sc.CreateServiceRef("SimpleClient", args);
            // Retrieve Container contents for all Managed Entities and their names
            sc.GetContainerContents();
            // Disconnect from the WebServcice
            cb.disConnect();
            Console.WriteLine("Press enter to exit ");
            Console.Read();

         } catch (SoapException se) {
            Console.WriteLine("Caught SoapException - " + 
                              " Actor : " + se.Actor + 
                              " Code : " + se.Code + 
                              " Detail XML : " + se.Detail.OuterXml);
            Console.Read();
         } catch (Exception e) {
            Console.WriteLine("Caught Exception : " + 
                              " Name : " + e.GetType().Name +
                              " Message : " + e.Message +
                              " Trace : " + e.StackTrace);
            Console.Read();
         }
      }