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:
- The Session Bean that invokes the JMS service and can be used from any
J2EE application. The Session Bean has a business method for each
operation of the deployed (JMS) Port Type.
After creating the Session Bean, you must configure it, using the
Deployment Descriptor editor, to perform necessary WebSphere mappings between
JNDI names and the queue names and connection factory names derived from the
.wsdl file.
- Helper classes that represent the .xsd files as java beans, and
format handler java beans that convert XML to java, as specified in the
.wsdl file.
These tasks are described in the topics that follow.
This step creates a Session Bean, along with the .wsdl files
describing it (the EJB service and bindings).
- 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.)
- Right-click the file and choose Enterprise Services>Generate Deploy
Code. The Generate Deploy Code dialog displays (see Figure 45).
Figure 45. Generate Deploy Code for hub one way

- In the Port Name drop-down, select the port name for this interaction
pattern.
- Select Create a new port and binding.
- 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.
- Choose Next. The Inbound Service Files dialog appears.
Figure 46. Inbound Service Files dialog

- In the Inbound Service Files dialog, specify a meaningful package name for
both the port name and the binding name.
- Choose Next. The EJB Port dialog appears, with a field that
specifies a JNDI name as an EJB port property. Accept the default
value.
- Use the Deployment Descriptor editor to map JNDI names to a queue
connection factory name and a queue name (see Figure 47 and Figure 48).
Figure 47. Mapping JNDI names, part 1

Figure 48. Mapping JNDI names, part 2

- An EJB that represents Hub One Way is completed. You can deploy it
or use it as any other WebSphere Application Server component.
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:
- In the Package Explorer view, choose File>New project and choose
J2EE>Application Client Project. Choose Next.
- In the J2EE Specification version dialog, choose Create J2EE 1.3
Application Client project. Choose Next.
- 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.
- The Module Dependencies dialog appears (see Figure 49), 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.
Figure 49. Module Dependencies dialog

- 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.
- 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.
- The New Java Class dialog appears (see Figure 50). 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.
Figure 50. New Java Class dialog

- Choose Finish.
- Open the Java class and add your logic.
- 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.
- 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 (see Figure 51).
Figure 51. Selecting jar files

- Click OK.
- 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 (see Figure 52).
Figure 52. Client Deployment Descriptor dialog

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