Hub One Way

The Hub One Way interaction pattern delivers a message from WebSphere Application Server to the adapter, without expecting a response from the adapter.

The Enterprise Application Archive application for the interaction pattern must contain a service project. If you chose Export to Service Project when you deployed your System Manager user project, the service project already exists. If you exported the System Manager user project as a JAR file or as a set of files to a directory, you will need to import the files to create a service project. If you need to perform that task, seeImport files for a new service project, which describes that procedure for the Agent Delivery interaction pattern. The remainder of these instructions for the HubOneWay interaction pattern assume that you chose Export to Service Project when you deployed your System Manager user project.

To create a HubOneWay interaction pattern, create an Enterprise Application Archive application that contains:

These tasks are described in the topics that follow.

Creating the EJB

This step creates a Session Bean, along with the .wsdl files describing it (the EJB service and bindings).

  1. In the Package Explorer view, select the JMSServices .wsdl file. (Note that because the service project is identical for all four interaction patterns, this can be the same JMSServices file generated when you created the service project for the Agent Delivery interaction pattern.)
  2. Right-click the file and choose Enterprise Services>Generate Deploy Code. The Generate Deploy Code dialog displays.

  3. In the Port Name drop-down, select the port name for this interaction pattern.
  4. Select Create a new port and binding.
  5. In the Inbound binding type drop-down, select EJB, JMS, or SOAP. Your selection affects the WSDL files generated, for the EJB access you get the EJB Bindings and Service files.
  6. Choose Next. The Inbound Service Files dialog appears.

  7. In the Inbound Service Files dialog, specify a meaningful package name for both the port name and the binding name.
  8. Choose Next. The EJB Port dialog appears, with a field that specifies a JNDI name as an EJB port property. Accept the default value.
  9. Use the Deployment Descriptor editor to map JNDI names to a queue connection factory name and a queue name.



  10. An EJB that represents Hub One Way is completed. You can deploy it or use it as any other WebSphere Application Server component.

Create an application client project for testing

To be able to test the complete application package, you may optionally choose to add a client project to the Enterprise Application Archive file. Create the Enterprise Application Archive Client project with the client class. In the main() method of the class, the code should do the lookup of the EJB and invoke its appropriate business method. Before the application client can be run, you will need to specify the name of the class containing the main() method of the client in the Application Client deployment descriptor.

To create the application client project:

  1. In the Package Explorer view, choose File>New project and choose J2EE>Application Client Project. Choose Next.
  2. In the J2EE Specification version dialog, choose Create J2EE 1.3 Application Client project. Choose Next.
  3. In the Application Client project creation dialog, provide a project name, check Existing, and browse to select the name of the source Enterprise Application Archive project containing the EJB you created in the previous task. Choose Next.
  4. The Module Dependencies dialog appears, with a list of available dependent JAR files. Mark the boxes for the JAR files that should be included in the Enterprise Application Archive project with this module, and choose Finish.

  5. To create a package within the client application, in the Package Explorer view, select the application client module that you have created, and choose the Create a Java Package button from the toolbar. The New Java Package dialog appears. Enter a name for the package and choose Finish. A folder with that package name is added under the application client module folder.
  6. To create a Java class in which to add logic, select the application client folder and choose the Create Java Class button from the menu bar.
  7. The New Java Class dialog appears. In the Package field, select the client package that you created previously; provide a name for the class; specify Public for modifiers; and specify public static void and inherited abstract methods for the method stubs to be created.

  8. Choose Finish.
  9. Open the Java class and add your logic.
  10. Add necessary Jar files. To do so, in Package Explorer select and right-click the application client, choose Properties, and choose Java Build Path. The Java Build Path panel displays.
  11. Choose the Libraries tab, choose Add External Jars, and navigate to the directory in which you installed WebSphere Studio Application Developer Integration Edition, and expand the \runtime\ee_v5\lib folder. Select the files, including wsatlib.jar, wsdl4j.jar, wsif.jar, qname.jar.

  12. Click OK.
  13. Update the application client package using the
    Deployment Descriptor Editor. To do so: In Package Explorer, expand the META-INF folder under the application client module, and select the application-client.xml file. Right click the file, and choose Open With>Deployment Descriptor Editor. The Client Deployment Descriptor dialog appears.

  14. Add the Main-Class name. The Application client is ready to use.

Copyright IBM Corp. 1997, 2004