This example outlines the steps to create a workflow that
invokes a simple demonstration Web Service, Barnes and Noble Price
Quote.
At runtime, the launch user enters an ISBN, and the Invoke
step sends the request message with the ISBN value to the specified
Web Service, which returns the QuoteResult. The user opens the CheckPrice
step to see the returned price.
To invoke a Web Service in a workflow:
- In Process Configuration Console, use the following steps to specify a UDDI registry where
workflow authors can select web services.
- Right-click the isolated region and select Properties.
- On the Web Services tab, select the UDDI tab and open the UDDI Registry List tab. Click Add and enter a name for this UDDI registry:
xmethods_inq
- In the Inquiry URL field, enter the following:
http://uddi.xmethods.net/inquire
- Commit the configuration change.
- In Process Designer, specify the workflow name and Web
Services for this workflow.
- In Workflow Properties >>
General tab, specify a workflow name and subject—testInvokeBookPrice.
- On the Web Services tab,
specify the partner link.
- From the Web Services step palette, add an Invoke step to the workflow map.
- In the Step Properties pane, on the General tab, select
the Partner LInk—BookPrice, then select the Operation—GetBNQuote.
- For Message type, select Parameters.
Note that Process Designer determines
the outgoing parameters (required input for the service) and incoming
parameters (reply from the service) from the WSDL.
- Click in the Expression field
of the Outgoing Parameter, sISBN, and select <Create sISBN> to automatically
create a data field of the appropriate type (string) and with the
same name as the parameter.
- Click in the Expression field
of the Incoming Parameter, GetBNQuoteResult, and select <Create GetBNQuoteResult> to automatically
create a data field to contain the price quote reply from the BookPrice
web service.
- On the workflow map, select the Launch step and specify
the sISBN field as a parameter—the
launch user will provide a valid ISBN as input for this web service.
- To enable the user to check the output in this example,
add an Activity step after the Invoke step.
- Name the Activity step CheckPrice.
- Specify yourself (or F_Originator) as the participant
for this step.
- Specify GetBNQuoteResult as a parameter.
At runtime, you can see the returned price value at this step.
- Add a route from Launch to Invoke, and from Invoke to CheckPrice.
- Validate this workflow definition, then save it and launch
the workflow.
- In the Launch step, enter an ISBN in the sISBN field—try 0201750813.
- Open your Inbox and open the CheckPrice step. The returned
price displays in the GetBNQuoteResult data field.
TIPS
- You might need to wait a few seconds for the invoked service to
send back a reply, and for the Web Services queue to process the reply
and route the CheckPrice step to your inbox.
- If the CheckPrice step does not appear in your inbox after a minute,
an administrator can use Process Task Manager on the Application
Engine server to confirm that ws_request queue is running.