Komodo Tour

 

Table of Contents

Part 2: Komodo Editor

In the second part of the tour you will:

Editing Komodo Preferences

Before you can test and run the Web service, you must make sure that you have specified the correct Perl package for Web service support. For this tour, you will use the SOAP::Lite module that is included with the ActivePerl distribution.

  1. Select Edit|Preferences|Web Services.
  2. From the Perl Web Services Module drop-down list, select SOAP::Lite. Click OK.

View Example

Top

Creating and Saving a File

Next, create a Perl file that you will use to test the Web service you added in Part 1.

  1. Select File|New|New File.
  2. From the Categories list, select the Common folder.
  3. From the Templates list, select Perl.
  4. Click Open. A new file will open in the Editor Pane.
  5. Select File|Save As, name the file WS_test.pl save the file in the same directory as StockQuote_snippet.pl. Leave the file open for use in the next example.

View Example

Top

Using Komodo's Editing Features

Now that you have created and saved a new file, you are ready to enter some code. First, you will insert the Web service code, and then you will add some additional code in order to test the Web service.

  1. Position the cursor beneath the use strict; line of code.
  2. On the Toolbox tab, right-click the Web service bookmark, and select Insert Service Call. The WSDL service call will be inserted in the Editor Pane.
  3. Move the cursor to the beginning of a new line, enter print $St, and press CTRL+SPACE to invoke Komodo's word completion feature. The line will now appear as:

    print $StockQuoteService


  4. Without leaving a space, type -> after $StockQuoteService. A pop-up displaying the "getQuote" method will be displayed.


  5. View Example

  6. Press the TAB key to invoke Komodo's AutoComplete feature. The line will now appear as:

    print $StockQuoteService->getQuote


  7. Without leaving a space, type an opening parenthesis. Komodo will display a CallTip indicating that the argument for the "getQuote" method must be entered as a string and will produce a result in the form of a floating-point number.


  8. View Example

  9. Immediately after the opening parenthesis, type "IBM", and close the parenthesis.
Top

Running a Program

Before you move on to the next part of the tour, which involves creating an user interface for the stock quote program, you will run the WSDL service call in Komodo to ensure that it is getting the desired response from the Web service.

  • Click CTRL+F5 (or click the Go button on the toolbar), and click OK. The response from the Web service is sent to the Output Pane at the bottom of the Komodo workspace. The number displayed should be between 50 and 100, which represents the value of a single IBM share in US dollars.

View Example


Top Previous Next