Build it yourself

To build the service invocation sample, follow these steps:

Develop the Web Service (bottom up)

Create a dynamic web project

To create the HelloService dynamic web project, complete the following steps:

  1. Switch to the Java EE perspective. To switch to the Java EE perspective, select Window > Open Perspective > Other from the Menu. In the Open Perspective dialog, select Java EE and click OK.
  2. In the Enterprise Explorer view, right-click the canvas.
  3. From the pop-up menu, select New > Dynamic Web Project. The New Dynamic Web Project window opens.
  4. In the Project name field, enter HelloService.
  5. For Project contents, keep the default setting.
  6. Select WebSphere Process Server v7.0 as the Target Runtime.
  7. Select 2.5 for the Dynamic Web Module version.
  8. Select custom for the Configuration.
  9. Make sure Add project to an EAR is selected. Leave the default value.
  10. Click Finish.
  11. If the Open Associated Perspective dialog appears, click Yes.

Create a Java Bean implementation of the Web Service

  1. In the Enterprise Explorer view, right-click HelloService.
  2. From the pop-up menu, select New > Class.
  3. The New Java Class window opens.

  4. In the Package field, enter bpc.samples.invoker.
  5. In the Name field, enter HelloService.
  6. Click Finish.
  7. The HelloService.java editor opens.

    Note: If the HelloService.java editor is not opened by default, the file is located at Enterprise Explorer > HelloService > Java Resources: src > bpc.samples.invoker.

  8. Complete the implementation of HelloService by adding the following method:
  9. public String hello(String name){

        System.out.println("HelloService.hello(String name): value of name: " + name);

        if( name == null || name.equals("") ){
            return "Hello World";
        }
        else{
            return "Hello " + name;
        }
    }

  10. On the toolbar, click the Save button .

Generate a Web Service for a Java class

Note: Before performing the following steps, start server WebSphere Process Server v7.0.

To generate the Web Service for the HelloService class, complete the following steps:

  1. In the Enterprise Explorer view, expand HelloService > Java Resources > bpc.samples.invoker.
  2. Right-click HelloService.java.
  3. From the pop-up menu, select Web Services > Create Web service.
  4. The Web Service window opens.

  5. In the Web service type section, make sure Bottom Up Java bean Web Service is selected.
  6. Accept all other values.
  7. Click Next.
  8. On the Service Endpoint Interface Selection page, accept the default values.
  9. Click Next.
  10. On the Web Service Java Bean Identity page, accept the default values.
  11. Click Next.
  12. Wait for the Web Service publishing to finish.
  13. On the Web Service Publication page, accept the default values.
  14. Click Finish.

Develop the business process

Create a new process module

To create a new module, complete the following steps:

  1. Switch to the Business Integration perspective.
  2. In the Business Integration view, right-click the canvas.
  3. From the pop-up menu, select New > Module.
  4. The New Module window opens.

  5. In the Module Name field, enter Invoker.
  6. Click Finish

Import the Web Service interface

To import the InvokerService interface, complete the following steps:

  1. Switch to the Business Integration view.
  2. Find out your current workspace directory by clicking File > Switch Workspace. You may copy this path for later use into your clipboard, then click Cancel.
  3. In the navigation tree, expand Invoker and right-click Interfaces.
  4. From the pop-up menu, select Import.
  5. The Import window opens.

  6. Expand Business Integration and select WSDL and XSD as input source.
  7. Click Next. The Import page opens.
  8. Select Local WSDL or XSD file, or both and click Next.
  9. In the Source directory field, paste the name of your workspace directory.
  10. Browse to the HelloService web project, choose folder HelloService/WebContent/WEB-INF/wsdl. Click OK
  11. Select HelloService.wsdl.
  12. Click Finish.

Create the business process interface

To create the business process interface, complete the following steps:

  1. In the Business integration view, right-click Invoker > Interfaces.
  2. From the pop-up menu, select New > Interface.
  3. The New Interface Wizard window opens.

  4. In the Name field, enter InvokerProcess.
  5. In the Folder field, enter bpc/samples.
  6. Accept the default value for the namespace.
  7. Click Finish. The interface editor opens.
  8. Right-click on the canvas and select Add Request Response Operation, or just click the appropriate icon .
  9. On the toolbar, click the Save button and close the interface editor.

Build the business process

Create a new business process:

  1. In the Business Integration view, right-click Invoker > Integration Logic.
  2. From the pop-up menu, select New > Business Process.
  3. The New Business Process window opens.

  4. In the Name field, enter InvokerProcess.
  5. In the Folder field, enter bpc/samples.
  6. Accept the default value for the namespace.
  7. Click Next.
  8. In the Select a Business Process Type panel, select Microflow.
  9. Click Next.
  10. In the Select an Interface panel, select Select an interface.
  11. Click Browse and select the InvokerProcess interface. Click OK.
  12. Make sure that operation1 is selected as operation.
  13. Click Finish. The business process editor opens.

Add a Reference Partner to your process:

  1. In the navigation tree of the Business Integration view, expand Invoker > Interfaces.
  2. Drag the HelloService interface and drop it to the canvas of the business process editor of the InvokerProcess.
  3. This operation does not change anything on the canvas, but rather adds the reference partner HelloService (circled red) with the appropriate reference interface.

Add an Invoke activity to your process:

  1. In the business process editor, select the Invoke activity icon from the palette. This icon can be found here.
  2. In the business process editor, click the link between the Receive and Reply activities.
  3. An Invoke activity is added.
  4. Replace the default Display Name Invoke by the name InvokeHelloService. The Display Name field can as well be changed in the Description section of the Properties view; a change of the display name will as well update the Name field.
  5. In the Properties view, click the Details tab.
  6. To select a reference partner, click Browse. The Select a Partner window opens.
  7. Select HelloService, then click OK.
  8. Next you have to select the operation; since the interface contains hello as the only operation, this operation is preselected.
  9. Make sure Use data type variables mapping is enabled.
  10. Click under Read From Variable. A popup with available variables opens.
  11. Select input1.
  12. Click under Store Into Variable. A popup with available variables opens.
  13. Select output1.
  14. On the toolbar, click the Save button .

Module assembly

To finish the implementation of the invoker process, you have to create the module assembly. Complete the following steps:

  1. In the Business Integration view, double-click Invoker > Assembly Diagram. The assembly editor opens.
  2. In the Business Integration view, expand Invoker > Integration Logic > Processes > bpc\samples.
  3. Drag and drop the InvokerProcess process to the assembly editor. The invoker process is added.
  4. In the Business Integration view, expand Invoker > Interfaces.
  5. Drag the HelloService interface to the assembly editor. The Component Creation window opens.
  6. Select Import with Web Service Binding.
  7. Click OK.
  8. A new window HelloServiceImport1 Web Service Import... opens.
  9. Select Use an existing web service port. Click Browse.
  10. From the popup, select HelloService and click OK.
  11. When the Transport Selection for HelloServiceImport1 window appears click OK.
  12. Click OK.
  13. The import is added to the editor.
  14. In the assembly editor, click HelloServiceImport1 to select the new import element.
  15. Click again on the import element and overtype the default name HelloServiceImport1 by HelloService.
  16. Move the cursor over the InvokerProcess component, then move it right to the reference section labelled 1..1, then move it further right until you see a wire symbol:
  17. Click once, then click on HelloService. This creates a wire between the two components. (Note that as an alternative way for wiring, you could right-click on InvokerProcess and select Wire to Existing.)
  18. On the toolbar, click the Save button .

Test the business process in the integrated test environment

Install the ServiceInvocation process to the test environment

  1. In the Servers view, click the Servers tab.
  2. In the table, right-click WebSphere Process Server v7.0.
  3. From the pop-up menu, select Add and Remove Projects. The Add and Remove Projects window opens.
  4. Select InvokerApp from the list of available projects.
  5. Click Add.
  6. Click Finish.

Run the sample using BPC Explorer

Refer to the Run the Sample section on how to run the sample. For further information on using BPC Explorer refer to the product documentation.

Export runnable applications

If you want to run this sample business process on a WebSphere Process Server, you have to create two enterprise applications. Then, you can install these enterprise applications to your WebSphere Process Server.

To create an enterprise application for the InvokerApp business process, follow these steps:

  1. From the menu, select File > Export.
  2. In the Export window, expand Java EE and click EAR file.
  3. Click Next.
  4. In the EAR project dropdown list, select InvokerApp.
  5. In the Destination list, specify your destination directory.
  6. Click Finish.
  7. Repeat steps 1 through 6 for the HelloServiceEAR EAR project.

Install and run the service invocation sample to WebSphere Process Server

Note: if you do not have a WebSphere Process Server besides the integrated test environment, you can skip this chapter.

Install HelloService application

  1. In a browser, open the administrative console.
    The default URL is
  2. If security is enabled, enter a valid User ID and Password. Click Log in.
  3. In the navigation pane, select Applications > New Application.
  4. Click New Enterprise Application.
  5. Click Browse and select the HelloService.ear file you created earlier.
  6. Click Next several times and accept all the defaults until you reach Step 3: Summary.
  7. Review the options in the Summary dialog. Click Finish.
  8. This will deploy your Enterprise application. Wait until the deployment has finished. This may take some time.
  9. Click Save directly to the master configuration.
  10. In the navigation pane, select Applications > Application Types > WebSphere enterprise applications.
  11. Select HelloServiceEAR and click the Start button.

The HelloService.ear application is deployed and started.

Install Invoker application

Repeat the steps above to install the InvokerApp business process.

Run your business process using the BPC Explorer

Refer to the Run the Sample section on how to run the invoker process.