1.2 Installing the Reference Client

WSAPI includes a fully operational reference client implementation named Web Services Client (MosWsClient). This reference client includes an interactive mode that allows you to invoke any of the services through a command line interface. For more information, see Section 4.0, Web Services Client Operation.

MosWsClient is not distributed with Operations Center software. To obtain the client, contact Technical Support.

Do the following to establish the reference client:

1.2.1 Installing and Starting MosWsClient

  1. Unpack the moswsclient.zip file.

  2. Edit the following properties in wsclient.properties:

    • Set wsapi.servers=http://OperationsCenterServerAddress:WebServicePort/wsapi/services/Moswsapi_1_0

    • Set wsapi.default.username=yourUserName

    • (Optional) Set wsapi.default.password=yourPassword

  3. Start the client by executing moswsclient.bat (or moswsclient.sh on UNIX systems).

    This starts the client in interactive mode. A prompt displays, indicating that a connection to your server was established, followed by a menu of services:

    Type /h for help
    Established connection to http://localhost:9080/wsapi/services/Moswsapi_1_0
    1-login
    2-logout
    3-getServerInfo
    4-createElement
    5-updateElement
    6-removeElement
    7-getRootElements
    8-getElement
    9-getAssociatedElements
    10-findElements
    11-nextElements
    12-getAllSlas
    13-nextSlas
    14-getSlaHealthData
    15-nextHealthData
    16-getAlarms
    17-getHistoricalAlarms
    18-getBreaches
    19-getOutages
    20-nextAlarms
    21-getSeriesData
    22-nextSeriesData
    23-getIcon
    24-getIcons
    
    Service: Select from menu (1 needed):
    
  4. Continue with Section 1.2.2, Viewing a List of Available Services.

1.2.2 Viewing a List of Available Services

  1. Type /h and then press Enter.

    The following list of available commands displays:

    Available Commands:
        /c = Disable cache updates (CacheBuilderPostProc)
        /d = Enable display of SOAP messages (ShowSoapPostProc)
        /f = Enable prompting to save SOAP Messages (SaveSoapPostProc)
        /h = List available meta-commands (CommandHelpProcessor)
        /p = Play a recorded Test Script (PlaybackProcessor)
        /r = Start recording a new test script (TestScriptRecorder)
        /x = Cancel current service/activity (CancelProcessor)
    Press [ENTER] to continue:
    
  2. Enter /d to enable the display of SOAP messages.

    This causes the SOAP message exchange for each invoked service to display on the screen. (At any time, you can enter /d to disable the feature.)

  3. Continue with Section 1.2.3, Logging In and Establishing a WSAPI Session.

1.2.3 Logging In and Establishing a WSAPI Session

  1. Type 1 and press Enter.

    Service: Select from menu (1 needed): 1
    Enter user name [admin]:
    

    Default values display in square brackets in the prompt, such as the user name shown above.

  2. Type a new value, or just press Enter to accept the default.

  3. When prompted for your password, enter your user password.

    A confirmation displays:

    Successfully logged in user admin
    
    SOAP Request: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><login xmlns="http://wsapi.mosol.com"><userName>admin</userName><passwordHash>Nb4sHPLMSJvbFrZ4zXPNeA==</passwordHash><hashType>MD5</hashType></login></soapenv:Body></soapenv:Envelope>
    SOAP Response: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><loginResponse xmlns="http://wsapi.mosol.com"><loginReturn><expiryTime>2007-03-10T23:57:08.301Z</expiryTime><key>W2FkbWluOjRdMTE3MzU3MDcyODMwMQ==</key><lastRefreshTime>2007-03-10T23:52:08.301Z</lastRefreshTime></loginReturn></loginResponse></soapenv:Body></soapenv:Envelope>
    

You have now established a WSAPI session with the server. The test client automatically includes this session in subsequent Web service requests.