Web Services - Invoke example

This example outlines the steps to create a workflow that invokes a simple demonstration Web Service, Barnes and Noble Price Quote. See Using Web Services in FileNet workflow for examples of other features.

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.

Invoke properties

To invoke a Web Service in a workflow

  1. In Process Configuration Console, use the following steps to specify a UDDI registry where workflow authors can select web services.
    1. Right-click the isolated region and select Properties.
    2. On the UDDI tab, open the UDDI Registry List tab, click Add and enter a name for this UDDI registry: xmethods_inq
    3. In the Inquiry URL field, enter the following: http://uddi.xmethods.net/inquire
    4. Commit the configuration change.
  2. In Process Designer, specify the workflow name and Web Services for this workflow.
    1. In Workflow Properties >> General tab, specify a workflow name and subject—testInvokeBookPrice.
    2. On the Web Services tab, specify the partner link.
      • On the Web Services >> Partner Links tab, enter a name for the Partner Link—BookPrice.
      • Click Web Services explorer (next to the WSDL URL field).
      • With UDDI Registries selected, open xmethods_inq, then select WSDL tModel list.
      • Type b in the Name field under UDDI WSDL tModel query, then click Execute to display the available web services whose names begin with B.
      • Select BNPriceWS, then click OK.

        The WSDL URL and Port Type will display in the Workflow Properties dialog box.

        TIP Click Invoke in the Type field to update the data. A new blank line will display in the Partner Links table.

      • Close the Workflow Properties dialog box.
  3. From the Web Services step palette, add an Invoke step to the workflow map.
    1. In the Step Properties pane, on the General tab, select the Partner LInk—BookPrice, then select the Operation—GetBNQuote.
    2. 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.

    3. 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.
    4. 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.
  4. 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.
  5. To enable the user to check the output in this example, add an Activity step after the Invoke step.
    1. Name the Activity step CheckPrice.
    2. Specify yourself (or F_Originator) as the participant for this step.
    3. Specify GetBNQuoteResult as a parameter. At runtime, you can see the returned price value at this step.
  6. Add a route from Launch to Invoke, and from Invoke to CheckPrice.
  7. Validate this workflow definition, then save it and launch the workflow.
  8. In the Launch step, enter an ISBN in the sISBN field—try 0201750813.
  9. Open your Inbox in Workplace Tasks, and open the CheckPrice step. The returned price displays in the GetBNQuoteResult data field.

    TIPS