Adding a Web Service
The Web Service component allows you to update your Client Data with data from a Web Service. For example, you may want to update the current prices of stocks in a portfolio. To use the Faces Client Web Service, the Web Service must be running locally. Only calls to in-domain Web Services are supported because of security concerns.
Follow these steps to configure a Web Service:
- Create an in-domain Web Service for use with the Faces Client components. You need to know the WSDL URL and the format (schema) of the input/output soap messages for the Web Service.
- After creating the client data for the Faces Client page, drag the Web Service icon from the Faces Client Components drawer onto the page.
- Select the Web Service component on the JSP page.
- Go to the Properties view to set the attributes.
- On the odc:WebService tab, specify an alias or meaningful name for the Web Service, the URL for the location of the WSDL document for the Web Service definition, and the name of the Web Service operation that you want to call.
- On the Input Parameters tab, specify the parameters required for the call to the specified Web Service operation. The input parameters to the Web Service can be attributes or references from the Client Data or a literal string.
- Optional: If the input parameter to the Web Service is a complex type with primitive attributes, you can specify a Request Element Name to map a primitive attribute in the client model to one in the input schema. The output parameters mapping is the same as the input, except that you are mapping the results from the Web Service to some entities in your model.
- Use the Attribute Name list to create a list of some attributes in a list reference and supply that as input to the Web Service. For example, you may have a list of Stock objects, and each Stock object in the list has a string attribute called symbol. In order to supply a list of symbols as input to the Web Service from the Bind to dialog, select the list of Stock objects, and select the symbol from the Attribute Name list. The Attribute Name field should only be used when the input parameter is a list type.
For an example of Faces Client Web Service, see the Stock Web Service in the Faces Client Example. In order to run the example, refer to the Samples section.