Exporting Web services into Activity Editor

A Web service is part of an InterChange Component Library Project in System Manager just like business objects and maps. After the Web service is registered, tested, and verified, its services and methods can be exported as function blocks into Activity Editor for use within maps, like other function blocks.

For information on registering, testing, verifying and exporting a Web service from System Manager into Activity Editor, see the System Implementation Guide.

Using Web services in Activity Editor

After exporting a Web service from System Manager, you need to restart Activity Editor. When Activity Editor opens, the exported Web service is added as a category under My Library. It has the same functionality as other categories in My Library.

Figure 79 shows the Web services category and function blocks in Activity Editor after exporting from System Manager.
This figure shows the Web services library folders circled in red.

Figure 79. Web services category in Activity Editor

Similar to using other function blocks in Activity Editor, using any of the Web services function blocks is a matter of dragging and dropping the function blocks and connecting the inputs and outputs. For information on using Activity Editor, see "Working with activity definitions".

Example of using a Web service in a map

The following example illustrates how to invoke a Web service using Activity Editor to change a source attribute's zip code to the temperature for the city and assign the change to the destination attribute.

Perform the following steps:

  1. From the Diagram tab of Map Designer, create a custom transformation by dragging the source business object attribute ObjTemperatrueInput.zipcode onto the destination business object attribute ObjTemperatureOutput.currentTemperature. Then click the icon of the Custom transformation rule to launch Activity Editor.

    Figure 80 shows the custom transformation.
    This figure shows a custom transformation in Map Designer. The source is on the left with the destination on the right with the rule column on the right circled in red.

    Figure 80. Creating the custom transformation

  2. Select the Web services category in the Library window to show the function blocks available in that category, as icons, in the Content window.
  3. Drag and drop the Web services getTemp function block from the Content window onto the editing canvas.
  4. Connect the output port of the icon for the source business object attribute ObjTemperatureInput.zipcode.to the input port "zipcode" of the getTemp function block; and connect the output port "result" of the getTemp function block to the input port of the icon of the destination business object attribute ObjTemperatureOutput.currentTemperature.

    Figure 81 shows the connected inputs and outputs of the getTemp function block.

    Figure 81. Connecting the inputs and outputs

  5. Save the activity template and map.
  6. Switch to Test view in Map Designer. Enter a valid zip code in the Source-zipcode field. Click Debug Map. You can choose to deploy the map and business objects to the server if you have not already done so.

    Result: After the test run is finished, you will see the current temperature for the zip code in the destination business object.

    Figure 82 shows how the zip code 94010 of the source business object attribute has been transformed to 57 degrees for the destination business object attribute.

    Figure 82. Test view results

Copyright IBM Corp. 1997, 2004