+ Reply to Thread
Results 1 to 1 of 1

Thread: Build and run .NET Symphony/WSDL admin web services sample

  1. #1
    Young's Avatar
    Young is offline Junior Member
    Join Date
    March 5th, 2008
    Location
    Toronto, Canada
    Posts
    58
    Blog Entries
    1
    Downloads
    7
    Uploads
    0

    Default Build and run .NET Symphony/WSDL admin web services sample

    Symphony's WSDL interface can be used to create a web service-based management utility for your applications on a Symphony DE grid [1]. The attached Symphony WSDL sample is a simple C# administration web service client that can disable an enabled application.

    Here are the step-by-step instructions to run the sample client.
    (Before you proceed, note that you must have Visual Studio .NET 2003 or 2005.)

    1. Generate Symphony WSDL admin web services code
    • Open soamAdmin.sln with Visual Studio.
    • Right click on soamAdmin on Solution Explorer and build the project as shown below.
    • Make sure the soam.url points to the correct address of the host where the Session Director (SD) is running. The port number following the URL address shown below is specified in the %SOAM_HOME%\5.0\conf\vem_resource.conf.

    Code:
    namespace soamAdmin
    {    
        /// <summary>
        /// This is SymphonyDE/WSDL sample for administrative web service that
        /// disables any applications with status of "enabled".
        /// </summary>
        class MgrClient
        {        
            [STAThread]
            static void Main(string[] args)
            {
                Soam soam = new Soam();
                soam.Url = "http://[URL of your local machine]:[SD port number]";
                byte[] appProfile = {0};
         ....
         ....
    
    • As a result, Soam.cs, the admin web service API, will be automatically generated from Soam.wsdl file whose full path is specified on the Pre-Build Event command line as shown below.


    2. The console application, adminSoam.exe is created at the root of this sample package. Just run it from the command line. The following snippet of code from MgrClient.cs, using the generated admin web services API, will disable any applications with status of "enabled".

    Code:
    AppAttribute[] enabledApps;
                    AppAttribute[] disabledApps;
                    
                    // Look for any enabled applications                                            
                    enabledApps = soam.sdViewApp("", "", "enabled", false);
                    if (enabledApps != null)
                    {
                        foreach (AppAttribute app in enabledApps)
                        {
                            // Disable application, but persist the outstanding workload.
                            soam.sdDisableApp(app.appName, true); 
                            Console.WriteLine("Disabled {0}", app.appName);
                        }
                    }
    
    Reference:

    You can extend the attached sample to implement more admin tools as follows;
    • List all the applications registered with Symphony
    • List all the sessions associated with a specific application
    • Change the priority of all the sessions with the specified tag
    • Handle session director failover

    You can find more detail in [1].



    [1] Developing Web Service Clients
    [2] Application Development Guide
    Attached Files
    Last edited by vbseo; November 19th, 2009 at 03:07 AM.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts