uCosminexus Service Platform, Reception and Adapter Definition Guide

[Contents][Glossary][Index][Back][Next]

3.3.2 Defining Service Adapters (SessionBean)

This subsection describes how to define Session Bean adapters. You can define Session Bean adapters in the Service Adapter Settings window.

Organization of this subsection
(1) Message format for service components
(2) Data transformation
(3) Specifying the service component name to be called, from among those registered in the JNDI namespace
(4) Setting a user definition class (JAR file)
(5) Acquiring an RMI-IIOP stub and interface
(6) Operations in the Service Adapter Settings window
(7) Setting the client definition file

(1) Message format for service components

For Session Bean, the message format definition file automatically created from the EAR file will be the message format definition file for the service component. Therefore, you do not have to set the message format for a service component.

(2) Data transformation

If the message format of the service requester is different from the message format of the service component to be called by the service adapter, data transformation is required.

To perform data transformation of a request message, in the Service Adapter Settings window, set the message to be input from the service requester as the standard message, and in the Data-conversion definition screen, define the data transformation. To perform data transformation of a response message, set the standard message as the message returned from the service component, and in the Data-conversion definition screen, define the data transformation.

For details about data transformation, see Chapter 6. Defining Data Transformation in the manual Service Platform Basic Development Guide.

(3) Specifying the service component name to be called, from among those registered in the JNDI namespace

In the Service Adapter Settings window, specify the service component name that is to be called, from among those registered in the JNDI namespace. Specify the address so that remote call is used. You cannot use local call for service components (Session Bean). The following gives examples of specifying a service component name.

For the names registered in the JNDI namespace, see the following locations:

(4) Setting a user definition class (JAR file)

For Session Bean, you need to set a user definition class (JAR file) in order to use a stub to call a service component.

Note that, when setting a JAR file in the Service Adapter Settings window (Session Bean detailed window), you must set the file extension to jar by using lower-case letters.

Also, do not set the following file names for a JAR file:

If the above file names are used, a warning message is displayed. If a warning message appears, delete the above file names from the user definition class. Then, rename the files and then retry.

(5) Acquiring an RMI-IIOP stub and interface

Use the J2EE server's cjgetstubsjar command to acquire an RMI-IIOP stub and interface. For details about the cjgetstubsjar command, see cjgetstubsjar(get RMI-IIOP stub and interface for application) in the manual Application Server Command Reference Guide.

(6) Operations in the Service Adapter Settings window

To define a Session Bean adapter:

  1. Open the Service Adapter Settings window.
    For details about how to open the Service Adapter Settings window, see 3.3.1(4) Displaying the service adapter settings screen.
  2. In Service component control information, edit Service name, Service ID, and Maximum instances, as necessary.
  3. In Service component control information, specify the value for Address.
    For Address, acquire the service component name that is to be called, from among those registered in the JNDI namespace, and then enter that name. For the names registered in the JNDI name space, see the following locations:
    • See Chapter 2. Naming Management in the manual Application Server Common Container Functionality Guide.
    • See 2.5 Registering a reference in the JNDI name space of the EJB container in the manual Application Server EJB Container Functionality Guide.
  4. From the Operation drop-down list of Service component control information, select the operation you want to edit.
  5. Check the information displayed in Operation information.
  6. If necessary, select the Convert a system exception into a fault message check box of Service component control information.
  7. For request messages, perform steps 8 to 18.
  8. Perform the following operations:
    When specifying the standard message format
    Perform steps 9 to 12, and then go to step 13.
    When not specifying the standard message format
    Go to step 13.
  9. Select the Use check box for the standard message.
  10. Specify the Format ID for the standard message.
  11. Click the Browse button for the standard message, and specify the standard message format for Message format.
    Note that if you set a message format that references an external XML schema, be sure to set the file that corresponds to the root schema. The external XML schema file referenced by the root schema is automatically acquired.
    For details about the forms that can be specified for message formats, see 2.6.5 Scoping of XML schema in the manual Service Platform Basic Development Guide.
  12. Click the Display button for the standard message.
    The format of the standard message is displayed. If necessary, check the format of the specified standard message.
  13. Specify Format ID for the service component message.
  14. Click the Display button for the service component message.
    The format of the service component message is displayed. If necessary, check the format of the service component message.
  15. Perform the following operations:
    If you select the Use check box for the standard message
    Perform steps 16 to 18, and then go to step 19.
    If you do not select the Use check box for the standard message
    Go to step 19.
  16. Enter the file name for the data transformation definition.
  17. Click the Edit button.
    The Data-conversion definition screen appears.
    Note that, for the first definition, the Select Root Element dialog box appears.
    If you changed the message format, a dialog box appears, confirming whether to apply the change. For details about the procedure when you have changed the message format, see 6.3.2 Procedure for defining changed message formats in the manual Service Platform Basic Development Guide.
  18. Map the contents of the standard message and the contents of the service component message.
  19. For the response message, also perform steps 8 to 18.
  20. Click the Service-adapter definition (details) tab.
  21. Click the Add button to add the relevant user-defined class.
    For the user-defined class, specify the JAR file for the stub and interface that you acquired in 3.3.2(5) Acquiring an RMI-IIOP stub and interface.

(7) Setting the client definition file

In the same way as the Web service, set the client definition file that controls operations on the client (service requester) side.

Set the client definition file, as necessary, by using either of the following methods:

Setting the client definition file is optional. If you do not set the client definition file, the contents of the template file are used as is.

(a) Setting procedure (when editing the template file)

To edit the template file:

  1. In the Service Adapter Settings (details) window, under Client definition file, click the Edit button.
    An editor for the client definition file opens.
  2. In the editor, edit the client definition file.
  3. From the Eclipse menu, select File and then Save to save the definitions.
(b) Setting procedure (when creating a new client definition file and overwriting the template file)

To create a new client definition file and overwrite the template file:

  1. Use a text editor or another program to create a client definition file with the name c4webcl.properties.
    Enter c4webcl.properties in lower-case letters.
  2. In the Service Adapter Settings (details) window, under Client definition file, click the Browse button to specify the created client definition file.
(c) Settings

For details about the settings in the client definition file, see 10.3 Setting up the client definition file in the manual Application Server SOAP Application Development Guide.

Note that, for a Session Bean adapter, some items can be set in the client definition file, but other items cannot. The following table lists and describes the items that can be set in the client definition file when a Session Bean adapter is used.

Table 3-2 Setting items in the client definition file

Key name Description Specifiable
c4web.logger.log_level Importance of trace file output Y
c4web.logger.aplog_level Importance of application log output Y
c4web.logger.aplog_error_record Application log output when an abnormality occurs Y
c4web.logger.log_file_dir Output directory of the trace file and application log Y
c4web.logger.log_file_num Number of trace files Y
c4web.logger.log_file_size Size of trace files Y
c4web.logger.aplog_file_num Number of application log files Y
c4web.logger.aplog_file_size Size of application log files Y
c4web.logger.log_file_prefix Prefix of trace files and application logs N#
c4web.common.do_multirefs Multi-reference (runtime option) N
c4web.common.send_xsi_types Data type definition (runtime option) N
c4web.application.app_maintainsession Retention of HTTP session (runtime option) N
c4web.application.proxy_host Host name of the proxy server (runtime option) N
c4web.application.non_proxy_hosts Group of host names that do not use the proxy server (runtime option) N
c4web.application.proxy_port Port number of the proxy server (runtime option) N
c4web.application.proxy_user Authentication user ID of the proxy server (runtime option) N
c4web.application.proxy_password Password for the authentication user ID of the proxy server (runtime option) N
c4web.common.enable_soapheader_check Option for checking the qualification of SOAP header names (runtime option) N
c4web.application.socket_write_timeout Timeout value for writing to the client socket (runtime option) N
c4web.application.socket_read_timeout Timeout value for reading from the client socket (runtime option) N
c4web.application.socket_connect_timeout Timeout value for connecting to the client socket (runtime option) N
c4web.attachment.file_body_encoding Body encoding type N
c4web.attachment.attachment_temp_directory Backup directory N
c4web.attachment.attachment_file_delete_by_date Number of days to retain unnecessary storage files N
c4web.common.prf_trace_level Option for trace output of performance analyses Y

Legend:
Y: The item can be specified.
N: The item cannot be specified. If this item is specified, it is ignored.

#
The value of this item is always changed to the service ID, and therefore need not be specified.