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 de...@apache.org on 2007/04/27 14:39:46 UTC

svn commit: r533081 [9/23] - in /webservices/axis2/site: ./ 1_2/ 1_2/adb/ 1_2/adb/images/ 1_2/images/ 1_2/images/archi-guide/ 1_2/images/userguide/ 1_2/jibx/ 1_2/resources/ 1_2/resources/schemas/ 1_2/src/ css/ download/0_9/ download/0_91/ download/0_92...

Added: webservices/axis2/site/1_2/quickstartguide.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_2/quickstartguide.html?view=auto&rev=533081
==============================================================================
--- webservices/axis2/site/1_2/quickstartguide.html (added)
+++ webservices/axis2/site/1_2/quickstartguide.html Fri Apr 27 05:39:33 2007
@@ -0,0 +1,907 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Axis2/Java - Axis2 Quick Start Guide</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 Axis2" 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: 27 April 2007
+                  | Doc for 1.2</div><div class="xright">
+        
+        <a href="../index.html">Axis2/Java</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://ws.apache.org/axis2/c" class="externalLink" title="External Link">Axis2/C</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://ws.apache.org" class="externalLink" title="External Link">Apache WS</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://www.apache.org" class="externalLink" title="External Link">Apache </a>
+      </div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div id="navcolumn"><div id="menuAxis2_Java"><h5>Axis2/Java</h5><ul><li class="none"><a href="../index.html">Home</a></li></ul></div><div id="menuDownloads"><h5>Downloads</h5><ul><li class="none"><a href="../download.cgi">Releases</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></div><div id="menuDocumentation"><h5>Documentation</h5><ul><li class="expanded"><a href="../1_2/contents.html">Version 1.2</a><ul><li class="none"><a href="../1_2/toc.html">Table of Contents</a></li><li class="none"><a href="../1_2/installationguide.html">Installation Guide</a></li><li class="none"><a href="../1_2/quickstartguide.html">QuickStart Guide</a></li><li class="none"><a href="../1_2/userguide.html">User Guide</a></li><li class="none"><a href="../1_2/pojoguide.html">POJO Guide</a></li><li class="none"><a href="../1_2/spring.html">
 Spring Guide</a></li><li class="none"><a href="../1_2/webadminguide.html">Web Administrator's Guide</a></li><li class="none"><a href="../1_2/migration.html">Migration Guide (from Axis1)</a></li></ul></li><li class="none"><a href="../1_1_1/index.html">Version 1.0</a></li><li class="none"><a href="../1_1/index.html">Version 1.0</a></li><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">Version 0.93</a></li></ul></div><div id="menuResources"><h5>Resources</h5><ul><li class="none"><a href="../faq.html">FAQ</a></li><li class="none"><a href="../articles.html">Articles</a></li><li class="none"><a href="http://wiki.apache.org/ws/FrontPage/Axis2/" class="externalLink" title="External Link">Wiki</a></li><li class="none"><a href="../refLib.html">Reference Library</a></li><li class="none"><a href
 ="http://ws.apache.org/axis2/1_2/api/index.html" class="externalLink" title="External Link">Online Java Docs</a></li></ul></div><div id="menuGet_Involved"><h5>Get Involved</h5><ul><li class="none"><a href="../overview.html">Overview</a></li><li class="none"><a href="../svn.html">Checkout the Source</a></li><li class="none"><a href="../mail-lists.html">Mailing Lists</a></li><li class="none"><a href="../guidelines.html">Developer Guidelines</a></li><li class="none"><a href="../siteHowTo.html">Build the Site</a></li></ul></div><div id="menuProject_Information"><h5>Project Information</h5><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><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="../thanks.html">Acknowledgements</a></li><li class="none"><a hr
 ef="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="External Link">License</a></li></ul></div><a href="http://maven.apache.org/" 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="Axis2_Quick_Start_Guide"></a><h2>Axis2 Quick Start Guide</h2><p>The purpose of this guide is to get you started on creating services and
+clients using Axis2 as quickly as possible. We'll take a simple StockQuote
+Service and show you some of the different ways in which you can create and
+deploy it, as well as take a quick look at one or two utilities that come
+with Axis2. We'll then look at creating clients to access those services.</p><div class="subsection"><a name="Content"></a><h3>Content</h3><ul>
+  <li><a href="#introduction">Introduction</a></li>
+  <li><a href="#ready">Getting Ready</a></li>
+  <li><a href="#services">Axis2 services</a></li>
+  <li><a href="#create">Creating services</a>
+    <ul>
+      <li><a href="#deploy">Deploying POJOs</a></li>
+      <li><a href="#axiom">Building the service using AXIOM</a></li>
+      <li><a href="#adb">Generating the service using ADB</a></li>
+      <li><a href="#xmlbeans">Generating the service using XMLBeans</a></li>
+      <li><a href="#jibx">Generating the service using JiBX</a></li>
+    </ul>
+  </li>
+  <li><a href="#clients">Generating Clients</a>
+    <ul>
+      <li><a href="#clientaxiom">Creating a client using AXIOM</a></li>
+      <li><a href="#clientadb">Generating a client using ADB</a></li>
+      <li><a href="#clientxmlbeans">Generating a client using XML
+      Beans</a></li>
+      <li><a href="#clientjibx">Generating a client using JiBX</a></li>
+    </ul>
+  </li>
+  <li><a href="#summary">Summary</a></li>
+  <li><a href="#furtherstudy">For Further Study</a></li>
+</ul></div><div class="subsection"><a name="A_Quick_Setup_Note:"></a><h3>A Quick Setup Note:</h3><p>The code for the document can be found in the extracted <a href="../download/1_2/download.html#std-bin">Standard Binary
+Distribution</a>, more specifically at Axis2_HOME/samples/ inside the
+directories- quickstart, quickstartadb, quickstartaxiom, quickstartjibx and
+quickstartxmlbeans. (Consider getting it now as it will help you to follow
+along.) It includes Ant buildfiles (build.xml) that we'll refer to throughout
+the examples to make compilation easier.</p><p><a name="introduction"></a></p></div><div class="subsection"><a name="Introduction"></a><h3>Introduction</h3><p>Let's start with the service itself. We'll make it simple so you can see
+what is going on when we build and deploy the services. A StockQuoteService
+example seems to be mandatory in instances like this one, so let's use the
+following (see Code Listing 1).</p><p><b>Code Listing 1: The StockQuoteService class</b></p>
+    <div class="source"><pre>package samples.quickstart.service.pojo;
+
+import java.util.HashMap;
+
+public class StockQuoteService {
+    private HashMap map = new HashMap();
+
+    public double getPrice(String symbol) {
+        Double price = (Double) map.get(symbol);
+        if(price != null){
+            return price.doubleValue();
+        }
+        return 42.00;
+    }
+
+    public void update(String symbol, double price) {
+        map.put(symbol, new Double(price));
+    }
+}
+
+</pre></div>
+  <p>It will be a simple service with two possible calls. One of which is an
+in/out message, and the other is an in-only service. Ultimately, we'll
+package the service and deploy it in four different ways.</p><p>First, let's look at how this simple Java class corresponds to a
+service.</p><p><a name="ready"></a></p></div><div class="subsection"><a name="Getting_Ready"></a><h3>Getting Ready</h3><p>Before we build anything using Axis2, we have to take care of a little
+housekeeping. First off, you'll need to get your environment ready for
+working with Axis2. Fortunately, it involves just a few simple steps:</p><ol>
+  <li>Download and install Java. (Minimum version is JDK1.4)</li>
+  <li>Download Axis2 and extract it to a target directory.</li>
+  <li>Copy the axis2.war file to the webapps directory of your servlet
+  engine.</li>
+  <li>Set the AXIS2_HOME environment variable to point to the target
+    directory in step. Note that all of the scripts and build files Axis2
+    generates depend on this value, so don't skip this step!</li>
+</ol><p>In most cases, we're also going to need a WSDL file for our service.
+Axis2's Java2WSDL can be used to bootstrap a WSDL. To generate a WSDL file
+from a Java class, perform the following steps:</p><ol>
+  <li>Create and compile the Java class.</li>
+  <li>Generate the WSDL using the command:</li>
+  <pre>%AXIS2_HOME%/bin/java2wsdl -cp . -cn samples.quickstart.service.pojo.StockQuoteService -of StockQuoteService.wsdl</pre>
+</ol><p>Once you've generated the WSDL file, you can make the changes you need.
+For example, you might add custom faults or change the name of the generated
+elements. For example, this StockQuoteService.wsdl is in
+%AXIS2_HOME%/samples/quickstartadb/resources/META-INF folder, which we'll be
+using throughout the rest of this guide, replaces the generic parameters
+created by the generation process.</p><p><a name="services"></a></p></div><div class="subsection"><a name="Axis2_Services"></a><h3>Axis2 Services</h3><p>Before we build anything, it's helpful to understand what the finished
+product looks like.</p><p>The server side of Axis2 can be deployed on any Servlet engine, and has
+the following structure. Shown in Code Listing 2.</p><p><b>Code Listing 2: The Directory Structure of axis2.war</b></p>
+    <div class="source"><pre>axis2-web 
+META-INF
+WEB-INF
+    classes 
+    conf
+        axis2.xml 
+    lib
+        activation.jar
+        ...
+        xmlSchema.jar
+    modules
+        modules.list 
+        addressing.mar
+        ...
+        soapmonitor.mar
+    services
+        services.list
+        aservice.aar
+        ...
+        version.aar
+    web.xml
+
+</pre></div>
+  <p>Starting at the top, axis2-web is a collection of JSPs that make up the
+Axis2 administration application, through which you can perform any action
+such as adding services and engaging and dis-engaging modules. The WEB-INF
+directory contains the actual java classes and other support files to run any
+services deployed to the services directory.</p><p>The main file in all this is axis2.xml, which controls how the application
+deals with the received messages, determining whether Axis2 needs to apply
+any of the modules defined in the modules directory.</p><p>Services can be deployed as *.aar files, as you can see here, but their
+contents must be arranged in a specific way. For example, the structure of
+this service will be as follows:</p><p><a name="aarstructure"></a>
+    <div class="source"><pre>- StockQuoteService
+   - META-INF
+     - services.xml
+   - lib
+   - samples
+     - quickstart
+       - service
+         - pojo
+           - StockQuoteService.class
+
+</pre></div>
+  </p><p>Here, the name of the service is StockQuoteService, which 
+is specified in the services.xml file and corresponds to the top-level
+folder of this service. Compiled Java classes are placed underneath
+this in their proper place based on the package name. The lib directory
+holds any service-specific JAR files needed for the service to run (none in 
+this case) besides those already stored with the Axis2 WAR file and the
+servlet container's common JAR directories.  Finally, the META-INF directory
+contains any additional information about the service that Axis2 needs
+to execute it properly. The services.xml file defines the service itself and
+links the Java class to it (See Code Listing 3).</p><p><b>Code Listing 3: The Service Definition File</b></p>
+    <div class="source"><pre>&lt;service name="StockQuoteService" scope="application"&gt;
+    &lt;description&gt;
+        Stock Quote Sample Service
+    &lt;/description&gt;
+    &lt;messageReceivers&gt;
+        &lt;messageReceiver 
+            mep="http://www.w3.org/2004/08/wsdl/in-only"
+    class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/&gt;
+        &lt;messageReceiver
+            mep="http://www.w3.org/2004/08/wsdl/in-out"
+    class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/&gt;
+    &lt;/messageReceivers&gt;
+    &lt;parameter name="ServiceClass"&gt;
+        samples.quickstart.service.pojo.StockQuoteService
+    &lt;/parameter&gt;
+&lt;/service&gt;
+
+</pre></div>
+  <p>Here the service is defined, along with the relevant messageReceiver types
+for the different message exchange patterns.</p><p>The META-INF directory is also the location for any custom WSDL files you
+intend to include for this application.</p><p>You can deploy a service by simply taking this hierarchy of files and
+copying it to the webapps directory of your servlet engine. This is known as
+the "exploded" format. You can also compress your documents into an *.aar
+file, similar to a *.jar file, and place the *.aar file directly in the
+servlet engine's webapps directory.</p><p>Now that you understand what we're trying to accomplish, we're almost
+ready to start building.</p><p>First, <a href="../download/1_2/download.html#std-bin">download</a> and
+unzip the appropriate version of Axis2 Standard Binary Distribution. Make
+sure that you set the value of the AXIS2_HOME variable to match the location
+into which you extracted the contents of this release.</p><p>Let's look at some different ways to create clients and services.</p><p><a name="create"></a></p></div><div class="subsection"><a name="Creating_Services"></a><h3>Creating Services</h3><p>In this section, we'll look at five ways to create a service based on the
+StockQuoteService class: deploying Plain Old Java Objects (POJO), building
+the service using AXIOM's OMElement, generating the service using Axis2
+Databinding Framework (ADB), generating the service using XMLBeans, and
+generating the service using JiBX.</p><p><a name="deploy"></a></p></div><div class="subsection"><a name="Deploying_POJOs"></a><h3>Deploying POJOs</h3><p>To deploy the service using POJOs (Plain Old Java Objects), execute the
+following steps.</p><p>Note the directory structure contained at
+&lt;AXIS2_HOME&gt;/samples/quickstart (the services.xml file is from the
+first section of this guide):</p>
+    <div class="source"><pre>- quickstart
+   - README.txt
+   - build.xml
+   - resources
+     - META-INF
+       - services.xml
+   - src
+     - samples
+       - quickstart
+         - service
+           - pojo
+             - StockQuoteService.java
+
+</pre></div>
+  <p>Note that you can generate a WSDL from the quickstart directory by typing: <pre>ant generate.wsdl</pre>
+However, creating StockQuoteService.wsdl is optional. It can be the version
+generated directly from the Java class, or a customized version of that file,
+and that services.xml is the same file referenced earlier in this
+document.</p><p>Now build the project by typing ant generate.service in the quickstart
+directory, which creates the following directory structure:</p>
+    <div class="source"><pre>- quickstart/build/classes
+   - META-INF
+     - services.xml
+   - samples
+     - quickstart
+       - service
+         - pojo
+           - StockQuoteService.class
+
+</pre></div>
+  <p>If you want to deploy the service in an exploded directory format, rename
+the classes directory to StockQuoteService, and copy it to the
+webapps/axis2/WEB-INF/services directory in your servlet engine. Otherwise,
+copy the build/StockQuoteService.aar file to the
+webapps/axis2/WEB-INF/services directory in your servlet engine. Then check
+to make sure that the service has been properly deployed by viewing the list
+of services at:</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/listServices
+
+</pre></div>
+  <p>You can also checkout the WSDL at:</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?wsdl
+
+</pre></div>
+  <p>And the schema at:</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?xsd
+
+</pre></div>
+  <p>Once the URLs are working, quickly test the service. Try pointing your
+browser to the following URL:</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService/getPrice?symbol=IBM
+
+</pre></div>
+  <p>You will get the following response:</p>
+    <div class="source"><pre>&lt;ns:getPriceResponse xmlns:ns="http://pojo.service.quickstart.samples/xsd"&gt;&lt;ns:return&gt;42&lt;/ns:return&gt;&lt;/ns:getPriceResponse&gt;
+
+</pre></div>
+  <p>If you invoke the update method as,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService/update?symbol=IBM&amp;price=100</pre></div>
+  <p>
+and then execute the first getPrice URL, you will see that the price has got
+updated. <a name="axiom"></a></p></div><div class="subsection"><a name="Building_the_Service_using_AXIOM"></a><h3>Building the Service using AXIOM</h3><p>To build a service "from scratch" using AXIOM, execute the following
+steps.</p><p>Note the directory structure contained at /samples/quickstartaxiom:</p>
+    <div class="source"><pre>- quickstartaxiom
+   - README.txt
+   - build.xml
+   - resources
+     - META-INF
+       - services.xml
+       - StockQuoteService.wsdl
+   - src
+     - samples
+       - quickstart
+         - service
+           - axiom
+             - StockQuoteService.java
+         - clients
+           - AXIOMClient.java
+
+</pre></div>
+  <p>Since AXIOM is a little different, you're going to need a different
+services.xml file from the one used for POJO. Define it, as shown in Code
+Listing 4.</p><p><b>Code Listing 4: The Service Definition File.</b></p>
+    <div class="source"><pre>&lt;service name="StockQuoteService" scope="application"&gt;
+    &lt;description&gt;
+        Stock Quote Service
+    &lt;/description&gt;
+    &lt;operation name="getPrice"&gt;
+        &lt;messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/&gt;
+    &lt;/operation&gt;
+    &lt;operation name="update"&gt;
+        &lt;messageReceiver class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/&gt;
+    &lt;/operation&gt;
+    &lt;parameter name="ServiceClass"&gt;samples.quickstart.service.axiom.StockQuoteService&lt;/parameter&gt;
+&lt;/service&gt;
+
+</pre></div>
+  <p>Note that it's almost the same, except that the operations are explicitly
+defined in the service.xml file, and the MessageReceivers are now RawXML.</p><p>Now, the above referenced StockQuoteService.java class, a plain Java class
+that uses classes from the Axis2 libraries, is defined as shown in Code
+Listing 5.</p><p><b>Code Listing 5: The StockQuoteService Class using AXIOM</b></p>
+    <div class="source"><pre>package samples.quickstart.service.axiom;
+
+import javax.xml.stream.XMLStreamException;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+
+import java.util.HashMap;
+public class StockQuoteService {
+    private HashMap map = new HashMap();
+
+    public OMElement getPrice(OMElement element) throws XMLStreamException {
+        element.build();
+        element.detach();
+
+        OMElement symbolElement = element.getFirstElement();
+        String symbol = symbolElement.getText();
+
+        String returnText = "42";
+        Double price = (Double) map.get(symbol);
+        if(price != null){
+            returnText  = "" + price.doubleValue();
+        }
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        OMNamespace omNs =
+            fac.createOMNamespace("http://axiom.service.quickstart.samples/xsd", "tns");
+        OMElement method = fac.createOMElement("getPriceResponse", omNs);
+        OMElement value = fac.createOMElement("price", omNs);
+        value.addChild(fac.createOMText(value, returnText));
+        method.addChild(value);
+        return method;
+    }
+
+    public void update(OMElement element) throws XMLStreamException {
+        element.build();
+        element.detach();
+
+        OMElement symbolElement = element.getFirstElement();
+        String symbol = symbolElement.getText();
+
+        OMElement priceElement = (OMElement)symbolElement.getNextOMSibling();
+        String price = priceElement.getText();
+
+        map.put(symbol, new Double(price));
+    }
+}
+
+</pre></div>
+  <p>Axis2 uses AXIOM, or the AXIs Object Model, a <a href="http://www.w3.org/DOM/" class="externalLink" title="External Link">DOM</a> (Document Object Model)-like structure
+that is based on the StAX API (Streaming API for XML). Methods that act as
+services must take as their argument an OMElement, which represents an XML
+element that happens, in this case, to be the payload of the incoming SOAP
+message. Here, you're extracting the contents of the first child of the
+payload element, adding text to it, and using it as content for the return
+OMElement. Unless this is an "in only" service, these methods must return an
+OMElement, because that becomes the payload of the return SOAP message.</p><p>Now build the project by typing ant generate.service in the
+Axis2_HOME/samples/quickstartaxiom directory.</p><p>Place the StockQuoteService.aar file in the webapps/axis2/WEB-INF/services
+directory of the servlet engine, and check to make sure that the service has
+been properly deployed by viewing the list of services at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/listServices
+
+</pre></div>
+  <p>You can also check the custom WSDL at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?wsdl
+
+</pre></div>
+  <p>and the schema at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?xsd
+</pre></div>
+  <p><a name="adb"></a></p></div><div class="subsection"><a name="Generating_the_Service_using_ADB"></a><h3>Generating the Service using ADB</h3><p>To generate and deploy the service using the Axis2 Databinding Framework
+(ADB), execute the following steps.</p><p>Generate the skeleton using the WSDL2Java utility by typing the following
+in the Axis2_HOME/samples/quickstartadb directory:</p>
+    <div class="source"><pre>%AXIS2_HOME%/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.adb -d adb -s -ss -sd -ssi -o build/service
+
+</pre></div>
+  <p>Else, simply type ant generate.service in the
+Axis2_HOME/samples/quickstartadb directory.</p><p>The option -d adb specifies Axis Data Binding (ADB). The -s switch
+specifies synchronous or blocking calls only. The -ss switch creates the
+server side code (skeleton and related files). The -sd switch creates a
+service descriptor (services.xml file). The -ssi switch creates an interface
+for the service skeleton. The service files should now be located at
+build/service.</p><p>If you generated the code by using WSDL2Java directly, next you have to
+modify the generated skeleton to implement the service (if you used "ant
+generate.service", a completed skeleton will be copied over the generated one
+automatically).</p><p>Open the
+build/service/src/samples/quickstart/adb/service/StockQuoteServiceSkeleton.java
+file and modify it to add the functionality of your service to the generated
+methods; shown in Code Listing 6.</p><p><b>Code Listing 6: Defining the Service Skeleton File</b></p>
+    <div class="source"><pre>package samples.quickstart.service.adb;
+
+import samples.quickstart.service.adb.xsd.GetPriceResponse;
+import samples.quickstart.service.adb.xsd.Update;
+import samples.quickstart.service.adb.xsd.GetPrice;
+
+import java.util.HashMap;
+
+public class StockQuoteServiceSkeleton {
+
+    private static HashMap map;
+
+    static{ map = new HashMap(); }
+
+    public void update(Update param0) {
+        map.put(param0.getSymbol(), new Double(param0.getPrice()));
+    }
+
+    public GetPriceResponse getPrice(GetPrice param1) {
+        Double price = (Double) map.get(param1.getSymbol());
+        double ret = 42;
+        if(price != null){
+            ret = price.doubleValue();
+        }
+        GetPriceResponse res =
+                new GetPriceResponse();
+        res.set_return(ret);
+        return res;
+    }
+}
+
+</pre></div>
+  <p>Now you can build the project by typing the following command in the
+build/service directory:</p>
+    <div class="source"><pre>ant jar.server
+
+</pre></div>
+  <p>If all goes well, you should see the BUILD SUCCESSFUL message in your
+window, and the StockQuoteService.aar file in the build/service/build/lib
+directory. Copy this file to the webapps/axis2/WEB-INF/services directory of
+the servlet engine.</p><p>You can check to make sure that the service has been properly deployed by
+viewing the list of services at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/listServices
+
+</pre></div>
+  <p>You can also check the custom WSDL at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?wsdl
+
+</pre></div>
+  <p>and the schema at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?xsd
+</pre></div>
+  <p><a name="xmlbeans"></a></p></div><div class="subsection"><a name="Generating_the_Service_using_XMLBeans"></a><h3>Generating the Service using XMLBeans</h3><p>To generate a service using XMLBeans, execute the following steps.</p><p>Generate the skeleton using the WSDL2Java utility by typing the following
+in the Axis2_HOME/samples/quickstartxmlbeans directory.</p>
+    <div class="source"><pre>%AXIS2_HOME%/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.xmlbeans -d xmlbeans -s -ss -sd -ssi -o build/service
+
+</pre></div>
+  <p>Else simply type ant generate.service in the
+Axis2_HOME/samples/quickstartxmlbeans directory.</p><p>The option -d xmlbeans specifies XML Beans data binding. The -s switch
+specifies synchronous or blocking calls only. The -ss switch creates the
+server side code (skeleton and related files). The -sd switch creates a
+service descriptor (services.xml file). The -ssi switch creates an interface
+for the service skeleton. The service files should now be located at
+build/service.</p><p>If you generated the code by using WSDL2Java directly, next you have to
+modify the generated skeleton to implement the service (if you used "ant
+generate.service", a completed skeleton will be copied over the generated one
+automatically).</p><p>Next open the
+build/service/src/samples/quickstart/service/xmlbeans/StockQuoteServiceSkeleton.java
+file and modify it to add the functionality of your service to the generated
+methods (see Code Listing 7).</p><p><b>Code Listing 7: Defining the Service Skeleton</b></p><p><pre>package samples.quickstart.service.xmlbeans;
+
+import samples.quickstart.service.xmlbeans.xsd.GetPriceDocument;
+import samples.quickstart.service.xmlbeans.xsd.GetPriceResponseDocument;
+import samples.quickstart.service.xmlbeans.xsd.UpdateDocument;
+
+import java.util.HashMap;
+
+public class StockQuoteServiceSkeleton implements StockQuoteServiceSkeletonInterface {
+
+    private static HashMap map;
+
+    static{ map = new HashMap(); }
+
+    public void update(UpdateDocument param0) {<b>        map.put(param0.getUpdate().getSymbol(), new Double(param0.getUpdate().getPrice()));</b>
+    }
+
+    public GetPriceResponseDocument getPrice(GetPriceDocument param1) {<b>        Double price = (Double) map.get(param1.getGetPrice().getSymbol());
+        double ret = 42;
+        if(price != null){
+            ret = price.doubleValue();
+        }
+        System.err.println();
+        GetPriceResponseDocument resDoc =
+                GetPriceResponseDocument.Factory.newInstance();
+        GetPriceResponseDocument.GetPriceResponse res =
+                resDoc.addNewGetPriceResponse();
+        res.setReturn(ret);
+        return resDoc;</b>
+    }
+}</pre>
+</p><p>Build the project by typing the following command in the build/service
+directory, which contains the build.xml file:</p>
+    <div class="source"><pre>ant jar.server
+
+</pre></div>
+  <p>If all goes well, you should see the BUILD SUCCESSFUL message in your
+window, and the StockQuoteService.aar file in the newly created
+build/service/build/lib directory. Copy this file to the
+webapps/axis2/WEB-INF/services directory of the servlet engine.</p><p>You can check to make sure that the service has been properly deployed by
+viewing the list of services at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/listServices
+
+</pre></div>
+  <p>You can also check the custom WSDL at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?wsdl
+
+</pre></div>
+  <p>and the schema at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?xsd
+</pre></div>
+  <p><a name="jibx"></a></p></div><div class="subsection"><a name="Generating_the_Service_using_JiBX"></a><h3>Generating the Service using JiBX</h3><p>To generate and deploy the service using <a href="http://www.jibx.org" class="externalLink" title="External Link">JiBX data binding</a>, execute the following
+steps.</p><p>Generate the skeleton using the WSDL2Java utility by typing the following
+at a console in the Axis2_HOME/samples/quickstartjibx directory:</p>
+    <div class="source"><pre>%AXIS2_HOME%/bin/wsdl2java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.jibx -d jibx -s -ss -sd -ssi -uw -o build/service
+
+</pre></div>
+  <p>Else, simply type "ant generate.service" in the
+Axis2_HOME/samples/quickstartjibx directory.</p><p>The option -d jibx specifies JiBX data binding. The -s switch specifies
+synchronous or blocking calls only. The -ss switch creates the server side
+code (skeleton and related files). The -sd switch creates a service
+descriptor (services.xml file). The -ssi switch creates an interface for the
+service skeleton. The -uw switch unwraps the parameters passed to and from
+the service operations in order to create a more natural programming
+interface.</p><p>After running WSDL2Java, the service files should be located at
+build/service. If you generated the code by using WSDL2Java directly, you
+need to modify the generated skeleton to implement the service (if you used
+"ant generate.service" a completed skeleton will be copied over the generated
+one automatically). Open the
+build/service/src/samples/quickstart/service/jibx/StockQuoteServiceSkeleton.java
+file and modify it to add the functionality of your service to the generated
+methods, as shown in Code Listing 8.</p><p><b>Code Listing 8: Defining the Service Skeleton File</b></p>
+    <div class="source"><pre>package samples.quickstart.service.jibx;
+
+import java.util.HashMap;
+
+public class StockQuoteServiceSkeleton implements StockQuoteServiceSkeletonInterface {
+    private HashMap map = new HashMap();
+
+    public void update(String symbol, Double price) {
+        map.put(symbol, price);
+    }
+
+    public Double getPrice(String symbol) {
+        Double ret = (Double) map.get(symbol);
+        if (ret == null) {
+            ret = new Double(42.0);
+        }
+        return ret;
+    }
+}
+
+</pre></div>
+  <p>Now you can build the project by typing the following command in the
+build/service directory:</p>
+    <div class="source"><pre>ant jar.server
+
+</pre></div>
+  <p>If all goes well, you should see the BUILD SUCCESSFUL message in your
+window, and the StockQuoteService.aar file in the build/service/build/lib
+directory. Copy this file to the webapps/axis2/WEB-INF/services directory of
+the servlet engine.</p><p>You can check to make sure that the service has been properly deployed by
+viewing the list of services at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/listServices
+
+</pre></div>
+  <p>You can also check the custom WSDL at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?wsdl
+
+</pre></div>
+  <p>and the schema at,</p>
+    <div class="source"><pre>http://localhost:8080/axis2/services/StockQuoteService?xsd
+
+</pre></div>
+  <p>For more information on using JiBX with Axis2, see the <a href="jibx/jibx-codegen-integration.html">JiBX code generation
+integration</a> details. You can also check the <a href="http://www.sosnoski.com/jibx-wiki/space/axis2-jibx" class="externalLink" title="External Link">JiBX Axis2 Wiki
+page</a> for updated information about using JiBX with Axis2.</p><p><a name="clients"></a></p></div><div class="subsection"><a name="Creating_Clients"></a><h3>Creating Clients</h3><p>In this section, we'll look at four ways to create clients based on the
+StockQuoteService class: building an AXIOM based client, generating a client
+using Axis2 Databinding Framework (ADB), generating a client using XMLBeans,
+and generating a client using JiBX.</p><p><a name="clientaxiom"></a></p></div><div class="subsection"><a name="Creating_a_Client_with_AXIOM"></a><h3>Creating a Client with AXIOM</h3><p>To build a client using AXIOM, execute the following steps.</p><p>Also, note the directory structure shown in the Creating a service with
+AXIOM section, duplicated below for completeness.</p>
+    <div class="source"><pre>- quickstartaxiom
+   - README.txt
+   - build.xml
+   - resources
+     - META-INF
+       - services.xml
+       - StockQuoteService.wsdl
+   - src
+     - samples
+       - quickstart
+         - service
+           - axiom
+             - StockQuoteService.java
+         - clients
+           - AXIOMClient.java
+
+</pre></div>
+  <p>The above referenced AXIOMClient.java class is defined as follows, shown
+in Code Listing 9.</p><p><b>Code Listing 9: The AXIOMClient class using AXIOM</b></p>
+    <div class="source"><pre>package samples.quickstart.clients;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+
+public class AXIOMClient {
+
+    private static EndpointReference targetEPR = 
+        new EndpointReference("http://localhost:8080/axis2/services/StockQuoteService");
+
+    public static OMElement getPricePayload(String symbol) {
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        OMNamespace omNs = fac.createOMNamespace("http://axiom.service.quickstart.samples/xsd", "tns");
+
+        OMElement method = fac.createOMElement("getPrice", omNs);
+        OMElement value = fac.createOMElement("symbol", omNs);
+        value.addChild(fac.createOMText(value, symbol));
+        method.addChild(value);
+        return method;
+    }
+
+    public static OMElement updatePayload(String symbol, double price) {
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        OMNamespace omNs = fac.createOMNamespace("http://axiom.service.quickstart.samples/xsd", "tns");
+
+        OMElement method = fac.createOMElement("update", omNs);
+
+        OMElement value1 = fac.createOMElement("symbol", omNs);
+        value1.addChild(fac.createOMText(value1, symbol));
+        method.addChild(value1);
+
+        OMElement value2 = fac.createOMElement("price", omNs);
+        value2.addChild(fac.createOMText(value2,
+                                         Double.toString(price)));
+        method.addChild(value2);
+        return method;
+    }
+
+    public static void main(String[] args) {
+        try {
+            OMElement getPricePayload = getPricePayload("WSO");
+            OMElement updatePayload = updatePayload("WSO", 123.42);
+            Options options = new Options();
+            options.setTo(targetEPR);
+            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+
+            ServiceClient sender = new ServiceClient();
+            sender.setOptions(options);
+
+            sender.fireAndForget(updatePayload);
+            System.err.println("done");
+            OMElement result = sender.sendReceive(getPricePayload);
+
+            String response = result.getFirstElement().getText();
+            System.err.println("Current price of WSO: " + response);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+    
+}
+
+</pre></div>
+  <p>Axis2 uses AXIOM, or the AXIs Object Model, a DOM (Document Object
+Model)-like structure that is based on the StAX API (Streaming API for XML).
+Here you setup the payload for the update and getPrice methods of the
+service. The payloads are created similar to how you created the
+getPriceResponse payload for the AXIOM service. Then you setup the Options
+class, and create a ServiceClient that you'll use to communicate with the
+service. First you call the update method, which is a fireAndForget method
+that returns nothing. Lastly, you call the getPrice method, and retrieve the
+current price from the service and display it.</p><p>Now you can build and run the AXIOM client by typing ant run.client in the
+Axis2_HOME/samples/quickstartaxiom directory.</p><p>You should get the following as output:</p>
+    <div class="source"><pre>done
+Current price of WSO: 123.42
+</pre></div>
+  <p><a name="clientadb"></a></p></div><div class="subsection"><a name="Generating_a_Client_using_ADB"></a><h3>Generating a Client using ADB</h3><p>To build a client using Axis Data Binding (ADB), execute the following
+steps.</p><p>Generate the client databings by typing the following in the
+Axis2_HOME/samples/quickstartadb directory:</p>
+    <div class="source"><pre>%AXIS2_HOME%/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.clients -d adb -s -o build/client
+
+</pre></div>
+  <p>Else, simply type ant generate.client in the
+Axis2_HOME/samples/quickstartadb directory.</p><p>Next take a look at
+quickstartadb/src/samples/quickstart/clients/ADBClient.java, and see how it's
+defined in Code Listing 10.</p><p><b>Code Listing 10: The ADBClient Class</b></p>
+    <div class="source"><pre>package samples.quickstart.clients;
+
+import samples.quickstart.service.adb.StockQuoteServiceStub;
+
+public class ADBClient{
+    public static void main(java.lang.String args[]){
+        try{
+            StockQuoteServiceStub stub =
+                new StockQuoteServiceStub
+                ("http://localhost:8080/axis2/services/StockQuoteService");
+
+            getPrice(stub);
+            update(stub);
+
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+
+    /* fire and forget */
+    public static void update(StockQuoteServiceStub stub){
+        try{
+            StockQuoteServiceStub.Update req = new StockQuoteServiceStub.Update();
+            req.setSymbol ("ABC");
+            req.setPrice (42.35);
+
+            stub.update(req);
+            System.err.println("done");
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+
+    /* two way call/receive */
+    public static void getPrice(StockQuoteServiceStub stub){
+        try{
+            StockQuoteServiceStub.GetPrice req = new StockQuoteServiceStub.GetPrice();
+
+            req.setSymbol("ABC");
+
+            StockQuoteServiceStub.GetPriceResponse res =
+                stub.getPrice(req);
+
+            System.err.println(res.get_return());
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+
+}
+
+</pre></div>
+  <p>This class creates a client stub using the Axis Data Bindings you created.
+Then it calls the getPrice and update operations on the Web service. The
+getPrice method operation creates the GetPrice payload and sets the symbol to
+ABC. It then sends the request and displays the current price. The update
+method creates an Update payload, setting the symbol to ABC and the price to
+42.35.</p><p>Now build and run the client by typing ant run.client in the
+Axis2_HOME/samples/quickstartadb directory.</p><p>You should get the following as output:</p>
+    <div class="source"><pre>42
+done
+</pre></div>
+  <p><a name="clientxmlbeans"></a></p></div><div class="subsection"><a name="Generating_a_Client_using_XMLBeans"></a><h3>Generating a Client using XMLBeans</h3><p>To build a client using the XML Beans data bindings, execute the following
+steps.</p><p>Generate the databings by typing the following in the xmlbeansClient
+directory.</p>
+    <div class="source"><pre>%AXIS2_HOME%/bin/WSDL2Java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.service.xmlbeans -d xmlbeans -s -o build/client
+
+</pre></div>
+  <p>Else, simply type ant generate.client in the
+Axis2_HOME/samples/quickstartxmlbeans directory.</p><p>Note that this creates a client stub code and no server side code.</p><p>Next take a look at
+quickstartxmlbeans/src/samples/quickstart/clients/XMLBEANSClient.java, and
+see how it's defined in Code Listing 11.</p><p><b>Code Listing 11: The XMLBEANSClient class</b></p>
+    <div class="source"><pre>package samples.quickstart.clients;
+
+import samples.quickstart.service.xmlbeans.StockQuoteServiceStub;
+import samples.quickstart.service.xmlbeans.xsd.GetPriceDocument;
+import samples.quickstart.service.xmlbeans.xsd.GetPriceResponseDocument;
+import samples.quickstart.service.xmlbeans.xsd.UpdateDocument;
+
+public class XMLBEANSClient{
+
+    public static void main(java.lang.String args[]){
+        try{
+            StockQuoteServiceStub stub =
+                new StockQuoteServiceStub
+                ("http://localhost:8080/axis2/services/StockQuoteService");
+
+            getPrice(stub);
+            update(stub);
+
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+
+    /* fire and forget */
+    public static void update(StockQuoteServiceStub stub){
+        try{
+            UpdateDocument reqDoc = UpdateDocument.Factory.newInstance();
+            UpdateDocument.Update req = reqDoc.addNewUpdate();
+            req.setSymbol ("ABC");
+            req.setPrice (42.32);
+
+            stub.update(reqDoc);
+            System.err.println("done");
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+
+    /* two way call/receive */
+    public static void getPrice(StockQuoteServiceStub stub){
+        try{
+            GetPriceDocument reqDoc = GetPriceDocument.Factory.newInstance();
+            GetPriceDocument.GetPrice req = reqDoc.addNewGetPrice();
+            req.setSymbol("ABC");
+
+            GetPriceResponseDocument res =
+                stub.getPrice(reqDoc);
+
+            System.err.println(res.getGetPriceResponse().getReturn());
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+}
+
+</pre></div>
+  <p>This class creates a client stub using the XML Beans data bindings you
+created. Then it calls the getPrice and the update operations on the Web
+service. The getPrice method operation creates the GetPriceDocument, its
+inner GetPrice classes and sets the symbol to ABC. It then sends the request
+and retrieves a GetPriceResponseDocument and displays the current price. The
+update method creates an UpdateDocument, updates and sets the symbol to ABC
+and price to 42.32, displaying 'done' when complete.</p><p>Now build and run the the project by typing ant run.client in the
+Axis2_HOME/samples/quickstartxmlbeans directory.</p><p>You should get the following as output:</p>
+    <div class="source"><pre>42
+done
+</pre></div>
+  <p><a name="clientjibx"></a></p></div><div class="subsection"><a name="Generating_a_Client_using_JiBX"></a><h3>Generating a Client using JiBX</h3><p>To build a client using JiBX, execute the following steps.</p><p>Generate the client stub by typing the following at a console in the
+Axis2_HOME/samples/quickstartjibx directory.</p>
+    <div class="source"><pre>%AXIS2_HOME%/bin/wsdl2java -uri resources/META-INF/StockQuoteService.wsdl -p samples.quickstart.clients -d jibx -s -uw -o build/client
+
+</pre></div>
+  <p>Else, simply type "ant generate.client".</p><p>Next take a look at
+quickstartjibx/src/samples/quickstart/clients/JiBXClient.java, shown below in
+Code Listing 12.</p><p><b>Code Listing 12: The JiBXClient class</b></p>
+    <div class="source"><pre>package samples.quickstart.clients;
+
+import samples.quickstart.service.jibx.StockQuoteServiceStub;
+
+public class JiBXClient{
+    public static void main(java.lang.String args[]){
+        try{
+            StockQuoteServiceStub stub =
+                new StockQuoteServiceStub
+                ("http://localhost:8080/axis2/services/StockQuoteService");
+
+            getPrice(stub);
+            update(stub);
+
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+
+    /* fire and forget */
+    public static void update(StockQuoteServiceStub stub){
+        try{
+            stub.update("ABC", new Double(42.35));
+            System.err.println("done");
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+
+    /* two way call/receive */
+    public static void getPrice(StockQuoteServiceStub stub){
+        try{
+            System.err.println(stub.getPrice("ABC"));
+        } catch(Exception e){
+            e.printStackTrace();
+            System.err.println("\n\n\n");
+        }
+    }
+
+}
+
+</pre></div>
+  <p>This class uses the created JiBX client stub to access the getPrice and
+the update operations on the Web service. The getPrice method sends a request
+for the stock "ABC" and displays the current price. The update method setsnex
+the price for stock "ABC" to 42.35.</p><p>Now build and run the client by typing "ant run.client" at a console in
+the Axis2_HOME/samples/quickstartjibx directory.</p><p>You should get the following as output:</p>
+    <div class="source"><pre>42
+done
+
+</pre></div>
+  <p>For more information on using JiBX with Axis2, see the <a href="jibx/jibx-codegen-integration.html">JiBX code generation
+integration</a> details.</p><p><a name="summary"></a></p></div><div class="subsection"><a name="Summary"></a><h3>Summary</h3><p>Axis2 is a slick and robust way to get web services up and running in no
+time. This guide presented five methods of creating a service deployable on
+Axis2, and four methods of creating a client to communicate with the
+services. You now have the flexibility to create Web services using a variety
+of different technologies.</p><p><a name="furtherstudy"></a></p></div><div class="subsection"><a name="For_Further_Study"></a><h3>For Further Study</h3><p>Apache Axis2-<a href="http://ws.apache.org/axis2/" class="externalLink" title="External Link">http://ws.apache.org/axis2/</a></p><p>Axis2 Architecture-<a href="http://ws.apache.org/axis2/1_0/Axis2ArchitectureGuide.html" class="externalLink" title="External Link">http://ws.apache.org/axis2/1_0/Axis2ArchitectureGuide.html</a></p><p>Introduction to Apache Axis2-<a href="http://www.redhat.com/magazine/021jul06/features/apache_axis2/" class="externalLink" title="External Link">http://www.redhat.com/magazine/021jul06/features/apache_axis2/</a></p><p>Working With Apache Axis2-<a href="http://www.wso2.net/articles/axis2/java/2006/09/13/working-with-axis2" class="externalLink" title="External Link">http://www.wso2.net/articles/axis2/java/2006/09/13/working-with-axis2</a></p></div></div></div></div><div class="clear"><hr></hr></div>
 <div id="footer"><div class="xright">© 2004-2007, Apache Software Foundation</div><div class="clear"><hr></hr></div></div></body></html>
\ No newline at end of file

Added: webservices/axis2/site/1_2/reference.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_2/reference.html?view=auto&rev=533081
==============================================================================
--- webservices/axis2/site/1_2/reference.html (added)
+++ webservices/axis2/site/1_2/reference.html Fri Apr 27 05:39:33 2007
@@ -0,0 +1,104 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Axis2/Java - Axis2 Reference Guide</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 Axis2" 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: 27 April 2007
+                  | Doc for 1.2</div><div class="xright">
+        
+        <a href="../index.html">Axis2/Java</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://ws.apache.org/axis2/c" class="externalLink" title="External Link">Axis2/C</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://ws.apache.org" class="externalLink" title="External Link">Apache WS</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://www.apache.org" class="externalLink" title="External Link">Apache </a>
+      </div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div id="navcolumn"><div id="menuAxis2_Java"><h5>Axis2/Java</h5><ul><li class="none"><a href="../index.html">Home</a></li></ul></div><div id="menuDownloads"><h5>Downloads</h5><ul><li class="none"><a href="../download.cgi">Releases</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></div><div id="menuDocumentation"><h5>Documentation</h5><ul><li class="expanded"><a href="../1_2/contents.html">Version 1.2</a><ul><li class="none"><a href="../1_2/toc.html">Table of Contents</a></li><li class="none"><a href="../1_2/installationguide.html">Installation Guide</a></li><li class="none"><a href="../1_2/quickstartguide.html">QuickStart Guide</a></li><li class="none"><a href="../1_2/userguide.html">User Guide</a></li><li class="none"><a href="../1_2/pojoguide.html">POJO Guide</a></li><li class="none"><a href="../1_2/spring.html">
 Spring Guide</a></li><li class="none"><a href="../1_2/webadminguide.html">Web Administrator's Guide</a></li><li class="none"><a href="../1_2/migration.html">Migration Guide (from Axis1)</a></li></ul></li><li class="none"><a href="../1_1_1/index.html">Version 1.0</a></li><li class="none"><a href="../1_1/index.html">Version 1.0</a></li><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">Version 0.93</a></li></ul></div><div id="menuResources"><h5>Resources</h5><ul><li class="none"><a href="../faq.html">FAQ</a></li><li class="none"><a href="../articles.html">Articles</a></li><li class="none"><a href="http://wiki.apache.org/ws/FrontPage/Axis2/" class="externalLink" title="External Link">Wiki</a></li><li class="none"><a href="../refLib.html">Reference Library</a></li><li class="none"><a href
 ="http://ws.apache.org/axis2/1_2/api/index.html" class="externalLink" title="External Link">Online Java Docs</a></li></ul></div><div id="menuGet_Involved"><h5>Get Involved</h5><ul><li class="none"><a href="../overview.html">Overview</a></li><li class="none"><a href="../svn.html">Checkout the Source</a></li><li class="none"><a href="../mail-lists.html">Mailing Lists</a></li><li class="none"><a href="../guidelines.html">Developer Guidelines</a></li><li class="none"><a href="../siteHowTo.html">Build the Site</a></li></ul></div><div id="menuProject_Information"><h5>Project Information</h5><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><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="../thanks.html">Acknowledgements</a></li><li class="none"><a hr
 ef="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="External Link">License</a></li></ul></div><a href="http://maven.apache.org/" 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"><p><a name="_Toc96697849" id="_Toc96697849"></a></p></div><div class="section"><a name="Axis2_Reference_Guide"></a><h2>Axis2 Reference Guide</h2><p><a name="wsdl2code"></a></p><div class="subsection"><a name="WSDL2Java_Reference"></a><h3>WSDL2Java Reference</h3>
+    <div class="source"><pre>NAME
+       wsdl2java.sh or wsdl2java.bat - Generates java code according to a given WSDL file to handle Web service invocation.
+       These scripts can be found under the bin directory of the Axis2 distribution.
+
+SYNOPSIS
+       wsdl2java.sh [OPTION]... -uri &lt;Location of WSDL&gt;
+
+DESCRIPTION
+       Given a WSDL file, this generates java code to handle Web service invocations.
+
+        -o &lt;output Location&gt; : output file location
+        -a : Generate async style code only. Default is off
+        -s : Generate sync style code only. Default is off. takes precedence over -a
+        -p &lt;package name&gt; : set custom package name
+        -l &lt;language&gt; : valid languages are java and csharp. Default is java
+        -t : Generate TestCase to test the generated code
+        -ss : Generate server side code (i.e. skeletons). Default is off
+        -sd : Generate service descriptor (i.e. services.xml). Default is off. Valid with -ss
+        -d &lt;databinding&gt; : valid databinding(s) are adb, xmlbeans and jaxme. Default is adb
+        -g : Generates all the classes. valid only with the -ss (This will generate client and server codes)
+        -pn &lt;port_name&gt; : name of port in the presence of multiple ports
+        -sn &lt;service_name&gt; : name of service in the presence of multiple services
+        -u : unpacks the databinding classes
+        -r &lt;repository_path&gt; : path of the repository against which code is generated
+	-ns2p ns1=pkg1,ns2=pkg2 : Specify a custom package name for each namespace specified in the wsdl's schema
+	-ssi : Generate an interface for the service implementation (Default: off)
+	-em : Specify an external mapping file
+	-wv : WSDL Version. Valid Options : 2, 2.0, 1.1
+	-f : Generate the source output folder without the src directory
+	-uw : Switch on un-wrapping.
+	-S &lt;folder name&gt; : Generated source folder name. (Default: src)
+	-R &lt;folder name&gt; : Generated resources folder name. (Default: resources)
+	
+EXAMPLES
+       wsdl2java.sh -uri ../samples/wsdl/Axis2SampleDocLit.wsdl
+       wsdl2java.sh -uri ../samples/wsdl/Axis2SampleDocLit.wsdl -ss -sd 
+       wsdl2java.sh -uri ../samples/wsdl/Axis2SampleDocLit.wsdl -ss -sd -d xmlbeans -o ../samples -p org.apache.axis2.userguide
+
+</pre></div>
+  <p><a name="wsdl2java"></a></p></div><div class="subsection"><a name="Java2WSDL_Reference"></a><h3>Java2WSDL Reference</h3>
+    <div class="source"><pre>NAME
+       Java2WSDL.sh or Java2WSDL.bat - Generates the appropriate WSDL file for a given java class.
+       These scripts can be found under the bin directory of the Axis2 distribution.
+
+SYNOPSIS
+       Java2WSDL.sh [OPTION]... -cn &lt;fully qualified class name&gt;
+
+DESCRIPTION
+       Given a java class generates a WSDL file for the given java class. 
+
+       -o &lt;output Location&gt; : output file location
+       -cp &lt;class path uri&gt; : list of classpath entries - (urls)
+       -tn &lt;target namespace&gt; : target namespace
+       -tp &lt;target namespace prefix&gt; : target namespace prefix
+       -stn &lt;schema target namespace&gt; : target namespace for schema
+       -stp &lt;schema target namespace prefix&gt; : target namespace prefix for schema
+       -sn &lt;service name&gt; : service name
+       -of &lt;output file name&gt; : output file name for the WSDL
+       -st &lt;binding style&gt; : style for the WSDL
+       -u &lt;binding use&gt; : use for the WSDL
+       -l &lt;soap address&gt; : address of the port for the WSDL
+       -efd &lt;qualified/unqualified&gt; : Setting for elementFormDefault (defaults to qualified)
+       -afd &lt;qualified/unqualified&gt; : Setting for attributeFormDefault (defaults to qualified)
+       -xc &lt;extra class&gt; : Extra class for which schematype must be generated.  Use as : -xc class1 -xc class2 ...
+EXAMPLES
+       Java2WSDL.sh -cn ../samples/test/searchTool.Search
+       Java2WSDL.sh -cn ../samples/test/searchTool.Search -sn search
+       Java2WSDL.sh -cn ../samples/test/searchTool.Search -u -sn search
+       Java2WSDL.sh -cn ../samples/test/searchTool.Search -sn search -o ../samples/test/wsdl  
+       
+
+
+</pre></div>
+  </div></div></div></div><div class="clear"><hr></hr></div><div id="footer"><div class="xright">© 2004-2007, Apache Software Foundation</div><div class="clear"><hr></hr></div></div></body></html>
\ No newline at end of file

Added: webservices/axis2/site/1_2/resources/schemas/module.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_2/resources/schemas/module.xsd?view=auto&rev=533081
==============================================================================
--- webservices/axis2/site/1_2/resources/schemas/module.xsd (added)
+++ webservices/axis2/site/1_2/resources/schemas/module.xsd Fri Apr 27 05:39:33 2007
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Created by Eran Chinthaka -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:element name="module">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="Description" minOccurs="0"/>
+				<xs:element name="inflow" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="handler"  type="handlerType"  minOccurs="0" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="outflow" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element name="handler"  type="handlerType" minOccurs="0" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element ref="parameter" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element ref="operation" minOccurs="0"/>
+				<xs:element name="Outfaultflow" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element  name="handler"  type="handlerType" minOccurs="0" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+				<xs:element name="INfaultflow" minOccurs="0">
+					<xs:complexType>
+						<xs:sequence>
+							<xs:element  name="handler"  type="handlerType"  minOccurs="0" maxOccurs="unbounded"/>
+						</xs:sequence>
+					</xs:complexType>
+				</xs:element>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="optional"/>
+			<xs:attribute name="class" type="xs:string" use="optional"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="order">
+		<xs:complexType>
+			<xs:attribute name="phase" type="xs:string" use="required"/>
+			<xs:attribute name="after" type="xs:string" use="optional"/>
+			<xs:attribute name="before" type="xs:string" use="optional"/>
+			<xs:attribute name="phaseFirst" type="xs:string" use="optional"/>
+			<xs:attribute name="phaseLast" type="xs:string" use="optional"/>
+		</xs:complexType>
+	</xs:element>
+
+		<xs:complexType name="handlerType">
+			<xs:sequence>
+				<xs:element ref="order"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="class" type="xs:string" use="required"/>
+		</xs:complexType>
+
+	<xs:element name="parameter">
+		<xs:complexType>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="locked" type="xs:boolean" use="optional" default="false"/>
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="operation">
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="messageReceiver" minOccurs="0">
+					<xs:complexType>
+						<xs:attribute name="class"/>
+					</xs:complexType>
+				</xs:element>
+				<xs:element ref="parameter"/>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			<xs:attribute name="mep" type="xs:anyURI" use="required"/>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>

Added: webservices/axis2/site/1_2/resources/schemas/services.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_2/resources/schemas/services.xsd?view=auto&rev=533081
==============================================================================
--- webservices/axis2/site/1_2/resources/schemas/services.xsd (added)
+++ webservices/axis2/site/1_2/resources/schemas/services.xsd Fri Apr 27 05:39:33 2007
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:complexType name="operationType">
+		<xs:sequence>
+			<xs:element name="actionMapping" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="outputActionMapping" type="xs:string" minOccurs="0" maxOccurs="1"/>
+			<xs:element name="faultActionMapping" type="xs:string" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:attribute name="faultName" use="required"/>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="messageReceiver" minOccurs="0">
+				<xs:complexType>
+					<xs:attribute name="class" use="required"/>
+				</xs:complexType>
+			</xs:element>
+			<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"/>
+			<xs:element name="module" minOccurs="0" maxOccurs="unbounded">
+				<xs:complexType>
+					<xs:attribute name="ref" use="required"/>
+				</xs:complexType>
+			</xs:element>
+		</xs:sequence>
+		<xs:attribute name="name" type="xs:string" use="required"/>
+		<xs:attribute name="mep" type="xs:anyURI" use="optional"/>
+	</xs:complexType>
+	<xs:complexType name="parameterType">
+		<xs:annotation>
+			<xs:documentation>Type describing a parameter. This element contains two attributes
+         and may contain any element or simply a string</xs:documentation>
+		</xs:annotation>
+		<xs:complexContent>
+			<xs:extension base="xs:anyType">
+				<xs:attribute name="name" type="xs:string" use="required"/>
+				<xs:attribute name="locked" type="xs:boolean" use="optional"/>
+			</xs:extension>
+		</xs:complexContent>
+	</xs:complexType>
+	<xs:element name="service">
+		<xs:annotation>
+			<xs:documentation>
+			Service element description. This has a number of
+             parameter and operation elements nested
+     </xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element name="description" type="xs:string" minOccurs="0"/>
+				<xs:element name="parameter" type="parameterType" minOccurs="0" maxOccurs="unbounded"/>
+				<xs:element name="operation" type="operationType" minOccurs="0" maxOccurs="unbounded"/>
+                        <xs:element name="module" minOccurs="0" maxOccurs="unbounded">
+				    <xs:complexType>
+					<xs:attribute name="ref" use="required"/>
+				    </xs:complexType>
+			      </xs:element>
+                        <xs:element name="transports" minOccurs="0" maxOccurs="unbounded">
+                            <xs:sequence>
+				        <xs:element name="transport" type="xs:string" minOccurs="1"/>
+                            </xs:sequence>
+			      </xs:element>
+                        <xs:element name="messageReceivers" minOccurs="0" maxOccurs="unbounded">
+                            <xs:sequence>
+				        <xs:element name="messageReceiver" maxOccurs="unbounded">
+				            <xs:complexType>
+					        <xs:attribute name="mep" type="xs:string"  use="required"/>
+                                       <xs:attribute name="class" type="xs:string"  use="required"/>
+				            </xs:complexType>
+			               </xs:element>
+                            </xs:sequence>
+			      </xs:element>
+			</xs:sequence>
+			<xs:attribute name="name" type="xs:string" use="required"/>
+			      <xs:attribute name="activate" type="xs:boolean" use="optional"/>
+                  <xs:attribute name="scope" type="xs:string" use="optional"/>
+                  <xs:attribute name="targetNamespace" type="xs:string" use="optional"/>
+			<xs:attribute name="wsaddressing" type="xs:string" />
+		</xs:complexType>
+	</xs:element>
+	<xs:element name="serviceGroup">
+		<xs:annotation>
+			<xs:documentation>
+			 holder for multiple service elements. 
+     </xs:documentation>
+		</xs:annotation>
+		<xs:complexType>
+			<xs:sequence>
+				<xs:element ref="service" maxOccurs="unbounded"/>
+			</xs:sequence>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>

Added: webservices/axis2/site/1_2/rest-ws.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_2/rest-ws.html?view=auto&rev=533081
==============================================================================
--- webservices/axis2/site/1_2/rest-ws.html (added)
+++ webservices/axis2/site/1_2/rest-ws.html Fri Apr 27 05:39:33 2007
@@ -0,0 +1,136 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Axis2/Java - </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 Axis2" 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: 27 April 2007
+                  | Doc for 1.2</div><div class="xright">
+        
+        <a href="../index.html">Axis2/Java</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://ws.apache.org/axis2/c" class="externalLink" title="External Link">Axis2/C</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://ws.apache.org" class="externalLink" title="External Link">Apache WS</a>
+      
+        
+          
+            <span class="separator">|</span>
+          
+        
+        <a href="http://www.apache.org" class="externalLink" title="External Link">Apache </a>
+      </div><div class="clear"><hr></hr></div></div><div id="leftColumn"><div id="navcolumn"><div id="menuAxis2_Java"><h5>Axis2/Java</h5><ul><li class="none"><a href="../index.html">Home</a></li></ul></div><div id="menuDownloads"><h5>Downloads</h5><ul><li class="none"><a href="../download.cgi">Releases</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></div><div id="menuDocumentation"><h5>Documentation</h5><ul><li class="expanded"><a href="../1_2/contents.html">Version 1.2</a><ul><li class="none"><a href="../1_2/toc.html">Table of Contents</a></li><li class="none"><a href="../1_2/installationguide.html">Installation Guide</a></li><li class="none"><a href="../1_2/quickstartguide.html">QuickStart Guide</a></li><li class="none"><a href="../1_2/userguide.html">User Guide</a></li><li class="none"><a href="../1_2/pojoguide.html">POJO Guide</a></li><li class="none"><a href="../1_2/spring.html">
 Spring Guide</a></li><li class="none"><a href="../1_2/webadminguide.html">Web Administrator's Guide</a></li><li class="none"><a href="../1_2/migration.html">Migration Guide (from Axis1)</a></li></ul></li><li class="none"><a href="../1_1_1/index.html">Version 1.0</a></li><li class="none"><a href="../1_1/index.html">Version 1.0</a></li><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">Version 0.93</a></li></ul></div><div id="menuResources"><h5>Resources</h5><ul><li class="none"><a href="../faq.html">FAQ</a></li><li class="none"><a href="../articles.html">Articles</a></li><li class="none"><a href="http://wiki.apache.org/ws/FrontPage/Axis2/" class="externalLink" title="External Link">Wiki</a></li><li class="none"><a href="../refLib.html">Reference Library</a></li><li class="none"><a href
 ="http://ws.apache.org/axis2/1_2/api/index.html" class="externalLink" title="External Link">Online Java Docs</a></li></ul></div><div id="menuGet_Involved"><h5>Get Involved</h5><ul><li class="none"><a href="../overview.html">Overview</a></li><li class="none"><a href="../svn.html">Checkout the Source</a></li><li class="none"><a href="../mail-lists.html">Mailing Lists</a></li><li class="none"><a href="../guidelines.html">Developer Guidelines</a></li><li class="none"><a href="../siteHowTo.html">Build the Site</a></li></ul></div><div id="menuProject_Information"><h5>Project Information</h5><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><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="../thanks.html">Acknowledgements</a></li><li class="none"><a hr
 ef="http://www.apache.org/licenses/LICENSE-2.0.html" class="externalLink" title="External Link">License</a></li></ul></div><a href="http://maven.apache.org/" 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"><p>html&gt;
+</p></div><div class="section"></div><div class="section"><a name="RESTful_Web_Services_Support"></a><h2>RESTful Web Services Support</h2><p>This document presents an introduction on REST and REST with HTTP POST and
+GET.</p><div class="subsection"><a name="Content"></a><h3>Content</h3><ul>
+  <li><a href="#intro">Introduction</a></li>
+  <li><a href="#rest_with_post">Doing REST Web Services with HTTP POST</a>
+    <ul>
+      <li><a href="#sample">Sample REST - HTTP POST Client</a></li>
+    </ul>
+  </li>
+  <li><a href="#rest_with_get">Access a REST Web Service via HTTP GET</a></li>
+</ul><p><a name="intro"></a></p></div><div class="subsection"><a name="Introduction"></a><h3>Introduction</h3><p>WSDL 2.0 HTTP Binding defines a way to implement REST (Representational
+State Transfer) with Web services. Axis2 implements the most defined HTTP
+binding specification. REST Web services are a reduced subset of the usual
+Web service stack.</p><p>The Axis2 REST implementation assumes the following properties:</p><ol>
+  <li>REST Web services are Synchronous and Request Response in nature.</li>
+  <li>When REST Web services are accessed via GET, the service and the
+    operations are identified based on the URL. The parameters are assumed as
+    parameters of the Web service. In this case, the GET based REST Web
+    services support only simple types as arguments and it should adhere to
+    the <a href="http://www.w3.org/TR/2006/CR-wsdl20-adjuncts-20060327/#_operation_iri_style" class="externalLink" title="External Link">IRI
+    style</a>.</li>
+  <li>POST based Web services do not need a SOAP Envelope or a SOAP Body.
+    REST Web Services do not have Headers and the payload is sent
+  directly.</li>
+</ol><p>Axis2 can be configured as a REST Container and can be used to send and
+receive RESTful Web service requests and responses. REST Web services can be
+accessed using HTTP GET and POST.</p><p><a name="rest_with_post"></a></p></div><div class="subsection"><a name="REST_Web_Services_with_HTTP_POST"></a><h3>REST Web Services with HTTP POST</h3><p>If REST is enabled, the Axis2 server will act as both a REST endpoint and
+a SOAP endpoint. When a message is received, if the content type is text/xml
+and if the SOAPAction Header is missing, then the message is treated as a
+RESTful Message, if not it is treated as a usual SOAP Message.</p><p>On sending a message, whether the message is RESTful or not, can be
+decided from the client API.<br></br>
+Set a property in the client API.<br></br>
+</p>
+    <div class="source"><pre>...
+Options options = new Options();
+options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
+...
+</pre></div>
+  <p><a name="sample"></a></p></div><div class="subsection"><a name="Sample_REST_-_HTTP_POST_Client"></a><h3>Sample REST - HTTP POST Client</h3><p>There is an example named, userguide.clients.RESTClient.java found in
+AXIS2_HOME/samples/userguide/src/userguide/clients which demonstrates the
+usage of the above. It uses the "echo" operation of the
+<code>userguide.example1.MyService </code>of the
+AXIS2_HOME/samples/userguide/src/userguide/example1. </p><p>The class source will be as follows:
+    <div class="source"><pre></pre></div>
+  </p>
+    <div class="source"><pre>public class RESTClient {
+
+    private static String toEpr = "http://localhost:8080/axis2/services/MyService";
+    
+    public static void main(String[] args) throws AxisFault {
+
+        Options options = new Options();
+        options.setTo(new EndpointReference(toEpr));
+        
+        options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
+
+        ServiceClient sender = new ServiceClient();
+        sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
+        sender.setOptions(options);
+        OMElement result = sender.sendReceive(getPayload());
+
+        try {
+            XMLStreamWriter writer = XMLOutputFactory.newInstance()
+                    .createXMLStreamWriter(System.out);
+            result.serialize(writer);
+            writer.flush();
+        } catch (XMLStreamException e) {
+            e.printStackTrace();
+        } catch (FactoryConfigurationError e) {
+            e.printStackTrace();
+        }
+    }
+    private static OMElement getPayload() {
+        OMFactory fac = OMAbstractFactory.getOMFactory();
+        OMNamespace omNs = fac.createOMNamespace(
+                "http://example1.org/example1", "example1");
+        OMElement method = fac.createOMElement("echo", omNs);
+        OMElement value = fac.createOMElement("Text", omNs);
+        value.addChild(fac.createOMText(value, "Axis2 Echo String "));
+        method.addChild(value);
+
+        return method;
+    }
+}
+</pre></div>
+  <p><a name="rest_with_get"></a></p></div><div class="subsection"><a name="Access_a_REST_Web_Service_via_HTTP_GET"></a><h3>Access a REST Web Service via HTTP GET</h3><p>Axis2 allows users to access Web services that have simple type parameters
+via HTTP GET. For example, the following URL requests the Version Service via
+HTTP GET. However, the Web service arriving via GET assumes REST. Other
+parameters are converted into XML and put into the SOAP body.</p>
+    <div class="source"><pre><pre>http://127.0.0.1:8080/axis2/services/Version/getVersion</pre>
+</pre></div>
+  <p>The result can be shown in the browser as follows:</p><img src="/images/userguide/http-get-ws.jpg" alt=""></img><p>For example, the following request,</p>
+    <div class="source"><pre><pre>http://127.0.0.1:8080/axis2/services/Version/getVersion</pre>
+</pre></div>
+  <p>will be converted into the following SOAP message for processing by
+Axis2.
+    <div class="source"><pre>
+<pre> 
+   &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
+      &lt;soapenv:Body&gt;   
+          &lt;axis2:getVersion xmlns:axis2="http://ws.apache.org/goGetWithREST" /&gt;
+      &lt;/soapenv:Body&gt;
+   &lt;/soapenv:Envelope&gt;
+    </pre>
+</pre></div>
+  </p></div><div class="subsection"><a name="Resources"></a><h3>Resources</h3><p>How I Explained REST to My Wife, By Ryan Tomayko- <a href="http://naeblis.cx/articles/2004/12/12/rest-to-my-wife" class="externalLink" title="External Link">http://naeblis.cx/articles/2004/12/12/rest-to-my-wife</a></p><p>Building Web Services the REST Way, By Roger L. Costello- <a href="http://www.xfront.com/REST-Web-Services.html" class="externalLink" title="External Link">
+http://www.xfront.com/REST-Web-Services.html</a></p><p>Resource-oriented vs. activity-oriented Web services, By James Snell- <a href="http://www-128.ibm.com/developerworks/webservices/library/ws-restvsoap/" class="externalLink" title="External Link">http://www-128.ibm.com/developerworks/webservices/library/ws-restvsoap/</a></p></div></div></div></div><div class="clear"><hr></hr></div><div id="footer"><div class="xright">© 2004-2007, Apache Software Foundation</div><div class="clear"><hr></hr></div></div></body></html>
\ No newline at end of file



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