Attachmate Worldwide  |   Contact Us  |   NetIQ.com
Home » Support » Solution Library

Technical Notes

Using a Third-Party Package in a Java Web Service Project
Technical Note 10043
Last Reviewed 17-Aug-2006
Applies To
Verastream Host Integrator version 5.5 or higher
Summary

This technical note explains how to use a third-party package in a Java web service project generated by the Verastream Host Integrator Web Builder.

Using a Third-Party Package

Use one of the following procedures to add third-party Java code (.jar package file) to a Java Web Service project created by Verastream Web Builder.

Modifying a Single Java Web Service Project

Follow the steps below to use a third-party package in a single web service project. If you plan to create multiple projects that require the reference to this third-party package, you may want to create a User-Defined Project Type. If so, follow the steps in Creating a User-Defined Project Type for Multiple Projects.

  1. Copy the third-party jar file to the <VHI path>\tomcat\webapps\axis\WEB-INF\lib directory.
  2. Modify the web service project's build.xml file, <VHI path>\projects\<project_name>\build.xml, to include the third-party jar file as a fileset. The following example configures Verastream to use the third-party package oracle.jar (shown in red below).
<!-- compile -->
<target name="compile" description="Compiling Web Service">
 <mkdir dir="${blddir}"/>
 <!-- we must use debug="true" or axis will not show parameter names in the wsdl -->
 <javac srcdir="${srcdir}" destdir="${blddir}" debug="true">
  <classpath>
   <fileset dir="${vhiroot}/${vhijardir}">
    <include name="apptrieve.jar"/>
    <include name="vhiprop.jar"/>
    <include name="wcp.jar"/>
   </fileset>
   <fileset dir = "${vhiroot}/${axislibdir}">
    <include name = "axis.jar"/>
    <include name = "jaxrpc.jar"/>
         <include name = "oracle.jar"/>
   </fileset>
  </classpath>
 </javac>
 <antcall target="configure" />
</target>

  1. Save the changes.
  2. In the <VHI path>\projects\<project name>\client\<client name>.java Java code of your web service project, add a line to import the third-party package. For example, for the oracle package, add:
import oracle.jdbc.driver.*;
  1. In the Web Builder, rebuild the web service project and choose to keep the user changes when prompted.

Creating a User-Defined Project Type for Multiple Projects

If you plan to create multiple projects that require the reference to this third-party package, you may want to create a User-Defined Project Type based on the default Java Web Service project. This will allow you to use the same customized project template for multiple applications.

To create a User-Defined Project Type, follow the steps below.

  1. Copy the third-party jar file to the <VHI path>\tomcat\webapps\axis\WEB-INF\lib directory.
  2. Open Web Builder and click Options > User-Defined Project Types.
  3. Click New.
  4. In the Copy this Project Type list, select the appropriate project type. For example, Java Web Service.
  5. In the Name field, modify the project type name. For example, Oracle Java Web Service.
  6. In the Description field, modify the project type description.
  7. Click Build. When the build is done, click Close.
  8. Select the new project type and click Explore. An Explorer window will open and <VHI path>\lib\webbuilder\userpluginprojects\<project type name>\resources\task will be selected.
  9. Click the Project folder (at the same level as task) and open the build.xml file.

Note: If you need to access this file at a later time, the file is located at <VHI path>\webbuilder\userpluginprojects\<project type name>\resources\Project\build.xml.

  1. Modify the build.xml file to include the third-party jar file as a fileset. The following example configures the Verastream web builder project to use the third-party package oracle.jar (shown in red below).

Locate the "Compiling Web Services" section, and add

    <include name = "axis.jar"/>
    <include name = "jaxrpc.jar"/>
         <include name = "oracle.jar"/>

  1. Save the changes and close the Explorer window.
  2. Click on the Web Builder window. A dialog box appears stating that you have modified the source file for your User-Defined Project Type and asking if you want to rebuild it. Click Yes.

Note: If this dialog box is not displayed, click Options > User-Defined Project Types.

To use the new user project template, in Web Builder click Project > New and select the new project from the Project Type list.

Related Technical Notes
10040 Deploying a Verastream Web Service Project to a Windows Server
40024 Deploying a Verastream Web Service Project to a Linux/UNIX Server
40999 Verastream Host Integrator Technical Notes

Did this technical note answer your question?

Yes    No    Somewhat     Not sure yet

Additional comments about this tech note:

Need further help? For technical support, please contact Support.