Skip Headers
Oracle® Application Server Web Services Developer's Guide
10g Release 3 (10.1.3)
B14434-01
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

3 Getting Started

The README.txt file that is included at the top level of the OC4J distribution provides instructions for setting up and running OC4J. This chapter serves as an addendum to the README. It provides information that is specific to setting up Oracle Application Server Web Services in your environment.

This chapter provides the following sections.

Supported Platforms

OracleAS Web Services is supported on the following platforms.

Installing OC4J

Follow the instructions in the README.txt file for installing and running OC4J. The README.txt file can be found at the top-level of the OC4J distribution.

Setting Up Your Environment for OracleAS Web Services

This section lists the software you must install and environment variables you must define to use OracleAS Web Services.

Setting Up Ant for WebServicesAssembler

The WebServicesAssembler tool assists in assembling OracleAS Web Services. It enables you to generate the artifacts required to develop and deploy Web services, regardless of whether you are creating the service using the top down or bottom up approach. WebServicesAssembler commands can be called either from the command line or from Ant tasks.

This section describes how to set up your environment and build script files to call WebServicesAssembler commands from Ant tasks.You can use an Ant installation you have previously installed or use the Ant that is found in OC4J_HOME/ant. The following sections describe how to set up Ant, depending on the version you have installed.


Note:

All of the Ant task examples in this book assume that you are using Ant version 1.6.2 or later. These versions let you use task namespaces. Hence, all of the Ant tags and subtags corresponding to WebServicesAssembler commands are prefixed with the oracle: namespace.

Setting Up Ant 1.6.2 Distributed with Oracle Application Server

The following steps describe how to set up your environment and build files to use WebServicesAssembler with the Ant 1.6.2 installation found in ORACLE_HOME/ant. This is the version of Ant distributed with the Oracle Application Server.

  1. Enter ORACLE_HOME/ant/bin at the front of your PATH variable.

  2. Edit your build script (build.xml). Add the antlib:oracle namespace declaration for the imported Ant tasks. In the following example, bottomup is the name of your project.

    <project name="bottomup" default="all" basedir="." xmlns:oracle="antlib:oracle">
    
    
  3. Add the oracle: namespace as a prefix to all WebServicesAssembler tags. For example:

    <oracle:assemble ....>
            <oracle:port ... />
    </oracle:assemble>
    <oracle:genProxy ..../>
    
    
  4. (Optional) Copy the ant-oracle.properties files to the same directory as your build script.

    Although you can modify the properties file in the j2ee/utilities directory and reference it from your build scripts, it is better to maintain this file as a template.

  5. (Optional) Edit the ant-oracle.properties file to reflect your installation environment.

  6. (Optional) Edit the build script (build.xml). Reference the ant-oracle.properties file in the build script. For example:

    <property file="ant-oracle.properties"/> 
    
    
  7. (Optional) If you will be using the junit Ant task for reports, set the ANT_OPTS system property to the Xalan TransformerFactoryImpl class.

    • If you are using the JDK 1.5, set the ANT_OPTS property for TransformerFactory to com.sun.org.apache.xalan.int/ernal.xsltc.trax.TransformerFactoryImpl. For example:

      set ANT_OPTS=-Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.int/ernal.xsltc.trax.TransformerFactoryImpl  
      
      
    • If you are using the JDK 1.4, set the ANT_OPTS property for TransformerFactory to org.apache.xalan.processor.TransformerFactoryImpl. For example:

      set ANT_OPTS=-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl 
      

Setting Up Ant 1.6.2 Using a Previous Installation of Ant

The following steps describe how to set up your environment and build files to use WebServicesAssembler with a previous installation of Ant 1.6.2 (or later).

  1. Navigate to the directory ORACLE_HOME/j2ee/utilities and ensure that the following files are present:

    • ant-oracle.properties—this file enables you to designate the key properties for the execution of the Oracle Ant tasks.

    • ant-oracle.xml—this file enables you to use Oracle Ant tasks. Import this file into your build script by using the Ant <import> task.

  2. Copy the ant-oracle.properties and ant-oracle.xml files to the same directory as your build script (build.xml).

    Although you can modify the files in the j2ee/utilities directory and reference them from your build scripts, it is better to maintain the source files as templates. Also, if you leave the ant-oracle.xml file in its original location, then the import reference must be hard coded to specify the full path to the file (for example, c:/oc4j/j2ee/utilities/ant-oracle.xml).

  3. Edit the ant-oracle.properties file to reflect your installation environment.

  4. Edit the build script (build.xml).

    • Import the ant-oracle.xml file into the build script.

      <!-- Import for OC4J ant integration. -->
      <import file="ant-oracle.xml"/>
      
      
    • Add the antlib:oracle namespace reference for the imported Ant tasks. In the following example, bottomup is the name of your project.

      <project name="bottomup" default="all" basedir="." xmlns:oracle="antlib:oracle">
      
      
  5. Include the oracle namespace as a prefix to all WebServicesAssembler commands. For example:

    <oracle:deploy ..../>
    <oracle:genProxy ..../>
    
    
  6. (Optional) If you will be using the junit Ant task for reports, set the ANT_OPTS system property to the Xalan TransformerFactoryImpl class.

    • If you are using the JDK 1.5, set the ANT_OPTS property for TransformerFactory to com.sun.org.apache.xalan.int/ernal.xsltc.trax.TransformerFactoryImpl. For example:

      set ANT_OPTS=-Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.int/ernal.xsltc.trax.TransformerFactoryImpl  
      
      
    • If you are using the JDK 1.4, set the ANT_OPTS property for TransformerFactory to org.apache.xalan.processor.TransformerFactoryImpl. For example:

      set ANT_OPTS=-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl 
      

Setting Up Ant 1.5.2 Using a Previous Installation of Ant

The following steps describe how to set up your environment and build files to use WebServicesAssembler with a previous installation of Ant 1.5.2.

  1. Ensure that your installations of Ant and the Java JDK are already included in the classpath environment variable.

  2. Add the path to the wsa.jar to the classpath environment variable. The path will typically be:

    (OC4J_Home)webservices/lib/wsa.jar 
    
    

    In this example, OC4J_Home is the directory where you installed OC4J.

  3. Add the following lines to any Ant build file that will invoke the Ant tasks.

    <taskdef resource="orawsa.tasks" />
    <typedef resource="orawsa.types" />
    
    

    These lines can appear anywhere in the build file before the first WebServicesAssembler task is called.

  4. (Optional) If you will be using the junit Ant task for reports, set the ANT_OPTS system property to the Xalan TransformerFactoryImpl class.

    • If you are using the JDK 1.5, set the ANT_OPTS property for TransformerFactory to com.sun.org.apache.xalan.int/ernal.xsltc.trax.TransformerFactoryImpl. For example:

      set ANT_OPTS=-Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.int/ernal.xsltc.trax.TransformerFactoryImpl  
      
      
    • If you are using the JDK 1.4, set the ANT_OPTS property for TransformerFactory to org.apache.xalan.processor.TransformerFactoryImpl. For example:

      set ANT_OPTS=-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl 
      

Using the "oracle:" namespace Prefix for Ant Tasks

Ant version 1.6.2 and higher requires the oracle: prefix at the beginning of all Ant tags and subtags for WebServicesAssembler commands. This prefix informs the Ant interpreter that this is an Oracle Ant task.

The oracle: prefix corresponds to the prefix that is found in the project tag at the beginning of the Ant build.xml file.

<project name="myproject" default="all" basedir="." xmlns:oracle="antlib:oracle">

If you do not want to use oracle as a prefix, you can change it to any valid XML QName prefix. For example, if you want to use oracletags as a prefix, then you must change the value of the project tag.

<project name="myproject" default="all" basedir="." xmlns:oracletags="antlib:oracle">

If you make this change, then all Ant tags and subtags for WebServicesAssembler commands must start with oracletags:. For example:

<oracletags:assemble ...>

Database Requirements

You will need an installed running Oracle database (local or remote) if you will be performing any of the following tasks:

Development and Documentation Roadmap

The following sections provide a suggested roadmap through the documentation that takes you through the steps of developing a Web service.

Setting Up Your Environment

The following chapter describes how to set up your environment to use the functionality provided by OracleAS Web Services.

Best Coding Practices

The chapters in this section describe issues that you should consider as you design your Web service.

The following chapter describes the varieties of message formats that you can employ in OracleAS Web Services. It describes the advantages and disadvantages of each message format and suggests which format to use based on the client functionality.

The following chapter in the Oracle Application Server Advanced Web Services Developer's Guide identifies some of the common areas where interoperability problems can occur. It provides design suggestions and programming guidelines that increase the interoperability of your Web service with applications on different platforms.

Assembling Web Service Artifacts

OracleAS Web Services enables you to assemble Web service artifacts bottom up starting from Java classes, EJBs, JMS destinations, database resources, or source files which employ J2SE 5.0 JDK Web Service Annotations. You can also assemble the artifacts top down starting from a WSDL. In OracleAS Web Services, you use the WebServicesAssembler tool to perform the assembly. Chapter 17, "Using WebServicesAssembler" provides a reference guide to the tool.

The following chapters describe how to use the WebServicesAssembler tool to perform the different types of Web Service assembly supported by OracleAS Web Services.

Deploying the Web Service

While the WebServicesAssembler tool does not perform deployment, it does package the Web service into a deployable EAR or WAR file. Deploying this file is very similar to deploying any other EAR or WAR file into a running instance of OC4J. OC4J provides a separate book that describes how to perform deployment.

The following chapter provides additional information about the packaging format and the files required for deployment. The chapter also briefly describes the deployment support offered by the JDeveloper and Application Server Control tools.

Testing the Deployed Web Service

The following chapter describes the Web Service Home Page. This page lets you test whether deployment was successful without the need to write any code.

Assembling a Web Service Client

The following chapters describe how to use WebServicesAssembler to assemble a Web service client for the J2SE and J2EE platforms.

Adding Quality of Service Features to a Web Service

OracleAS Web Services support quality of service features, such as security, reliability, message logging, and auditing. The following chapters describe how to implement these features; they can be managed by other tools such as JDeveloper and Application Server Control. The following chapters appear in the Oracle Application Server Advanced Web Services Developer's Guide.

Adding Advanced Functionality to a Web Service

The following chapters describe additional features that can enhance the performance and functionality of your Web service.

See also the following chapters in the Oracle Application Server Advanced Web Services Developer's Guide.

Alternative Web Service Strategies

The following chapters describe alternative modes of Web service implementation.

For example, you can write your own infrastructure to make Web service calls, create a client for non-SOAP protocols, or use a non-HTTP transport mechanism.

See also the following chapters in the Oracle Application Server Advanced Web Services Developer's Guide.

Reference Chapters and Appendixes

The following chapters and appendixes provide information to supplement the implementation and development tasks described in this book.

See also the following reference chapters and appendixes in the Oracle Application Server Advanced Web Services Developer's Guide.