How to Call an External Web Service From a Process
You can implement a call to an external web service in a business process application, and then deploy and test that application.
You should work through each section in turn to complete the tutorial.
A process (acting as a service consumer) can invoke web service operations provided by other processes or applications (service providers).
The process in this tutorial invokes a request-response operation to send a request message to a web service and receive a response message back from it.
A concrete WSDL document that defines the request-response operation is provided by the web service.
From this tutorial you will learn:
- to use a service task to call an external web service from a business process, using a concrete WSDL provided by the web service. See "Calling a Web Service" in the TIBCO ActiveMatrix BPM Implementation Guide.
- to import a WSDL into a project and associate it with a web service task. See "Using Web Services" in the TIBCO ActiveMatrix BPM Implementation Guide.
- to create and install an HTTP Client resource instance from a resource template, using the Administrator interface in the BPM runtime.See "Exposing a Web Service" in the TIBCO ActiveMatrix BPM Implementation Guide.
- to map the system participant used by a web service task to a BPM runtime HTTP Client resource instance. See "Calling a Web Service" in the TIBCO ActiveMatrix BPM Implementation Guide.
Prerequisites
You should be familiar with the basic concepts and principles involved in calling web services.
You should be familiar with the basics of designing, implementing and deploying process-based applications using TIBCO Business Studio. If you are not familiar with these things, you should run through the following tutorials before attempting this one:
- How to Design a Simple WelcomeUsers Business Service
- How to Implement and Deploy the WelcomeUsers Application
This tutorial implements a call to an Apache Axis2 web service called UKAddressService. Before you begin, you must deploy this web service to a J2EE server (such as Apache Tomcat) that is running version 1.4.1 of the Axis2 engine. To do this:
Procedure
- Importing the FindAddress Analysis Project
To avoid having to build the process from scratch and focus just on the steps involved in calling a web service, the tutorial provides a "work in progress" project as a starting point. - Importing the UKAddressService WSDL Document
To be able to call an external web service from a process, you must obtain the concrete WSDL defining the web service, and import it into the Generated Services folder in your project. - Creating a Web Service Task
To call a web service from a process you use a Service task of type Web Service. The service task uses the WSDL provided by the service to define its implementation details. - Setting up Data Inputs to and Outputs from the Web Service
Data fields (and/or formal parameters) must be used to define the inputs to and outputs from the web service. The data fields must be mapped to the matching message input and output parts in the WSDL document. - Setting Up a System Participant
When you assign a concrete WSDL to a web service task TIBCO Business Studio automatically creates a system participant and assigns it to the web service task. - Creating an HTTP Client Resource Instance
An HTTP Client resource instance must exist in the BPM runtime before you can deploy the FindAddress application. This resource instance defines the connection information used by the BPM runtime to contact the UKAddressService web service. - Deploying the Application
As part of the deployment process, you map the system participant used by the web service task to the HTTP Client resource instance you created earlier. - Testing the Application
You can now test the application by running an instance of it in Workspace. - Importing a Tutorial Solution
You can import the solution to the tutorial.