BackPrevious Page Next PageNext

SOAP Web Service Connections

Setting up web service connections in a catalog

Adding tables to a web service connection

Editing the operation used to create tables

Managing the tables in a web service connection

Web services provide a standard means of interoperating between different software applications, running on a variety of platforms and/or frameworks. It is a way to connect to a remote application and request data directly from the application without going to a DBMS. JReport Designer supports SOAP Web Services defined by WSDL 1.1 or WSDL 2.0 as data sources. You can add SOAP Web Service data sources to JReport catalogs by importing WSDL files.

Setting up web service connections in a catalog

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.
  2. In the Catalog Manager, right-click the node of a data source and choose New SOAP Web Service Connection from the shortcut menu.

    If you want to set up the connection in a new data source in the catalog, select any of the existing catalog data sources, click New Data Source on the Catalog Manager 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 SOAP Web Service Data Source dialog appears.

    SOAP Web Service Data Source dialog

  3. Specify a WSDL file to create the web service connection.
  4. Click the Options button to show the additional settings.
  5. Click the Time Zone and Locale button to specify the time zone and the locale as required.
  6. 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.
  7. Input the number of seconds in the Time Out text box to specify how long to wait to get the WSDL file.
  8. Click the Security Configuration button to display the Security Configuration Setting dialog to configure the security policy.

    Security Configuration Setting dialog

  9. Specify the user name and password for the user name token to be used in the security policy.
  10. Specify the type for the key store from the Key Store Type drop-down list.
  11. Click the Browse button next to Key Store File to specify the key store file.
  12. Input the password in the Key Store Password text box to get the access to the key store file.
  13. 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.
  14. 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.
  15. Click OK to go back to the SOAP Web Service Data Source dialog.
  16. Click OK 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.

Adding tables to a web service connection

After a web service connection is set up, all the information of the web service defined in the WSDL file will be stored in the catalog, including information of service, operation, and the input message and output message in each operation. You can then add tables into the JReport catalog via the connection based on this information. However you can only define tables based on operations which support SOAP binding.

  1. Do any of the following:

    The Add Table dialog appears.

    Add Tables dialog

  2. Specify a service from the Service Name drop-down list.
  3. If you use WSDL 1.1 to define the web service, you also need to specify the port type for the selected service from the Port Type drop-down list.
  4. All the operations with SOAP binding that are included in the selected service are listed in the Operation Name drop-down list. Select one as required, then the input message of the operation will be displayed. You can define the value for the input message if necessary by either typing in the value in the text box in the Value column, or clicking Formula button in the text box to select or define a constant level formula or parameter in the current catalog data source to return the value.

    If the Input Message column is empty, that is to say, the input message has its own defined values, so there is no need for you to provide it the value.

  5. Type the number of seconds in the Time Out text box to specify how long to wait to get the specified service and operation information defined in the WSDL file.
  6. If you use WSDL 1.1, you may sometimes find that the XML schema described by the output message does not match the concrete XML instance in the SOAP responded from the web service, as a result, JReport will be unable to read data properly from that XML instance. In this case, you can check the option Use Schema from Response, so as to ignore the XML schema in the output message and directly parse the XML schema from the specific XML instance included in the SOAP responded from the web service.
  7. Click OK to accept the changes and exit the dialog.

You can then create queries and business views based on these tables. A report is developed from a query (or something else which is functionally similar) or from a business view.

Editing the operation used to create tables

The service and operation you have selected to create the tables in a web service connection is displayed under the Tables node of the connection. If you use WSDL 1.1 to define the web service, the defined port type is also included. You can edit the information of the operation if necessary.

  1. Select the web service operation node, right-click it and then select Edit from the shortcut menu. The Edit Operation Calling Property dialog appears.

    Edit Operation Calling Property dialog

  2. In the Input Message column, select the input message you want to edit, then modify its value in the text box of the Value column as required. You can either input the value, or click Formula button in the text box to select or define a constant level formula or parameter in the current catalog data source to return the value of the input message.
  3. Type the number of seconds in the Time Out text box to specify how long to wait for the operation to complete.
  4. If you use WSDL 1.1 to define the web service, the option Use Schema from Response is available. Check it if you want to ignore the XML schema described in the output message and parse the XML schema directly from the specific XML instance in the SOAP responded from the web service.
  5. Click OK to accept the changes and exit the dialog.

Managing the tables in a web service connection

When the tables have been added into the JReport catalog via the web service connection, you can refresh them, organize them into folders, and remove and add the table columns the same as you do on tables from a JDBC database.

BackPrevious Page Next PageNext