### Setting up a web service connection

To set up a web service connection to connect a JReport catalog to a web service data source, follow the steps below:

1. Create a catalog or open a catalog, then in the Data tab of the Catalog Browser, right-click the node of a data source and choose Add SOAP Web Services Connection from the shortcut menu.

   If you want to set up the connection by adding a data source to an existing catalog and then defining the connection on the data source, open the catalog, select any data source contained in it, click the New Data Source button on the Catalog Browser toolbar, then in the New Data source dialog, specify the name of the data source, select the SOAP Web Service connection type and click OK.

   The Web Service Data Source dialog appears. See the dialog.

2. Specify a WSDL file to create the web service connection.
   - If you want to use a WSDL file on your local disk, check the Local File radio button, then click the Browse button to browse for the file.
   - If you want to use a WSDL file through a URI, check the URI radio button, then input the URI string in the text field that follows and specify the user name and password for assessing the WSDL file.
3. Click the Options button to show the additional settings.
4. Click the Time Zone and Locale button to specify the time zone and the locale as required.
5. If you want the catalog or schema, or both of them to be used in data manipulation, make the selection in the Qualified Name Pattern box according to your requirements.
6. Input the number of seconds in the Time Out text field to specify how long to wait to get the WSDL file.
7. Click the Security Configuration button to display the Security Configuration Setting dialog to configure the security policy. See the dialog.

8. Specify the user name and password for the user name token to be used in the security policy.
9. Specify the type for the key store from the Key Store Type drop-down list.
10. Click the Browse button next to the Key Store File field to specify the key store file.
11. Input the password in the Key Store Password text field to get the access to the key store file.
12. In the Client Key box, specify the alias name to be used as client signature in the key store, and set the password for the name.
13. In the Server Key box, specify the alias name and password to be used to get the server-side certification or public key in the key store.
14. When done, click OK to go back to the Web Service Data Source dialog.
15. Click the OK button in the Web Service Data Source dialog to set up the web service connection.

Note: When you configure the security policy for a web service connection, except for Key Store Type, all the other options in Security Configuration Setting dialog can be controlled by constant level formulas. However, the formula control is only available after the web service connection is already set up, that is when you edit an existing web service connection.