Tuesday, November 26, 2013

Sun Java System web server

Working With Administration Server

The Administration Server is a web-based server that contains the Java forms you use to configure all of your Sun Java System Web Servers.
After installing Sun Java System Web Server, you use your browser to navigate to the Administration Server page (Administration Console) and use its forms to configure your Sun Java System Web Servers. When you submit the forms, the Administration Server modifies the configuration for the server you were administering.
The URL you use to navigate to the Administration Server page depends on the computer host name and the port number you choose for the Administration Server when you install Sun Java System Web Server. For example, if you installed the Administration Server on port 1234, the URL will look like this:
http://myserver.sun.com:1234/


Before you can get to any forms, the Administration Server prompts you to authenticate yourself. This means you need to type a user name and password. You set up the "superuser" user name and password when you install Sun Java System Web Server on your computer. The following figure shows a typical authentication screen:

The settings for the Administration Server appear in the top pane, organized by a set of tabs.
The first page you see when you access the Administration Server, is the common tasks page. You use the buttons on this page to manage, add, remove, and migrate your Sun Java System Web Servers. The common tasks page is highlighted in the following figure:

The Administration Server provides the following tabs for your administration-level tasks:
  • Configuration
  • Nodes
  • Server Certificates
  • Monitoring
  • Administration Server


Note - Clicking on any of these tabs may result child tabs appearing on the page. The actions provided by the child tabs are specific to the parent tab functionality.
The following figure shows the child tabs for a selected tab. Note that the parent and child tab labels change based on the action context.



The top panel of the Administration Console provides information on pending actions related to web application deployments and other configured alerts. Clicking on the tab opens pages in the same window. There are certain tasks that involves gathering data from the user in series of steps. The Administration Console has wizard interface for such tasks. These wizards always open up in a new window. The following figure shows a wizard page for creating a new configuration:

Help on GUI Components

All form elements and GUI components have a detailed inline help providing information on the validation and optional parameters. For wizard interface, at any step in the wizard, click the help tab to read the documentation specific to the current task.

Starting the Administration Server in UNIX/Linux

To start the Administration Server perform the following tasks:
Starting the Administration Server in UNIX/Linux
  1. Go to the install_root/admin-server/bin directory (for example, /usr/sjsws7.0/admin-server/bin)
  2. Type ./startserv.
    This command starts the Administration Server using the port number you specified during installation.

Starting the Administration Server in Windows

The Sun Java System Web Server installation program creates a program group with several icons for Windows platforms. The program group includes the following icons:
  • Release Notes
  • Start Administration Server
  • Uninstall Web Server
Note that the Administration Server runs as a services applet; thus, you can also use the Control Panel to start this service directly.
To access the Administration Server on Windows platforms, perform the following steps:
To Access the Administration Server on Windows Platform
  1. For accessing the administration server through the SSL port, type the following URL in your browser:
    https://hostname.domain-name:ssl_administration_port
    Sun Java System Web Server then displays a window prompting you for a user name and password.
  2. Type the administration user name and password you specified during installation.
    Sun Java System Web Server displays the Administration Server page.
    For more information, refer the Administration Console online help.
    You can also access the Administration Server from a remote location. Since the Administrator Server is accessed through a browser, you can access it from any machine that can reach the server over the network.

Wednesday, November 20, 2013

How to generate GUID in LoadRunner


Compatibility:  Java (all version), SOAP UI, LoadRunner/VuGen (all version)

Today I came across a SOAP request that uses a java function (java.util.UUID.randomUUID()) to generate random number. In very high level, this java function generate strong pseudo random number using randomUUID() function from java util library. Here is the part of the SOAP request with Java function:

${=java.util.UUID.randomUUID()}
ABC


If I need to generate this random number using Java, that is easy. Here is 
the example:

import java.util.*;

public class UUIDGenerator {
    public static void main(String[] args) {
        // creating UUID
        UUID uid = UUID.fromString("12300000-afcd-11bd-b23e-10b96e4ef00d");
        // checking the value of random UUID
        System.out.println("Randomly generated UUID value: "+uid.randomUUID());
    }
}

Output would be:

Randomly generated UUID value: 69b9c547-2278-45d0-a632-b627e30119aa

But the problem was to convert this solution to LoadRunner. Thanks to Scotte 
Moore for coming up with the creative solution. Here are the steps:
•    Create a test using the protocols that generate C scripts.
•    Download the “ole32.dll” file from online (If you google it, you should be able to find it)
•    Save that “ole32.dll” file into the test folder so that lr_load_dll() function can load this dll
•    Finally, you can either create seperate functions to generate GUID/randomUUID or can enabled in the action that will use it.

Action() {
    lr_guid_gen();
    return 0;
}

int lr_guid_gen(){
    typedef struct _GUID{
        unsigned long Data1;
        unsigned short Data2;
        unsigned short Data3;
        unsigned char Data4[8];
    } 
    GUID;
    GUID m_guid;
    char buf[50];
    char bufx[50];
    lr_load_dll ("ole32.dll");
    CoCreateGuid(&m_guid);

    sprintf (buf, "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
    m_guid.Data1, m_guid.Data2, m_guid.Data3,
    m_guid.Data4[0], m_guid.Data4[1], m_guid.Data4[2], m_guid.Data4[3],
    m_guid.Data4[4], m_guid.Data4[5], m_guid.Data4[6], m_guid.Data4[7]);

    lr_save_string(buf, "lrGUID");
    lr_output_message(lr_eval_string(buf));
    return 0;
}
Output would be similar to following:

Action.c(54): {1FC2EFD0-3887-45D7-9432-5682802E6D82}