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. When the Web Service is registered, tested, and verified, it can be exported as a function block into Activity Editor. Then its services and methods can be easily used within maps, like other function blocks. When the map is run, it invokes the Web Service without any modifications to the Websphere Business Integration Server.

For information on registering, testing, verifying and exporting a Web Service 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.

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 Express, create a custom transformation by dragging the source business object attribute ObjWS_Temp_GetTempRequest.zipcode onto the destination business object attribute ObjWS_Temp_GetTempResponse.return. Then click the icon of the Custom transformation rule to launch Activity Editor.

    Figure 80 shows the custom transformation.

    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 ObjWS_Temp_GetTempRequest.zipcode to the input port "zipcode" of the getTemp function block; and connect the output port "return" of the getTemp function block to the input port of the icon of the destination business object attribute ObjWS_Temp_GetTempResponse.return.

    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 Express. 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 59 degrees for the destination business object attribute.

    Figure 82. Test view results

Copyright IBM Corp. 2004