Run the sample

1. Basic sample client application

Make sure that the client application is deployed on your WebSphere® Process Server. If you need more details how to add an application to the server, refer to the "Build it Yourself" section of the Getting Started > Hello World sample.

Run the Basic sample

To run the client application after deploying it to the WebSphere Process Server, follow these steps:

  1. In a Web browser, open the URL http://yourhost:yourport/wsclient.
  2. Note: Replace yourhost with your server's internet address and replace yourport with the port of your server's HTTP transport, for example

  3. If prompted, authenticate yourself to the server:
    • If you did not authenticate to your WebSphere Process Server during your current browser session, a login dialog similar to this appears:

    • If you already did authenticate to your WebSphere Process Server, e.g. by opening the administrative console, the login dialog will be skipped.

  4. The entry page of your client application is displayed. Press the button List process templates:
  5. The result page of your client application is displayed.
    In case that you did not deploy and start any enterprise applications which contain a business process, the page will look like this:
  6. To see a list of process templates, you can deploy predefined applications containing business processes to your server.
    • For example, you can deploy the application HelloWorldApp, which is available in the "Download" section of the Getting Started > Hello World sample.
    • As well, you can deploy the application WSApiModuleApp.ear which is available from the Download chapter of this sample.

    When you install and start those two applications, the result page will contain the following entries:

Manipulate the service endpoint

The endpoint used for the web service API was specified implicitly when the Java web service proxy was generated from the WebSphere Process Server WSDL file. If this implicitly specified default value for the service endpoint does not reflect the environment where you want to run this sample, you may modify the service endpoint dynamically.

Note: If you use an endpoint representing a different server's Business Flow Manager, the test of the endpoint as described in the following steps will work as well. However, the web service calls against the Business Flow Manager will only work after configuring single sign-on for both servers: The LTPA token generated by the server running your client application must be accepted as valid LTPA token by the server hosting the Business Flow Manager.

To modify the service endpoint, follow these steps:

  1. Open the URL http://yourhost:yourport/wsclient, for example
  2. Follow the link Update endpoint for Web Service API:
  3. The page for testing and updating the service endpoint is displayed:
  4. You may now change the effective endpoint by overtyping the string in the text field and pressing Update. At any time, you can test the effective service endpoint by clicking the hyperlink Test endpoint.
    If the effective service endpoint is working fine, you will see a screen similar to this:
  5. Use the Browser's BACK function to return to the sample client application.

2. Advanced sample client application

Important: Make sure that in addition to the client application, the application WSApiModuleApp containing the advertiseProcess is deployed and started on your server. This application is available in the download section of this sample; it simulates the scenario that for a given customer it is computed whether the customer is eligible to receive an advertisement gift.

Run the Advanced sample

To run the client application after deploying it to the WebSphere Process Server, follow these steps:

  1. In a Web browser, open the URL http://yourhost:yourport/wsclient/startprocess.html.
  2. Note: Replace yourhost with your server's internet address and replace yourport with the port of your server's HTTP transport, for example

    Instead, you can start as well from the Basic sample and follow the link Advanced sample.

  3. If prompted, authenticate yourself to the server:
    • If you did not authenticate to your WebSphere Process Server during your current browser session, a login dialog appears.
    • If you already did authenticate to your WebSphere Process Server, e.g. by opening the administrative console, the login dialog will be skipped.

  4. The start page of the Advanced sample is displayed. Enter the fields with any values of your choice and press Submit data:
  5. An indication is given whether the business process was started successfully. If the start did not succeed ("No response available") then double-check that the WSApiModuleApp is deployed and started successfully on your server, and then look for problems visible in the server logs.
    After a successful start of the process, the screen looks like this:
  6. Follow the first hyperlink on the screen; this link uses a parameterized URL similar to http://localhost:9080/wsclient/viewprocess.jsp?PIID=_PI:90030119.ec15872f.b61b67f6.dc830215 which navigates to a status page for this particular process instance. For some seconds, the status will be STATE_RUNNING as the underlying BPEL process uses a sleep operation to delay the execution for some time (sleep time 10 seconds):
  7. Wait a moment. The status page will automatically trigger a refresh operation (refresh interval specified in this sample is 4 seconds) and after a few refresh operations, the screen will change to look similar to this: