Chapter 6. Using Host Publisher Studio to develop J2EE applications 215
IO Properties class
Helper class (see Figure 6-85)
Figure 6-85 IO Properties and Helper classes
2. To create Web Services for an EJB access bean, select Create EJB 1.1 Integration
Object Support. This creates all necessary support files. See Figure 6-84 on page 213.
3. When you finish creating IOs, use Application Integrator to package the IOs or EJB access
beans into an EAR file and import a WAR or EAR file into WebSphere Studio Application
Developer. See 6.9, Application Integrator Advanced on page 235. Before you export it to
WebSphere Studio Application Developer, test your IOs with your WebSphere
Applications Server.
6.8.6 Creating Web Services in WebSphere Studio Application Developer with
Host Publisher Web Services support
This section explains how to create Web Services in WebSphere Studio Application
Developer V4.0.3 with Host Publisher Web Services Support function.
The basic steps include:
1. Starting Host Publisher Server in WebSphere Studio Application Developer on page 215
2. Importing the EAR file containing IOs or EJB access beans on page 222
3. Creating Web Services for IOs and EJB access beans on page 226
4. Running the Web Services sample generated by WebSphere Studio Application
Developer on page 230
5. Deploying the completed application to WebSphere Advanced Edition or Advanced
Single Server Edition on page 233
Starting Host Publisher Server in WebSphere Studio Application
Developer
Use the sample code for starting and stopping Host Publisher Server to create servlets that
start and stop Host Publisher Server:
1. Start the WebSphere Studio Application Developer. Click Start-> Programs-> IBM
WebSphere Studio-> IBM WebSphere Studio Application Developer.
2. Select Web Project to create it (Figure 6-86). Click Next.
216 iSeries Access for Web V5R2 and WebSphere Host Publisher V4.0
Figure 6-86 New Web Project
3. Name the new project, for example HPRTE.
4. On the Define Java Build Settings window (Figure 6-87), click the Add External JARs
button.
Chapter 6. Using Host Publisher Studio to develop J2EE applications 217
Figure 6-87 Defining the Java Build Settings
5. On the JAR Selection window (Figure 6-88), select the external JAR files (highlighted in
the example) that contain the classes that Host Publisher Server requires from the
C:\HostPub\Common directory so that the code will compile. Click Open.
Figure 6-88 External JAR files
218 iSeries Access for Web V5R2 and WebSphere Host Publisher V4.0
6. Import the servlet code for starting and stopping Server into Web Project. Update the code
to match your server installation. On the File system window (Figure 6-89), select the Start
and Stop programs (StartHPRTE.java and StopHPRTE.java) to import them from the
C:\HostPub\SDK\Server directory to your new project. Click Finish.
Figure 6-89 Importing the Start and Stop programs
7. Update the code that starts Host Publisher Server to match your Host Publisher
installation in the Application Developer window (Figure 6-90):
a. Double-click the StartHPRTE.java source code.
b. Search for the HP_INSTALL_DIR variable and update it to match your Host Publisher
Studio installation directory.
c. Save it.
Chapter 6. Using Host Publisher Studio to develop J2EE applications 219
Figure 6-90 Changing the Host Publisher installation path
8. Run the servlet. WebSphere Studio Application Developer creates an internal WebSphere
server instance. Execution of the servlet fails because WebSphere cannot access the
classes that Host Publisher Server requires.
a. In the Navigator panel, select the StartHPRTE program, right-click, and select Run on
Server (Figure 6-91).

Get iSeries Access for Web V5R2 and WebSphere Host Publisher V4.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.