You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2006/06/02 13:48:59 UTC

svn commit: r411132 - /webservices/axis2/site/tools/1_0/CodegenToolReference.html

Author: ajith
Date: Fri Jun  2 04:48:58 2006
New Revision: 411132

URL: http://svn.apache.org/viewvc?rev=411132&view=rev
Log:
Correcting a wrong entry in the reference

Modified:
    webservices/axis2/site/tools/1_0/CodegenToolReference.html

Modified: webservices/axis2/site/tools/1_0/CodegenToolReference.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/tools/1_0/CodegenToolReference.html?rev=411132&r1=411131&r2=411132&view=diff
==============================================================================
--- webservices/axis2/site/tools/1_0/CodegenToolReference.html (original)
+++ webservices/axis2/site/tools/1_0/CodegenToolReference.html Fri Jun  2 04:48:58 2006
@@ -1,574 +1,574 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Axis 2.0 - Code Generator-Command Line Tool</title><style type="text/css" media="all">
-          @import url("../../style/maven-base.css");
-          
-			    @import url("../../style/maven-theme.css");</style><link rel="stylesheet" href="../../style/print.css" type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta></head><body class="composite"><div id="banner"><a href="http://www.apache.org/" id="organizationLogo"><img alt="Apache Software Foundation" src="http://www.apache.org/images/asf-logo.gif"></img></a><a href="http://ws.apache.org/axis2/" id="projectLogo"><img alt="Apache Axis 2.0" src="http://ws.apache.org/axis2/images/axis.jpg"></img></a><div class="clear"><hr></hr></div></div><div id="breadcrumbs"><div class="xleft">
-                	Last published: 05 May 2006
-                  | Doc for 1.0</div><div class="xright"></div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div id="navcolumn"><div id="menuAxis_2_0"><h5>Axis 2.0</h5><ul><li class="none"><a href="../../index.html">Home</a></li><li class="expanded"><a href="../../">Downloads</a><ul><li class="none"><a href="../../download.cgi">Releases</a></li><li class="none"><a href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/?root=Apache-SVN" class="externalLink" title="External Link">Source Code</a></li><li class="none"><a href="../../modules/index.html">Modules</a></li><li class="none"><a href="../../tools/index.html">Tools</a></li></ul></li><li class="expanded"><a href="../../">Documentation</a><ul><li class="none"><a href="../../1_0/index.html">Version 1.0</a></li><li class="none"><a href="../../0_95/index.html">Version 0.95</a></li><li class="none"><a href="../../0_94/index.html">Version 0.94</a></li><li class="none"><a href="../../0_93/index.html">Ver
 sion 0.93</a></li></ul></li><li class="expanded"><a href="../../overview.html">Get Involved</a><ul><li class="none"><a href="../../svn.html">Checkout the Source</a></li><li class="none"><a href="../../siteHowTo.html">Build the Site</a></li><li class="none"><a href="../../guidelines.html">Developer Guidelines</a></li><li class="none"><a href="../../refLib.html">Reference Library</a></li><li class="none"><a href="../../mail-lists.html">Mailing Lists</a></li><li class="none"><a href="../../faq.html">FAQ</a></li></ul></li><li class="none"><a href="../../thanks.html">Acknowledgements</a></li><li class="none"><a href="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="External Link">License</a></li><li class="expanded"><a href="../../">Project Information</a><ul><li class="none"><a href="../../team-list.html">Project Team</a></li><li class="none"><a href="../../issue-tracking.html">Issue Tracking</a></li></ul></li></ul></div><a href="http://maven.apache.o
 rg/" title="Built by Maven" id="poweredBy"><img alt="Built by Maven" src="../../images/logos/maven-button-1.png"></img></a></div></div><div id="bodyColumn"><div class="contentBox"><div class="section"><a name="Code_Generator_Tool-_Command_Line_and_Ant_Task"></a><h2>Code Generator Tool- Command Line and Ant Task</h2><p>The Code Generator tool consists of a command line version and an Ant
-Task. This document will list the command line references and Ant task
-references. Also in detail, this document shows how to build file using
-custom Ant task and invoking the Code Generator from Ant.</p><p>This tool is bundled with the Axis2 base distribution found <a href="http://ws.apache.org/axis2/download.cgi" class="externalLink" title="External Link">here</a>.</p><div class="subsection"><a name="Content"></a><h3>Content</h3><ul>
-  <li><a href="#intro">Introduction</a></li>
-  <li><a href="#cmdline">Command Line Version</a>
-    <ul>
-      <li><a href="#cmdref">Option Reference</a></li>
-    </ul>
-  </li>
-  <li><a href="#ant">Ant Task</a>
-    <ul>
-      <li><a href="#antref">Ant Task Reference</a></li>
-      <li><a href="#example">Example Build File Using the Custom Ant
-      Task</a></li>
-      <li><a href="#invoking">Invoking the Code Generator From Ant</a></li>
-    </ul>
-  </li>
-  <li><a href="#appendix">Appendix</a></li>
-</ul><p><a name="intro"></a></p></div><div class="subsection"><a name="Introduction"></a><h3>Introduction</h3><p>This basic tool is implemented by the WSDL2Code class and just for the
-convenience in the case of java (which would be the majority) there is
-another WSDL2Java class. One can choose to run the main classes directly or
-use one of the scripts to run the WSDL2Code and WSDL2Java appropriately. (the
-scripts are found in the bin directory of the binary distribution)</p><p><a name="cmdline"></a></p></div><div class="subsection"><a name="Command_Line_Version"></a><h3>Command Line Version</h3><p>For those users who wish to use the command line version of the tool, this
-section will be of value.</p><p><a name="cmdref"></a></p></div><div class="subsection"><a name="Option_Reference"></a><h3>Option Reference</h3><table class="bodyTable"><tbody>
-    <tr class="b"><td width="20%"><strong>Short Option</strong></td><td width="20%"><strong>Long Option</strong></td><td width="60%"><strong>Description</strong></td><td></td></tr>
-    <tr class="a"><td width="20%">-uri &lt;Location of WSDL&gt;</td><td width="20%">None</td><td width="60%">WSDL file location. This should point to a WSDL file in
-        the local file system</td><td></td></tr>
-    <tr class="b"><td width="20%">-o &lt;output Location&gt; :</td><td width="20%">--output</td><td width="60%">output file location. This is where the files would be
-        copied once the code generation is done. If this option is omitted
-        the generated files would be copied to the working directory.</td><td></td></tr>
-    <tr class="a"><td width="20%">-l &lt;language&gt;</td><td width="20%">--language</td><td width="60%">Output language. Currently the code generator can
-        generate code in Java but it has the ability to be extended to
-        support other languages</td><td></td></tr>
-    <tr class="b"><td width="20%">-p &lt;package name&gt;</td><td width="20%">--package</td><td width="60%">The target package name. If omitted, a default package
-        (formed using the target namespace of the WSDL) will be used.</td><td></td></tr>
-    <tr class="a"><td width="20%">-a</td><td width="20%">--async</td><td width="60%">Generate code only for async style . when this option
-        is used the generated stubs will have only the asynchronous
-        invocation methods. Switched off by default.</td><td></td></tr>
-    <tr class="b"><td width="20%">-s</td><td width="20%">--sync</td><td width="60%">Generate code only for sync style . When this option is
-        used the generated stubs will have only the  synchronous invocation
-        methods. Switched off by default. When used with the -a option, this
-        takes precedence.</td><td></td></tr>
-    <tr class="a"><td width="20%">-t</td><td width="20%">--test-case</td><td width="60%">Generates a test case. In the case of Java it would be
-        a junit test case.</td><td></td></tr>
-    <tr class="b"><td width="20%">-ss</td><td width="20%">--server-side</td><td width="60%">Generates server side code (i.e. skeletons). Default is
-        off</td><td></td></tr>
-    <tr class="a"><td width="20%">-sd</td><td width="20%">--service-description</td><td width="60%">Generates the service descriptor (i.e. server.xml).
-        Default is off. only valid with -ss, the server side code generation
-        option</td><td></td></tr>
-    <tr class="b"><td width="20%">-d</td><td width="20%">--databinding-method</td><td width="60%">Specifies the Databinding framework. valid values are
-        xmlbeans, adb, jibx, and none. Default is adb.</td><td></td></tr>
-    <tr class="a"><td width="20%">-g</td><td width="20%">--generate-all</td><td width="60%">Generates all the classes. This option is valid only
-        with the -ss (server side code generation) option. When on, the
-        client code (stubs) will also be generated along with the
-      skeleton.</td><td></td></tr>
-    <tr class="b"><td width="20%">-u</td><td width="20%">--unpack-classes</td><td width="60%">Unpack classes. This option specifies whether to unpack
-        the classes and generate separate classes for the databinders.</td><td></td></tr>
-    <tr class="a"><td width="20%">-sn</td><td width="20%">--service-name</td><td width="60%">Specifies the service name to be code generated. If the
-        service name is is not specified, then the first service will be
-        picked</td><td></td></tr>
-    <tr class="b"><td width="20%">-pn</td><td width="20%">--port-name</td><td width="60%">Specifies the port name to be code generated. If the
-        port name is is not specified, then the first port (of the selected
-        service) will be picked</td><td></td></tr>
-    <tr class="a"><td width="20%">-ns2p</td><td width="20%">--namespace2package</td><td width="60%">Specifies a comma seperated list of namespaces and
-        packages where the given package will be used in the place of the
-        auto generated package for the relevant namespace. The list will be
-        the format of ns1=pkg1,ns2=pkg2.</td><td></td></tr>
-    <tr class="b"><td width="20%">-ssi</td><td width="20%">--serverside-interface</td><td width="60%">Generate an interface for the service skeleton 
-</td><td></td></tr>
-  </tbody></table><p>Apart from these mentioned options one can pass extra option by prefixing
-them with -E (uppercase). These extra options will be processed by the
-extensions. The extra options that can be passed are documented separately
-with the extensions documentation (For example with ADB)</p><p><a name="ant"></a></p></div><div class="subsection"><a name="Ant_Task"></a><h3>Ant Task</h3><p>The code generator also comes bundled with an Ant task. The ant task is
-implemented by the org.apache.axis2.tool.ant.AntCodegenTask class. Following
-are the ant task attributes.</p><p><a name="antref"></a></p></div><div class="subsection"><a name="Ant_Task_Reference"></a><h3>Ant Task Reference</h3><table class="bodyTable"><tbody>
-    <tr class="a"><td>wsdlfilename</td><td>WSDL file location. Maps to the uri option of the command line
-      tool</td></tr>
-    <tr class="b"><td>output</td><td>output file location. This is where the files would be copied once
-        the code generation is done. If this option is omitted the generated
-        files would be copied to the working directory. . Maps to the -o
-        option of the command line tool</td></tr>
-    <tr class="a"><td>language</td><td>Output language. Currently the code generator can generate code in
-        Java. Maps to the -l option of the command line tool</td></tr>
-    <tr class="b"><td>packagename</td><td>The target package name. If omitted, a default package (formed
-        using the target namespace of the WSDL) will be used. Maps to the -p
-        option of the command line tool.</td></tr>
-    <tr class="a"><td>asynconly</td><td>Generate code only for async style . when this option is used the
-        generated stubs will have only the asynchronous invocation methods.
-        Defaults to false if omitted Only true and false are applicable as
-        values. Maps to the -a option of the command line tool.</td></tr>
-    <tr class="b"><td>testcase</td><td>Generates a test case</td></tr>
-    <tr class="a"><td>synconly</td><td>Generate code only for sync style . when this option is used the
-        generated stubs will have only the synchronous invocation methods.
-        Defaults to false if omitted. Only true and false are applicable as
-        values. Maps to the -s option of the command line tool.</td></tr>
-    <tr class="b"><td>serverside</td><td>Generates server side code (i.e. skeletons). Only true and false
-        are applicable as values. Default is false. Maps to the -ss option of
-        the command line tool</td></tr>
-    <tr class="a"><td>generateserverxml</td><td>Generates server side code (i.e. skeletons). Only true and false
-        are applicable as values. Default is false. Maps to the -sd option of
-        the command line tool.</td></tr>
-    <tr class="b"><td>unpackClasses</td><td>Unpacks the generated classes. This forces the databinding classes
-        to be generated separately, which otherwise would have been generated
-        as inner classes.</td></tr>
-    <tr class="a"><td>serviceName</td><td>The name of the service in the case of multiple services</td></tr>
-    <tr class="b"><td>portName</td><td>The name of the port in the presence of multiple ports</td></tr>
-    <tr class="a"><td>namespaceToPackages</td><td>A list of namespace to package mappings</td></tr>
-<tr class="b"><td>serverSideInterface</td><td>flag stating whether to generate an interface for the server side skeleton</td></tr>
-  </tbody></table><p><a name="example"></a></p></div><div class="subsection"><a name="Example_Build_File_Using_the_Custom_Ant_Task"></a><h3>Example Build File Using the Custom Ant Task</h3><p>Following is an example ant build file that uses the custom Ant task.</p>
-    <div class="source"><pre>&lt;?xml version="1.0"?&gt;
-&lt;project name="CodegenExample" default="main" basedir="."&gt;
-&lt;target name="declare" &gt;
-&lt;taskdef name="codegen"
- classname="org.apache.axis2.tool.ant.AntCodegenTask"
- classpath="classes"/&gt;
-&lt;/target&gt;
-&lt;target name="main" depends="declare"&gt;
-&lt;codegen 
- wsdlfilename="C:\test\wsdl\CombinedService.wsdl"
- output="C:\"
- serverside="true"
- generateserverxml="true"/&gt;
-&lt;/target&gt;
-&lt;/project&gt;
-
-</pre></div>
-  <p>Notice the main target that uses the "codegen" task which will use the
-org.apache.axis2.tool.ant.AntCodegenTask class and run the code generation
-tool internally while passing the relevant arguments and do the proper
-generation. If a user types</p><p>&gt;ant or &gt;ant main</p><p>it will generate the server side code and services.xml for the given WSDL
-file(C:\test\wsdl\CombinedService.wsdl) and the generated code will be
-written to C:\ directory.</p><p>For this Ant task to work the following jars need to be in the class
-path.</p><ul>
-  <li>axis-*.jar (from the Axis2 distribution)</li>
-  <li>axis-wsdl4j-1.2.jar or higher (The WSDL4J implementation jar. Bundled
-    with the Axis2 distribution)</li>
-  <li>stax-api-1.0.jar (The StAX API's that contain the
-    javax.xml.namespace.QName class. This jar may be replaced by any other
-    jar that contains the javax.xml.namespace.QName implementation. However
-    Axis2 uses this class from the stax-api-1.0.jar which comes bundled with
-    the Axis2 distribution)</li>
-</ul><p><a name="invoking"></a></p></div><div class="subsection"><a name="Invoking_the_Code_Generator_From_Ant"></a><h3>Invoking the Code Generator From Ant</h3><p>Since the users may find altering their ant class path a bit daunting they
-can also follow an easier technique. The code generator main class can be
-invoked directly through the build file.</p><p>Below is an example of a full build.xml needed to run WSDL2Java and
-generate the Java source files, compile the sources, and build an AAR file
-ready for deployment:</p>
-    <div class="source"><pre>&lt;!DOCTYPE project&gt;
-
-&lt;project name="wsdl2java-example" default="usage" basedir="."&gt;
-
-  &lt;property name="project-name" value="wsdl2java-example"/&gt;
-  &lt;property file="build.properties"/&gt;
-  
-  &lt;property name="build" value="build"/&gt;
-  &lt;property name="src" value="src"/&gt;
-  &lt;property name="build.classes"      value="build/classes" /&gt;
-
-  &lt;path id="axis.classpath"&gt;
-     &lt;pathelement location="build/classes" /&gt;
-     &lt;fileset dir="${axis.home}/lib"&gt;
-       &lt;include name="**/*.jar" /&gt;
-     &lt;/fileset&gt;
-     &lt;pathelement location="${build.classes}" /&gt;
-  &lt;/path&gt;
-
-  &lt;path id="axis_client.classpath"&gt;
-     &lt;pathelement location="build/classes" /&gt;
-     &lt;fileset dir="${axis.home}"&gt;
-       &lt;include name="**/*.jar" /&gt;
-     &lt;/fileset&gt;
-     &lt;fileset dir="lib"&gt;
-       &lt;include name="*.jar" /&gt;
-     &lt;/fileset&gt;
-     &lt;pathelement location="${build.classes}" /&gt;
-  &lt;/path&gt;
-
-  &lt;target name="usage" description="Build file usage info (default task)"&gt;
-    &lt;echo message=" " /&gt;
-    &lt;echo message="${project-name} " /&gt;
-    &lt;echo message="-------------------------------------------------------" /&gt;
-    &lt;echo message=" " /&gt;
-    &lt;echo message="Available Targets:" /&gt;
-    &lt;echo message=" " /&gt;
-    &lt;echo message=" Compiling:" /&gt;
-    &lt;echo message="  compile           - Compiles the WSDL2Java source code" /&gt;
-    &lt;echo message=" " /&gt;
-    &lt;echo message=" Compiling client:" /&gt;
-    &lt;echo message="  compile_client           - Compiles the client source code" /&gt;
-    &lt;echo message=" " /&gt;
-    &lt;echo message=" Cleaning up:" /&gt;
-    &lt;echo message="  clean             - Delete class files" /&gt;
-    &lt;echo message=" " /&gt;
-    &lt;echo message=" WSDL:" /&gt;
-    &lt;echo message="  wsdl2java               - Generate source from WSDL" /&gt;
-    &lt;echo message=" " /&gt;
-    &lt;echo message=" AAR:" /&gt;
-    &lt;echo message="  aar               - Generate an .aar for deployment into WEB-INF/services" /&gt;
-    &lt;echo message=" " /&gt;
-    &lt;echo message=" Executing:" /&gt;
-    &lt;echo message="  runLogin               - Execute the runLogin client" /&gt;
-  &lt;/target&gt;
-
-  &lt;target name="prepare" &gt;
-    &lt;mkdir dir="${build.classes}" /&gt;
-  &lt;/target&gt;
-
-  &lt;target name="clean" &gt;
-     &lt;delete dir="${build}" /&gt;
-     &lt;delete dir="${dist}" /&gt;
-  &lt;/target&gt;
-
-  &lt;target name="compile"&gt;
-    &lt;echo message="Compiling wsdl2 files"/&gt;
-
-    &lt;javac
-     srcdir="output"
-     destdir="${build.classes}"
-     deprecation="true"
-     failonerror="true" debug="true"
-    &gt;
-
-     &lt;classpath refid="axis.classpath"/&gt; 
-    &lt;/javac&gt;
-
-  &lt;/target&gt;
-
-  &lt;target name="wsdl2java" depends="clean,prepare"&gt;
-      &lt;delete dir="output" /&gt;
-      &lt;java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"&gt;
-          &lt;classpath refid="axis.classpath"/&gt; 
-          &lt;arg value="-d"/&gt;
-          &lt;arg value="xmlbeans"/&gt;
-          &lt;arg value="-uri"/&gt;
-          &lt;arg file="wsdl/LoginEndpoint.wsdl"/&gt;
-          &lt;arg value="-ss"/&gt;
-          &lt;arg value="-g"/&gt;
-          &lt;arg value="-sd"/&gt;
-          &lt;arg value="-o"/&gt;
-          &lt;arg file="output"/&gt;
-          &lt;arg value="-p"/&gt;
-          &lt;arg value="org.example.types"/&gt;
-      &lt;/java&gt;
-
-      &lt;!-- Move the schema folder to classpath--&gt;
-      &lt;move todir="${build.classes}"&gt;
-          &lt;fileset dir="output/resources"&gt;
-              &lt;include name="**/*schema*/**/*.class"/&gt;
-              &lt;include name="**/*schema*/**/*.xsb"/&gt;
-          &lt;/fileset&gt;
-      &lt;/move&gt;
-
-  &lt;/target&gt;
-
-  &lt;target name="jar_wsdl" depends="compile"&gt;
-          &lt;jar jarfile="lib/axis2_example_wsdl.jar" &gt;
-              &lt;fileset dir="${build.classes}" /&gt;
-          &lt;/jar&gt;
-  &lt;/target&gt;
-  
-  &lt;!-- build an .aar file for axis2 web services --&gt;
-  &lt;target name="aar" depends="compile"&gt;
-     &lt;delete dir="${build.classes}/META-INF" /&gt;
-     &lt;mkdir dir="${build.classes}/META-INF" /&gt;
-     &lt;copy todir="${build.classes}/META-INF" &gt;
-       &lt;fileset dir="output/resources" &gt;
-         &lt;!-- axis2 web services definitions file --&gt;
-         &lt;include name="services.xml"/&gt;
-       &lt;/fileset&gt;
-       &lt;fileset dir="wsdl" &gt;
-         &lt;include name="LoginEndpoint.wsdl"/&gt;
-       &lt;/fileset&gt;
-     &lt;/copy&gt;
-     &lt;jar jarfile="dist/LoginEndpoint.aar" &gt;
-       &lt;fileset dir="${build.classes}" /&gt;
-     &lt;/jar&gt;
-  &lt;/target&gt;
-
-  &lt;target name="compile_client"&gt;
-    &lt;echo message="Compiling client files"/&gt;
-
-    &lt;javac
-     srcdir="src"
-     destdir="${build.classes}"
-     deprecation="true"
-     failonerror="true" debug="true"
-    &gt;
-
-     &lt;classpath refid="axis.classpath"/&gt; 
-    &lt;/javac&gt;
-
-  &lt;/target&gt;
-
-  &lt;target name="runLogin" depends="prepare,compile_client" description="run simple Login client"&gt;
-     &lt;java classname="org.client.LoginClient" &gt;
-     &lt;classpath refid="axis_client.classpath"/&gt;
-    &lt;/java&gt;
-  &lt;/target&gt;
-
-&lt;/project&gt;
-
-</pre></div>
-  <p>The above build.xml depends on a build.properties file which defines
-'axis.home', such as:</p><p>axis.home=/home/username/axis2-1.0-bin/</p><p>The above build.xml example also assumes three empty directories exist,
-'dist', 'lib', and 'src'.</p><p>Below is a validated WSDL Document following the Document/Literal Style.
-The name of this file matches the name used in the WSDL2Java ant task above,
-LoginEndpoint.wsdl</p>
-    <div class="source"><pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-
-&lt;definitions name="LoginService" targetNamespace="http://login" xmlns:tns="http://login" 
-xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
-xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns2="http://login/types"&gt;
-
-  &lt;types&gt;
-    &lt;schema targetNamespace="http://login/types" xmlns:tns="http://login/types" 
-    xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" 
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
-    xmlns="http://www.w3.org/2001/XMLSchema"&gt;
-      &lt;import namespace="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
-      &lt;element name="returnWebLoginElement"&gt;
-        &lt;complexType&gt;
-          &lt;sequence&gt;
-
-            &lt;element ref="tns:soap_session_idElement"/&gt;
-            &lt;element ref="tns:web_user_nameElement"/&gt;
-          &lt;/sequence&gt;
-        &lt;/complexType&gt;
-      &lt;/element&gt;
-      &lt;element name="webLoginElement"&gt;
-
-        &lt;complexType&gt;
-          &lt;sequence&gt;
-            &lt;element ref="tns:user_nameElement"/&gt;
-            &lt;element ref="tns:user_passwordElement"/&gt;
-          &lt;/sequence&gt;
-        &lt;/complexType&gt;
-
-      &lt;/element&gt;
-      &lt;element name="user_nameElement" type="xsd:string"/&gt;
-      &lt;element name="user_passwordElement" type="xsd:string"/&gt;
-      &lt;element name="soap_session_idElement" type="xsd:string"/&gt;
-      &lt;element name="web_user_nameElement" type="xsd:string"/&gt;
-&lt;/schema&gt;&lt;/types&gt;
-
-  &lt;message name="LoginEndpoint_webLogin"&gt;
-     &lt;part name="parameters" element="ns2:webLoginElement"/&gt;
-  &lt;/message&gt;
-  &lt;message name="LoginEndpoint_webLoginResponse"&gt;
-    &lt;part name="result" element="ns2:returnWebLoginElement"/&gt;
-  &lt;/message&gt;
-
-  &lt;portType name="LoginEndpoint"&gt;
-    &lt;operation name="webLogin"&gt;
-      &lt;input message="tns:LoginEndpoint_webLogin" name="LoginEndpoint_webLogin"/&gt;
-      &lt;output message="tns:LoginEndpoint_webLoginResponse" name="LoginEndpoint_webLoginResponse"/&gt;
-    &lt;/operation&gt;
-  &lt;/portType&gt;
-
-  &lt;binding name="LoginEndpointBinding" type="tns:LoginEndpoint"&gt;
-    &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt;
-    &lt;operation name="webLogin"&gt;
-      &lt;soap:operation soapAction="webLogin"/&gt;
-      &lt;input name="LoginEndpoint_webLogin"&gt;
-        &lt;soap:body use="literal"/&gt;
-
-      &lt;/input&gt;
-      &lt;output name="LoginEndpoint_webLoginResponse"&gt; 
-        &lt;soap:body use="literal"/&gt;
-      &lt;/output&gt;
-    &lt;/operation&gt;
-  &lt;/binding&gt;
-
-  &lt;service name="LoginService"&gt;
-    &lt;port name="LoginEndpointPort" binding="tns:LoginEndpointBinding"&gt;
-      &lt;soap:address location="http://localhost:8080/axis2/services/LoginService"/&gt;&lt;/port&gt;
-      &lt;/service&gt;&lt;/definitions&gt;
-
-</pre></div>
-  <p>Place the above file, named LoginEndpoint.wsdl, in the directory 'wsdl'
-below the build.xml file. Run the WSDL2Java command via the ant task defined
-above, and there will be a directory called 'output' created. This directory
-contains the WSDL2Java generated source. An important detail is that an
-XMLBean class file is also generated by WSDL2Java, TypeSystemHolder.class.
-That file is placed into build/classes by the above ant task and will be
-needed to compile the generated sources. A frequent problem is users get an
-error such as:</p><p>ClassNotFoundException : Cannot load SchemaTypeSystem. Unable to load
-class with name
-schemaorg_apache_xmlbeans.system.s68C41DB812F52C975439BA10FE4FEE54.TypeSystemHolder.
-Make sure the generated binary files are on the classpath.</p><p>The TypeSystemHolder.class generated by WSDL2Java must be placed in your
-classpath in order to avoid this error.</p><p>The next step is to modify the generated Skeleton Java Source file - the
-Web service. This file as generated returns null and needs to be updated to
-contain the business logic.</p><p>After the WSDL2Java command runs the file LoginEndpoint.wsdl, edit the
-following file:</p><p>output/org/example/types/LoginServiceSkeleton.java. You should see the
-following code:</p>
-    <div class="source"><pre>/**
-     * LoginServiceSkeleton.java
-     *
-     * This file was auto-generated from WSDL
-     * by the Apache Axis2 version: 1.0-RC4 Apr 28, 2006 (05:23:23 IST)
-     */
-    package org.example.types;
-    /**
-     *  LoginServiceSkeleton java skeleton for the axisService
-     */
-    public class LoginServiceSkeleton {
-     
-                 
-        /**
-         * Auto generated method signature
-         
-          * @param param0
-         
-         */
-        public  login.types.ReturnWebLoginElementDocument webLogin
-                  (login.types.WebLoginElementDocument param0 )
-         
-           {
-                //Todo fill this with the necessary business logic
-                throw new  java.lang.UnsupportedOperationException();
-        }
-     
-    }
-
-</pre></div>
-  <p>Replace the contents of this file with the following, which uses the
-complex types generated by WSDL2Java and the example wsdl file:</p>
-    <div class="source"><pre>/**
- * LoginServiceSkeleton.java
- *
- * This file was auto-generated from WSDL
- * by the Apache Axis2 version: 1.0-RC4 Apr 28, 2006 (05:23:23 IST)
- */
-package org.example.types;
-import login.types.ReturnWebLoginElementDocument;
-import login.types.ReturnWebLoginElementDocument.*;
-import login.types.WebLoginElementDocument;
-import login.types.WebLoginElementDocument.*;
-
-/**
- *  Auto generated java skeleton for the service by the Axis code generator
- */
-public class LoginServiceSkeleton {
- 
-    /**
-     * Auto generated method signature
-     
-      * @param webLoginElementDocument changed from param0
-     
-     */
-    public ReturnWebLoginElementDocument webLogin
-       (WebLoginElementDocument webLoginElementDocument ){
-
-            //Todo fill this with the necessary business logic
-            System.out.println("LoginServiceSkeleton.webLogin reached successfully!");
-
-            // Get parameters passed in 
-            WebLoginElement webLoginElement = webLoginElementDocument.getWebLoginElement();
-            String userName = webLoginElement.getUserNameElement();
-            String password = webLoginElement.getUserPasswordElement();
-            System.out.println("LoginServiceSkeleton.webLogin userName: " + userName);
-            System.out.println("LoginServiceSkeleton.webLogin password: " + password);
-     
-            // input paramaters would be used here 
-    
-            // prepare output
-            ReturnWebLoginElementDocument retDoc =
-                ReturnWebLoginElementDocument.Factory.newInstance();
-            
-            ReturnWebLoginElement retElement = ReturnWebLoginElement.Factory.newInstance();
-            
-            retElement.setWebUserNameElement("joe sixpack");
-            retElement.setSoapSessionIdElement("some_random_string");
-            System.out.println("validate retElement: " + retElement.validate());
-
-            retDoc.setReturnWebLoginElement(retElement);
-            System.out.println("validate retDoc: " + retDoc.validate());
-            
-            System.out.println("LoginServiceSkeleton.webLogin returning...");
-    
-            return retDoc; 
-
-    }
-}
-
-</pre></div>
-  <p>The next steps assume the axis2.war has been deployed and has expanded in
-a servlet container.</p><p>Run the 'jar_wsdl' ant task from the example build.xml, which generates a
-jar file lib/axis2_example_wsdl.jar in the 'lib' directory under the
-build.xml . This jar will be used to compile the client, and also will be
-placed in the servlet container. Next, run the 'aar' ant task from the
-example build.xml, which generates the deployable axis2 Web service. Place
-dist/LoginEndpoint.aar into axis2/WEB-INF/services . Place
-lib/axis2_example_wsdl.jar into axis2/WEB-INF/lib . Verify the happy axis
-page loaded the services correctly - there should be the service
-'LoginEndpoint' with the available operation 'webLogin' displayed.</p><p>The last step is to create and run the client. In the src directory create
-the file org.client.LoginClient.java, with the contents below:</p>
-    <div class="source"><pre>package org.client;
-
-import org.apache.axis2.AxisFault;
-
-import login.types.ReturnWebLoginElementDocument;
-import login.types.ReturnWebLoginElementDocument.*;
-import login.types.WebLoginElementDocument;
-import login.types.WebLoginElementDocument.*;
-import org.example.types.LoginServiceStub;
-
-/**
- * Login.
- *
- */
-public class LoginClient {
-
-    public static void main(String[] args) {
-        try {
-
-            System.out.println("webLogin, firing...");
-            LoginServiceStub stub = new LoginServiceStub();
-                    
-            WebLoginElementDocument webLoginElementDocument 
-                = WebLoginElementDocument.Factory.newInstance();
-            WebLoginElement webLoginElement = 
-                WebLoginElement.Factory.newInstance();
-            webLoginElement.setUserNameElement("joe");
-            webLoginElement.setUserPasswordElement("sixpack");
-            
-            webLoginElementDocument.setWebLoginElement(webLoginElement);
-            
-            System.out.println("validate: " +  webLoginElement.validate());
-             stub.webLogin(webLoginElementDocument);
- 
-            ReturnWebLoginElementDocument returnWebLoginElementDocument = 
-                stub.webLogin(webLoginElementDocument);
-
-            System.out.println("Client returned");
-
-            ReturnWebLoginElementDocument.ReturnWebLoginElement
-                retElement = returnWebLoginElementDocument.getReturnWebLoginElement();
-
-            System.out.println("WebUserName: " + retElement.getWebUserNameElement());
-            System.out.println("SOAPSessionId: " + retElement.getSoapSessionIdElement());
-            System.out.println("webLogin, completed!!!");
-
-        } catch (AxisFault axisFault) {
-            axisFault.printStackTrace();
-        } catch (Exception ex) {
-            ex.printStackTrace();
-        }
-    }
-}
-
-</pre></div>
-  <p>Now run the ant task 'ant runLogin' . The following output should
-appear:</p>
-    <div class="source"><pre>runLogin:
-     [echo] running the webLogin client
-     [java] webLogin, firing...
-     [java] validate: true
-     [java] Client returned
-     [java] WebUserName: joe sixpack
-     [java] SOAPSessionId: some_random_string
-     [java] webLogin, completed!!!
-</pre></div>
-  <p><a name="appendix"></a></p></div><div class="subsection"><a name="Appendix"></a><h3>Appendix</h3><ul>
-  <li>Eclipse reference - <a href="http://www.eclipse.org/" class="externalLink" title="External Link">
-    http://www.eclipse.org/</a></li>
-  <li>Custom Ant Tasks - <a href="http://ant.apache.org/manual/develop.html" class="externalLink" title="External Link">
-    http://ant.apache.org/manual/develop.html</a></li>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Axis 2.0 - Code Generator-Command Line Tool</title><style type="text/css" media="all">
+          @import url("../../style/maven-base.css");
+          
+			    @import url("../../style/maven-theme.css");</style><link rel="stylesheet" href="../../style/print.css" type="text/css" media="print"></link><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"></meta></head><body class="composite"><div id="banner"><a href="http://www.apache.org/" id="organizationLogo"><img alt="Apache Software Foundation" src="http://www.apache.org/images/asf-logo.gif"></img></a><a href="http://ws.apache.org/axis2/" id="projectLogo"><img alt="Apache Axis 2.0" src="http://ws.apache.org/axis2/images/axis.jpg"></img></a><div class="clear"><hr></hr></div></div><div id="breadcrumbs"><div class="xleft">
+                	Last published: 05 May 2006
+                  | Doc for 1.0</div><div class="xright"></div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div id="navcolumn"><div id="menuAxis_2_0"><h5>Axis 2.0</h5><ul><li class="none"><a href="../../index.html">Home</a></li><li class="expanded"><a href="../../">Downloads</a><ul><li class="none"><a href="../../download.cgi">Releases</a></li><li class="none"><a href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/?root=Apache-SVN" class="externalLink" title="External Link">Source Code</a></li><li class="none"><a href="../../modules/index.html">Modules</a></li><li class="none"><a href="../../tools/index.html">Tools</a></li></ul></li><li class="expanded"><a href="../../">Documentation</a><ul><li class="none"><a href="../../1_0/index.html">Version 1.0</a></li><li class="none"><a href="../../0_95/index.html">Version 0.95</a></li><li class="none"><a href="../../0_94/index.html">Version 0.94</a></li><li class="none"><a href="../../0_93/index.html">Ver
 sion 0.93</a></li></ul></li><li class="expanded"><a href="../../overview.html">Get Involved</a><ul><li class="none"><a href="../../svn.html">Checkout the Source</a></li><li class="none"><a href="../../siteHowTo.html">Build the Site</a></li><li class="none"><a href="../../guidelines.html">Developer Guidelines</a></li><li class="none"><a href="../../refLib.html">Reference Library</a></li><li class="none"><a href="../../mail-lists.html">Mailing Lists</a></li><li class="none"><a href="../../faq.html">FAQ</a></li></ul></li><li class="none"><a href="../../thanks.html">Acknowledgements</a></li><li class="none"><a href="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="External Link">License</a></li><li class="expanded"><a href="../../">Project Information</a><ul><li class="none"><a href="../../team-list.html">Project Team</a></li><li class="none"><a href="../../issue-tracking.html">Issue Tracking</a></li></ul></li></ul></div><a href="http://maven.apache.o
 rg/" title="Built by Maven" id="poweredBy"><img alt="Built by Maven" src="../../images/logos/maven-button-1.png"></img></a></div></div><div id="bodyColumn"><div class="contentBox"><div class="section"><a name="Code_Generator_Tool-_Command_Line_and_Ant_Task"></a><h2>Code Generator Tool- Command Line and Ant Task</h2><p>The Code Generator tool consists of a command line version and an Ant
+Task. This document will list the command line references and Ant task
+references. Also in detail, this document shows how to build file using
+custom Ant task and invoking the Code Generator from Ant.</p><p>This tool is bundled with the Axis2 base distribution found <a href="http://ws.apache.org/axis2/download.cgi" class="externalLink" title="External Link">here</a>.</p><div class="subsection"><a name="Content"></a><h3>Content</h3><ul>
+  <li><a href="#intro">Introduction</a></li>
+  <li><a href="#cmdline">Command Line Version</a>
+    <ul>
+      <li><a href="#cmdref">Option Reference</a></li>
+    </ul>
+  </li>
+  <li><a href="#ant">Ant Task</a>
+    <ul>
+      <li><a href="#antref">Ant Task Reference</a></li>
+      <li><a href="#example">Example Build File Using the Custom Ant
+      Task</a></li>
+      <li><a href="#invoking">Invoking the Code Generator From Ant</a></li>
+    </ul>
+  </li>
+  <li><a href="#appendix">Appendix</a></li>
+</ul><p><a name="intro"></a></p></div><div class="subsection"><a name="Introduction"></a><h3>Introduction</h3><p>This basic tool is implemented by the WSDL2Code class and just for the
+convenience in the case of java (which would be the majority) there is
+another WSDL2Java class. One can choose to run the main classes directly or
+use one of the scripts to run the WSDL2Code and WSDL2Java appropriately. (the
+scripts are found in the bin directory of the binary distribution)</p><p><a name="cmdline"></a></p></div><div class="subsection"><a name="Command_Line_Version"></a><h3>Command Line Version</h3><p>For those users who wish to use the command line version of the tool, this
+section will be of value.</p><p><a name="cmdref"></a></p></div><div class="subsection"><a name="Option_Reference"></a><h3>Option Reference</h3><table class="bodyTable"><tbody>
+    <tr class="b"><td width="20%"><strong>Short Option</strong></td><td width="20%"><strong>Long Option</strong></td><td width="60%"><strong>Description</strong></td><td></td></tr>
+    <tr class="a"><td width="20%">-uri &lt;Location of WSDL&gt;</td><td width="20%">None</td><td width="60%">WSDL file location. This should point to a WSDL file in
+        the local file system</td><td></td></tr>
+    <tr class="b"><td width="20%">-o &lt;output Location&gt; :</td><td width="20%">--output</td><td width="60%">output file location. This is where the files would be
+        copied once the code generation is done. If this option is omitted
+        the generated files would be copied to the working directory.</td><td></td></tr>
+    <tr class="a"><td width="20%">-l &lt;language&gt;</td><td width="20%">--language</td><td width="60%">Output language. Currently the code generator can
+        generate code in Java but it has the ability to be extended to
+        support other languages</td><td></td></tr>
+    <tr class="b"><td width="20%">-p &lt;package name&gt;</td><td width="20%">--package</td><td width="60%">The target package name. If omitted, a default package
+        (formed using the target namespace of the WSDL) will be used.</td><td></td></tr>
+    <tr class="a"><td width="20%">-a</td><td width="20%">--async</td><td width="60%">Generate code only for async style . when this option
+        is used the generated stubs will have only the asynchronous
+        invocation methods. Switched off by default.</td><td></td></tr>
+    <tr class="b"><td width="20%">-s</td><td width="20%">--sync</td><td width="60%">Generate code only for sync style . When this option is
+        used the generated stubs will have only the  synchronous invocation
+        methods. Switched off by default. When used with the -a option, this
+        takes precedence.</td><td></td></tr>
+    <tr class="a"><td width="20%">-t</td><td width="20%">--test-case</td><td width="60%">Generates a test case. In the case of Java it would be
+        a junit test case.</td><td></td></tr>
+    <tr class="b"><td width="20%">-ss</td><td width="20%">--server-side</td><td width="60%">Generates server side code (i.e. skeletons). Default is
+        off</td><td></td></tr>
+    <tr class="a"><td width="20%">-sd</td><td width="20%">--service-description</td><td width="60%">Generates the service descriptor (i.e. server.xml).
+        Default is off. only valid with -ss, the server side code generation
+        option</td><td></td></tr>
+    <tr class="b"><td width="20%">-d</td><td width="20%">--databinding-method</td><td width="60%">Specifies the Databinding framework. valid values are
+        xmlbeans, adb, jibx, and none. Default is adb.</td><td></td></tr>
+    <tr class="a"><td width="20%">-g</td><td width="20%">--generate-all</td><td width="60%">Generates all the classes. This option is valid only
+        with the -ss (server side code generation) option. When on, the
+        client code (stubs) will also be generated along with the
+      skeleton.</td><td></td></tr>
+    <tr class="b"><td width="20%">-u</td><td width="20%">--unpack-classes</td><td width="60%">Unpack classes. This option specifies whether to unpack
+        the classes and generate separate classes for the databinders.</td><td></td></tr>
+    <tr class="a"><td width="20%">-sn</td><td width="20%">--service-name</td><td width="60%">Specifies the service name to be code generated. If the
+        service name is is not specified, then the first service will be
+        picked</td><td></td></tr>
+    <tr class="b"><td width="20%">-pn</td><td width="20%">--port-name</td><td width="60%">Specifies the port name to be code generated. If the
+        port name is is not specified, then the first port (of the selected
+        service) will be picked</td><td></td></tr>
+    <tr class="a"><td width="20%">-ns2p</td><td width="20%">--namespace2package</td><td width="60%">Specifies a comma seperated list of namespaces and
+        packages where the given package will be used in the place of the
+        auto generated package for the relevant namespace. The list will be
+        the format of ns1=pkg1,ns2=pkg2.</td><td></td></tr>
+    <tr class="b"><td width="20%">-ssi</td><td width="20%">--serverside-interface</td><td width="60%">Generate an interface for the service skeleton 
+</td><td></td></tr>
+  </tbody></table><p>Apart from these mentioned options one can pass extra option by prefixing
+them with -E (uppercase). These extra options will be processed by the
+extensions. The extra options that can be passed are documented separately
+with the extensions documentation (For example with ADB)</p><p><a name="ant"></a></p></div><div class="subsection"><a name="Ant_Task"></a><h3>Ant Task</h3><p>The code generator also comes bundled with an Ant task. The ant task is
+implemented by the org.apache.axis2.tool.ant.AntCodegenTask class. Following
+are the ant task attributes.</p><p><a name="antref"></a></p></div><div class="subsection"><a name="Ant_Task_Reference"></a><h3>Ant Task Reference</h3><table class="bodyTable"><tbody>
+    <tr class="a"><td>wsdlfilename</td><td>WSDL file location. Maps to the uri option of the command line
+      tool</td></tr>
+    <tr class="b"><td>output</td><td>output file location. This is where the files would be copied once
+        the code generation is done. If this option is omitted the generated
+        files would be copied to the working directory. . Maps to the -o
+        option of the command line tool</td></tr>
+    <tr class="a"><td>language</td><td>Output language. Currently the code generator can generate code in
+        Java. Maps to the -l option of the command line tool</td></tr>
+    <tr class="b"><td>packagename</td><td>The target package name. If omitted, a default package (formed
+        using the target namespace of the WSDL) will be used. Maps to the -p
+        option of the command line tool.</td></tr>
+    <tr class="a"><td>asynconly</td><td>Generate code only for async style . when this option is used the
+        generated stubs will have only the asynchronous invocation methods.
+        Defaults to false if omitted Only true and false are applicable as
+        values. Maps to the -a option of the command line tool.</td></tr>
+    <tr class="b"><td>testcase</td><td>Generates a test case</td></tr>
+    <tr class="a"><td>synconly</td><td>Generate code only for sync style . when this option is used the
+        generated stubs will have only the synchronous invocation methods.
+        Defaults to false if omitted. Only true and false are applicable as
+        values. Maps to the -s option of the command line tool.</td></tr>
+    <tr class="b"><td>serverside</td><td>Generates server side code (i.e. skeletons). Only true and false
+        are applicable as values. Default is false. Maps to the -ss option of
+        the command line tool</td></tr>
+    <tr class="a"><td>generateservicexml</td><td>Generates server side code (i.e. skeletons). Only true and false
+        are applicable as values. Default is false. Maps to the -sd option of
+        the command line tool.</td></tr>
+    <tr class="b"><td>unpackClasses</td><td>Unpacks the generated classes. This forces the databinding classes
+        to be generated separately, which otherwise would have been generated
+        as inner classes.</td></tr>
+    <tr class="a"><td>serviceName</td><td>The name of the service in the case of multiple services</td></tr>
+    <tr class="b"><td>portName</td><td>The name of the port in the presence of multiple ports</td></tr>
+    <tr class="a"><td>namespaceToPackages</td><td>A list of namespace to package mappings</td></tr>
+<tr class="b"><td>serverSideInterface</td><td>flag stating whether to generate an interface for the server side skeleton</td></tr>
+  </tbody></table><p><a name="example"></a></p></div><div class="subsection"><a name="Example_Build_File_Using_the_Custom_Ant_Task"></a><h3>Example Build File Using the Custom Ant Task</h3><p>Following is an example ant build file that uses the custom Ant task.</p>
+    <div class="source"><pre>&lt;?xml version="1.0"?&gt;
+&lt;project name="CodegenExample" default="main" basedir="."&gt;
+&lt;target name="declare" &gt;
+&lt;taskdef name="codegen"
+ classname="org.apache.axis2.tool.ant.AntCodegenTask"
+ classpath="classes"/&gt;
+&lt;/target&gt;
+&lt;target name="main" depends="declare"&gt;
+&lt;codegen 
+ wsdlfilename="C:\test\wsdl\CombinedService.wsdl"
+ output="C:\"
+ serverside="true"
+ generateserverxml="true"/&gt;
+&lt;/target&gt;
+&lt;/project&gt;
+
+</pre></div>
+  <p>Notice the main target that uses the "codegen" task which will use the
+org.apache.axis2.tool.ant.AntCodegenTask class and run the code generation
+tool internally while passing the relevant arguments and do the proper
+generation. If a user types</p><p>&gt;ant or &gt;ant main</p><p>it will generate the server side code and services.xml for the given WSDL
+file(C:\test\wsdl\CombinedService.wsdl) and the generated code will be
+written to C:\ directory.</p><p>For this Ant task to work the following jars need to be in the class
+path.</p><ul>
+  <li>axis-*.jar (from the Axis2 distribution)</li>
+  <li>axis-wsdl4j-1.2.jar or higher (The WSDL4J implementation jar. Bundled
+    with the Axis2 distribution)</li>
+  <li>stax-api-1.0.jar (The StAX API's that contain the
+    javax.xml.namespace.QName class. This jar may be replaced by any other
+    jar that contains the javax.xml.namespace.QName implementation. However
+    Axis2 uses this class from the stax-api-1.0.jar which comes bundled with
+    the Axis2 distribution)</li>
+</ul><p><a name="invoking"></a></p></div><div class="subsection"><a name="Invoking_the_Code_Generator_From_Ant"></a><h3>Invoking the Code Generator From Ant</h3><p>Since the users may find altering their ant class path a bit daunting they
+can also follow an easier technique. The code generator main class can be
+invoked directly through the build file.</p><p>Below is an example of a full build.xml needed to run WSDL2Java and
+generate the Java source files, compile the sources, and build an AAR file
+ready for deployment:</p>
+    <div class="source"><pre>&lt;!DOCTYPE project&gt;
+
+&lt;project name="wsdl2java-example" default="usage" basedir="."&gt;
+
+  &lt;property name="project-name" value="wsdl2java-example"/&gt;
+  &lt;property file="build.properties"/&gt;
+  
+  &lt;property name="build" value="build"/&gt;
+  &lt;property name="src" value="src"/&gt;
+  &lt;property name="build.classes"      value="build/classes" /&gt;
+
+  &lt;path id="axis.classpath"&gt;
+     &lt;pathelement location="build/classes" /&gt;
+     &lt;fileset dir="${axis.home}/lib"&gt;
+       &lt;include name="**/*.jar" /&gt;
+     &lt;/fileset&gt;
+     &lt;pathelement location="${build.classes}" /&gt;
+  &lt;/path&gt;
+
+  &lt;path id="axis_client.classpath"&gt;
+     &lt;pathelement location="build/classes" /&gt;
+     &lt;fileset dir="${axis.home}"&gt;
+       &lt;include name="**/*.jar" /&gt;
+     &lt;/fileset&gt;
+     &lt;fileset dir="lib"&gt;
+       &lt;include name="*.jar" /&gt;
+     &lt;/fileset&gt;
+     &lt;pathelement location="${build.classes}" /&gt;
+  &lt;/path&gt;
+
+  &lt;target name="usage" description="Build file usage info (default task)"&gt;
+    &lt;echo message=" " /&gt;
+    &lt;echo message="${project-name} " /&gt;
+    &lt;echo message="-------------------------------------------------------" /&gt;
+    &lt;echo message=" " /&gt;
+    &lt;echo message="Available Targets:" /&gt;
+    &lt;echo message=" " /&gt;
+    &lt;echo message=" Compiling:" /&gt;
+    &lt;echo message="  compile           - Compiles the WSDL2Java source code" /&gt;
+    &lt;echo message=" " /&gt;
+    &lt;echo message=" Compiling client:" /&gt;
+    &lt;echo message="  compile_client           - Compiles the client source code" /&gt;
+    &lt;echo message=" " /&gt;
+    &lt;echo message=" Cleaning up:" /&gt;
+    &lt;echo message="  clean             - Delete class files" /&gt;
+    &lt;echo message=" " /&gt;
+    &lt;echo message=" WSDL:" /&gt;
+    &lt;echo message="  wsdl2java               - Generate source from WSDL" /&gt;
+    &lt;echo message=" " /&gt;
+    &lt;echo message=" AAR:" /&gt;
+    &lt;echo message="  aar               - Generate an .aar for deployment into WEB-INF/services" /&gt;
+    &lt;echo message=" " /&gt;
+    &lt;echo message=" Executing:" /&gt;
+    &lt;echo message="  runLogin               - Execute the runLogin client" /&gt;
+  &lt;/target&gt;
+
+  &lt;target name="prepare" &gt;
+    &lt;mkdir dir="${build.classes}" /&gt;
+  &lt;/target&gt;
+
+  &lt;target name="clean" &gt;
+     &lt;delete dir="${build}" /&gt;
+     &lt;delete dir="${dist}" /&gt;
+  &lt;/target&gt;
+
+  &lt;target name="compile"&gt;
+    &lt;echo message="Compiling wsdl2 files"/&gt;
+
+    &lt;javac
+     srcdir="output"
+     destdir="${build.classes}"
+     deprecation="true"
+     failonerror="true" debug="true"
+    &gt;
+
+     &lt;classpath refid="axis.classpath"/&gt; 
+    &lt;/javac&gt;
+
+  &lt;/target&gt;
+
+  &lt;target name="wsdl2java" depends="clean,prepare"&gt;
+      &lt;delete dir="output" /&gt;
+      &lt;java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"&gt;
+          &lt;classpath refid="axis.classpath"/&gt; 
+          &lt;arg value="-d"/&gt;
+          &lt;arg value="xmlbeans"/&gt;
+          &lt;arg value="-uri"/&gt;
+          &lt;arg file="wsdl/LoginEndpoint.wsdl"/&gt;
+          &lt;arg value="-ss"/&gt;
+          &lt;arg value="-g"/&gt;
+          &lt;arg value="-sd"/&gt;
+          &lt;arg value="-o"/&gt;
+          &lt;arg file="output"/&gt;
+          &lt;arg value="-p"/&gt;
+          &lt;arg value="org.example.types"/&gt;
+      &lt;/java&gt;
+
+      &lt;!-- Move the schema folder to classpath--&gt;
+      &lt;move todir="${build.classes}"&gt;
+          &lt;fileset dir="output/resources"&gt;
+              &lt;include name="**/*schema*/**/*.class"/&gt;
+              &lt;include name="**/*schema*/**/*.xsb"/&gt;
+          &lt;/fileset&gt;
+      &lt;/move&gt;
+
+  &lt;/target&gt;
+
+  &lt;target name="jar_wsdl" depends="compile"&gt;
+          &lt;jar jarfile="lib/axis2_example_wsdl.jar" &gt;
+              &lt;fileset dir="${build.classes}" /&gt;
+          &lt;/jar&gt;
+  &lt;/target&gt;
+  
+  &lt;!-- build an .aar file for axis2 web services --&gt;
+  &lt;target name="aar" depends="compile"&gt;
+     &lt;delete dir="${build.classes}/META-INF" /&gt;
+     &lt;mkdir dir="${build.classes}/META-INF" /&gt;
+     &lt;copy todir="${build.classes}/META-INF" &gt;
+       &lt;fileset dir="output/resources" &gt;
+         &lt;!-- axis2 web services definitions file --&gt;
+         &lt;include name="services.xml"/&gt;
+       &lt;/fileset&gt;
+       &lt;fileset dir="wsdl" &gt;
+         &lt;include name="LoginEndpoint.wsdl"/&gt;
+       &lt;/fileset&gt;
+     &lt;/copy&gt;
+     &lt;jar jarfile="dist/LoginEndpoint.aar" &gt;
+       &lt;fileset dir="${build.classes}" /&gt;
+     &lt;/jar&gt;
+  &lt;/target&gt;
+
+  &lt;target name="compile_client"&gt;
+    &lt;echo message="Compiling client files"/&gt;
+
+    &lt;javac
+     srcdir="src"
+     destdir="${build.classes}"
+     deprecation="true"
+     failonerror="true" debug="true"
+    &gt;
+
+     &lt;classpath refid="axis.classpath"/&gt; 
+    &lt;/javac&gt;
+
+  &lt;/target&gt;
+
+  &lt;target name="runLogin" depends="prepare,compile_client" description="run simple Login client"&gt;
+     &lt;java classname="org.client.LoginClient" &gt;
+     &lt;classpath refid="axis_client.classpath"/&gt;
+    &lt;/java&gt;
+  &lt;/target&gt;
+
+&lt;/project&gt;
+
+</pre></div>
+  <p>The above build.xml depends on a build.properties file which defines
+'axis.home', such as:</p><p>axis.home=/home/username/axis2-1.0-bin/</p><p>The above build.xml example also assumes three empty directories exist,
+'dist', 'lib', and 'src'.</p><p>Below is a validated WSDL Document following the Document/Literal Style.
+The name of this file matches the name used in the WSDL2Java ant task above,
+LoginEndpoint.wsdl</p>
+    <div class="source"><pre>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
+
+&lt;definitions name="LoginService" targetNamespace="http://login" xmlns:tns="http://login" 
+xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
+xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns2="http://login/types"&gt;
+
+  &lt;types&gt;
+    &lt;schema targetNamespace="http://login/types" xmlns:tns="http://login/types" 
+    xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns="http://www.w3.org/2001/XMLSchema"&gt;
+      &lt;import namespace="http://schemas.xmlsoap.org/soap/encoding/"/&gt;
+      &lt;element name="returnWebLoginElement"&gt;
+        &lt;complexType&gt;
+          &lt;sequence&gt;
+
+            &lt;element ref="tns:soap_session_idElement"/&gt;
+            &lt;element ref="tns:web_user_nameElement"/&gt;
+          &lt;/sequence&gt;
+        &lt;/complexType&gt;
+      &lt;/element&gt;
+      &lt;element name="webLoginElement"&gt;
+
+        &lt;complexType&gt;
+          &lt;sequence&gt;
+            &lt;element ref="tns:user_nameElement"/&gt;
+            &lt;element ref="tns:user_passwordElement"/&gt;
+          &lt;/sequence&gt;
+        &lt;/complexType&gt;
+
+      &lt;/element&gt;
+      &lt;element name="user_nameElement" type="xsd:string"/&gt;
+      &lt;element name="user_passwordElement" type="xsd:string"/&gt;
+      &lt;element name="soap_session_idElement" type="xsd:string"/&gt;
+      &lt;element name="web_user_nameElement" type="xsd:string"/&gt;
+&lt;/schema&gt;&lt;/types&gt;
+
+  &lt;message name="LoginEndpoint_webLogin"&gt;
+     &lt;part name="parameters" element="ns2:webLoginElement"/&gt;
+  &lt;/message&gt;
+  &lt;message name="LoginEndpoint_webLoginResponse"&gt;
+    &lt;part name="result" element="ns2:returnWebLoginElement"/&gt;
+  &lt;/message&gt;
+
+  &lt;portType name="LoginEndpoint"&gt;
+    &lt;operation name="webLogin"&gt;
+      &lt;input message="tns:LoginEndpoint_webLogin" name="LoginEndpoint_webLogin"/&gt;
+      &lt;output message="tns:LoginEndpoint_webLoginResponse" name="LoginEndpoint_webLoginResponse"/&gt;
+    &lt;/operation&gt;
+  &lt;/portType&gt;
+
+  &lt;binding name="LoginEndpointBinding" type="tns:LoginEndpoint"&gt;
+    &lt;soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/&gt;
+    &lt;operation name="webLogin"&gt;
+      &lt;soap:operation soapAction="webLogin"/&gt;
+      &lt;input name="LoginEndpoint_webLogin"&gt;
+        &lt;soap:body use="literal"/&gt;
+
+      &lt;/input&gt;
+      &lt;output name="LoginEndpoint_webLoginResponse"&gt; 
+        &lt;soap:body use="literal"/&gt;
+      &lt;/output&gt;
+    &lt;/operation&gt;
+  &lt;/binding&gt;
+
+  &lt;service name="LoginService"&gt;
+    &lt;port name="LoginEndpointPort" binding="tns:LoginEndpointBinding"&gt;
+      &lt;soap:address location="http://localhost:8080/axis2/services/LoginService"/&gt;&lt;/port&gt;
+      &lt;/service&gt;&lt;/definitions&gt;
+
+</pre></div>
+  <p>Place the above file, named LoginEndpoint.wsdl, in the directory 'wsdl'
+below the build.xml file. Run the WSDL2Java command via the ant task defined
+above, and there will be a directory called 'output' created. This directory
+contains the WSDL2Java generated source. An important detail is that an
+XMLBean class file is also generated by WSDL2Java, TypeSystemHolder.class.
+That file is placed into build/classes by the above ant task and will be
+needed to compile the generated sources. A frequent problem is users get an
+error such as:</p><p>ClassNotFoundException : Cannot load SchemaTypeSystem. Unable to load
+class with name
+schemaorg_apache_xmlbeans.system.s68C41DB812F52C975439BA10FE4FEE54.TypeSystemHolder.
+Make sure the generated binary files are on the classpath.</p><p>The TypeSystemHolder.class generated by WSDL2Java must be placed in your
+classpath in order to avoid this error.</p><p>The next step is to modify the generated Skeleton Java Source file - the
+Web service. This file as generated returns null and needs to be updated to
+contain the business logic.</p><p>After the WSDL2Java command runs the file LoginEndpoint.wsdl, edit the
+following file:</p><p>output/org/example/types/LoginServiceSkeleton.java. You should see the
+following code:</p>
+    <div class="source"><pre>/**
+     * LoginServiceSkeleton.java
+     *
+     * This file was auto-generated from WSDL
+     * by the Apache Axis2 version: 1.0-RC4 Apr 28, 2006 (05:23:23 IST)
+     */
+    package org.example.types;
+    /**
+     *  LoginServiceSkeleton java skeleton for the axisService
+     */
+    public class LoginServiceSkeleton {
+     
+                 
+        /**
+         * Auto generated method signature
+         
+          * @param param0
+         
+         */
+        public  login.types.ReturnWebLoginElementDocument webLogin
+                  (login.types.WebLoginElementDocument param0 )
+         
+           {
+                //Todo fill this with the necessary business logic
+                throw new  java.lang.UnsupportedOperationException();
+        }
+     
+    }
+
+</pre></div>
+  <p>Replace the contents of this file with the following, which uses the
+complex types generated by WSDL2Java and the example wsdl file:</p>
+    <div class="source"><pre>/**
+ * LoginServiceSkeleton.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis2 version: 1.0-RC4 Apr 28, 2006 (05:23:23 IST)
+ */
+package org.example.types;
+import login.types.ReturnWebLoginElementDocument;
+import login.types.ReturnWebLoginElementDocument.*;
+import login.types.WebLoginElementDocument;
+import login.types.WebLoginElementDocument.*;
+
+/**
+ *  Auto generated java skeleton for the service by the Axis code generator
+ */
+public class LoginServiceSkeleton {
+ 
+    /**
+     * Auto generated method signature
+     
+      * @param webLoginElementDocument changed from param0
+     
+     */
+    public ReturnWebLoginElementDocument webLogin
+       (WebLoginElementDocument webLoginElementDocument ){
+
+            //Todo fill this with the necessary business logic
+            System.out.println("LoginServiceSkeleton.webLogin reached successfully!");
+
+            // Get parameters passed in 
+            WebLoginElement webLoginElement = webLoginElementDocument.getWebLoginElement();
+            String userName = webLoginElement.getUserNameElement();
+            String password = webLoginElement.getUserPasswordElement();
+            System.out.println("LoginServiceSkeleton.webLogin userName: " + userName);
+            System.out.println("LoginServiceSkeleton.webLogin password: " + password);
+     
+            // input paramaters would be used here 
+    
+            // prepare output
+            ReturnWebLoginElementDocument retDoc =
+                ReturnWebLoginElementDocument.Factory.newInstance();
+            
+            ReturnWebLoginElement retElement = ReturnWebLoginElement.Factory.newInstance();
+            
+            retElement.setWebUserNameElement("joe sixpack");
+            retElement.setSoapSessionIdElement("some_random_string");
+            System.out.println("validate retElement: " + retElement.validate());
+
+            retDoc.setReturnWebLoginElement(retElement);
+            System.out.println("validate retDoc: " + retDoc.validate());
+            
+            System.out.println("LoginServiceSkeleton.webLogin returning...");
+    
+            return retDoc; 
+
+    }
+}
+
+</pre></div>
+  <p>The next steps assume the axis2.war has been deployed and has expanded in
+a servlet container.</p><p>Run the 'jar_wsdl' ant task from the example build.xml, which generates a
+jar file lib/axis2_example_wsdl.jar in the 'lib' directory under the
+build.xml . This jar will be used to compile the client, and also will be
+placed in the servlet container. Next, run the 'aar' ant task from the
+example build.xml, which generates the deployable axis2 Web service. Place
+dist/LoginEndpoint.aar into axis2/WEB-INF/services . Place
+lib/axis2_example_wsdl.jar into axis2/WEB-INF/lib . Verify the happy axis
+page loaded the services correctly - there should be the service
+'LoginEndpoint' with the available operation 'webLogin' displayed.</p><p>The last step is to create and run the client. In the src directory create
+the file org.client.LoginClient.java, with the contents below:</p>
+    <div class="source"><pre>package org.client;
+
+import org.apache.axis2.AxisFault;
+
+import login.types.ReturnWebLoginElementDocument;
+import login.types.ReturnWebLoginElementDocument.*;
+import login.types.WebLoginElementDocument;
+import login.types.WebLoginElementDocument.*;
+import org.example.types.LoginServiceStub;
+
+/**
+ * Login.
+ *
+ */
+public class LoginClient {
+
+    public static void main(String[] args) {
+        try {
+
+            System.out.println("webLogin, firing...");
+            LoginServiceStub stub = new LoginServiceStub();
+                    
+            WebLoginElementDocument webLoginElementDocument 
+                = WebLoginElementDocument.Factory.newInstance();
+            WebLoginElement webLoginElement = 
+                WebLoginElement.Factory.newInstance();
+            webLoginElement.setUserNameElement("joe");
+            webLoginElement.setUserPasswordElement("sixpack");
+            
+            webLoginElementDocument.setWebLoginElement(webLoginElement);
+            
+            System.out.println("validate: " +  webLoginElement.validate());
+             stub.webLogin(webLoginElementDocument);
+ 
+            ReturnWebLoginElementDocument returnWebLoginElementDocument = 
+                stub.webLogin(webLoginElementDocument);
+
+            System.out.println("Client returned");
+
+            ReturnWebLoginElementDocument.ReturnWebLoginElement
+                retElement = returnWebLoginElementDocument.getReturnWebLoginElement();
+
+            System.out.println("WebUserName: " + retElement.getWebUserNameElement());
+            System.out.println("SOAPSessionId: " + retElement.getSoapSessionIdElement());
+            System.out.println("webLogin, completed!!!");
+
+        } catch (AxisFault axisFault) {
+            axisFault.printStackTrace();
+        } catch (Exception ex) {
+            ex.printStackTrace();
+        }
+    }
+}
+
+</pre></div>
+  <p>Now run the ant task 'ant runLogin' . The following output should
+appear:</p>
+    <div class="source"><pre>runLogin:
+     [echo] running the webLogin client
+     [java] webLogin, firing...
+     [java] validate: true
+     [java] Client returned
+     [java] WebUserName: joe sixpack
+     [java] SOAPSessionId: some_random_string
+     [java] webLogin, completed!!!
+</pre></div>
+  <p><a name="appendix"></a></p></div><div class="subsection"><a name="Appendix"></a><h3>Appendix</h3><ul>
+  <li>Eclipse reference - <a href="http://www.eclipse.org/" class="externalLink" title="External Link">
+    http://www.eclipse.org/</a></li>
+  <li>Custom Ant Tasks - <a href="http://ant.apache.org/manual/develop.html" class="externalLink" title="External Link">
+    http://ant.apache.org/manual/develop.html</a></li>
 </ul><p></p><p></p><p></p><p></p><p></p></div></div></div></div><div class="clear"><hr></hr></div><div id="footer"><div class="xright">© 2004-2006, Apache Software Foundation</div><div class="clear"><hr></hr></div></div></body></html>



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org