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/08/13 12:13:23 UTC
svn commit: r565295 [10/14] - in /webservices/axis2/site/1_3: ./ adb/ jibx/
src/
Added: webservices/axis2/site/1_3/reference.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/reference.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/reference.html (added)
+++ webservices/axis2/site/1_3/reference.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,383 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title>Apache Axis2 - </title>
+ <style type="text/css" media="all">
+ @import url("../css/maven-base.css");
+ @import url("../css/maven-theme.css");
+ @import url("../css/site.css");
+ </style>
+ <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body class="composite">
+ <div id="banner">
+ <a href="../" id="bannerLeft">
+
+ <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+
+ </a>
+ <span id="bannerRight">
+
+ <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+
+ </span>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="breadcrumbs">
+
+
+
+
+
+
+
+ <div class="xleft">
+ Last Published: 08/13/2007
+ </div>
+ <div class="xright"> <a href="../index.html">Axis2/Java</a>
+ |
+ <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+ |
+ <a href="../../../">Apache WS</a>
+ |
+ <a href="http://www.apache.org">Apache</a>
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="leftColumn">
+ <div id="navcolumn">
+
+
+
+
+
+
+
+ <h5>Axis2/Java</h5>
+ <ul>
+
+ <li class="none">
+ <a href="../index.html">Home</a>
+ </li>
+ </ul>
+ <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>
+ <h5>Documentation</h5>
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="expanded">
+ <a href="../1_3/contents.html">Version 1.3</a>
+ <ul>
+
+ <li class="none">
+ <a href="../1_3/toc.html">Table of Contents</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/installationguide.html">Installation Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/quickstartguide.html">QuickStart Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/userguide.html">User Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/pojoguide.html">POJO Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/spring.html">Spring Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/webadminguide.html">Web Administrator's Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/migration.html">Migration Guide (from Axis1)</a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="none">
+ <a href="../1_2/contents.html">Version 1.2</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_1_1/contents.html">Version 1.1.1</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_1/contents.html">Version 1.1</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>
+ <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/">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_3/api/index.html">Online Java Docs</a>
+ </li>
+ </ul>
+ <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="../release-process.html">Release Process</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>
+ <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">Source Code</a>
+ </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">License</a>
+ </li>
+ </ul>
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="../images/logos/maven-feather.png"></img>
+ </a>
+
+
+
+
+
+
+
+ </div>
+ </div>
+ <div id="bodyColumn">
+ <div id="contentBox">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta name="generator" content="HTML Tidy for Windows (vers 14 June 2007), see www.w3.org"></meta>
+<meta http-equiv="content-type" content=""></meta>
+Axis2 Reference Guide
+<link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+<a name="_Toc96697849"></a>
+<h1 align="center">Axis2 Reference Guide</h1>
+<a name="wsdl2code"></a>
+<h2>WSDL2Java Reference</h2>
+<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 <Location of WSDL>
+
+DESCRIPTION
+ Given a WSDL file, this generates java code to handle Web service invocations.
+
+ -o <output Location> : 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 <package name> : set custom package name
+ -l <language> : valid languages are java and c. 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 <databinding> : 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 <port_name> : name of port in the presence of multiple ports
+ -sn <service_name> : name of service in the presence of multiple services
+ -u : unpacks the databinding classes
+ -r <repository_path> : 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 <folder name> : Generated source folder name. (Default: src)
+ -R <folder name> : 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>
+<a name="wsdl2java"></a>
+<h2>Java2WSDL Reference</h2>
+<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 <fully qualified class name>
+
+DESCRIPTION
+ Given a java class generates a WSDL file for the given java class.
+
+ -o <output Location> : output file location
+ -cp <class path uri> : list of classpath entries - (urls)
+ -tn <target namespace> : target namespace
+ -tp <target namespace prefix> : target namespace prefix
+ -stn <schema target namespace> : target namespace for schema
+ -stp <schema target namespace prefix> : target namespace prefix for schema
+ -sn <service name> : service name
+ -of <output file name> : output file name for the WSDL
+ -st <binding style> : style for the WSDL
+ -u <binding use> : use for the WSDL
+ -l <soap address> : address of the port for the WSDL
+ -efd <qualified/unqualified> : Setting for elementFormDefault (defaults to qualified)
+ -afd <qualified/unqualified> : Setting for attributeFormDefault (defaults to qualified)
+ -xc <extra class> : 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>
+
+</html>
+ </div>
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ <div id="footer">
+ <div class="xright">©
+ 2004-2007
+
+ Apache Software Foundation
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ </body>
+</html>
Added: webservices/axis2/site/1_3/rest-ws.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/rest-ws.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/rest-ws.html (added)
+++ webservices/axis2/site/1_3/rest-ws.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,448 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title>Apache Axis2 - </title>
+ <style type="text/css" media="all">
+ @import url("../css/maven-base.css");
+ @import url("../css/maven-theme.css");
+ @import url("../css/site.css");
+ </style>
+ <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body class="composite">
+ <div id="banner">
+ <a href="../" id="bannerLeft">
+
+ <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+
+ </a>
+ <span id="bannerRight">
+
+ <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+
+ </span>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="breadcrumbs">
+
+
+
+
+
+
+
+ <div class="xleft">
+ Last Published: 08/13/2007
+ </div>
+ <div class="xright"> <a href="../index.html">Axis2/Java</a>
+ |
+ <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+ |
+ <a href="../../../">Apache WS</a>
+ |
+ <a href="http://www.apache.org">Apache</a>
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="leftColumn">
+ <div id="navcolumn">
+
+
+
+
+
+
+
+ <h5>Axis2/Java</h5>
+ <ul>
+
+ <li class="none">
+ <a href="../index.html">Home</a>
+ </li>
+ </ul>
+ <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>
+ <h5>Documentation</h5>
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="expanded">
+ <a href="../1_3/contents.html">Version 1.3</a>
+ <ul>
+
+ <li class="none">
+ <a href="../1_3/toc.html">Table of Contents</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/installationguide.html">Installation Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/quickstartguide.html">QuickStart Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/userguide.html">User Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/pojoguide.html">POJO Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/spring.html">Spring Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/webadminguide.html">Web Administrator's Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/migration.html">Migration Guide (from Axis1)</a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="none">
+ <a href="../1_2/contents.html">Version 1.2</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_1_1/contents.html">Version 1.1.1</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_1/contents.html">Version 1.1</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>
+ <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/">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_3/api/index.html">Online Java Docs</a>
+ </li>
+ </ul>
+ <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="../release-process.html">Release Process</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>
+ <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">Source Code</a>
+ </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">License</a>
+ </li>
+ </ul>
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="../images/logos/maven-feather.png"></img>
+ </a>
+
+
+
+
+
+
+
+ </div>
+ </div>
+ <div id="bodyColumn">
+ <div id="contentBox">
+ <html>
+<head>
+ <meta http-equiv="content-type" content=""></meta>
+ RESTful Web Services Support
+ <link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+
+<h1>RESTful Web Services Support</h1>
+
+<p>This document presents an introduction on REST and REST with HTTP POST and
+GET.</p>
+
+<h2>Content</h2>
+<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>
+<a name="intro"></a>
+
+<h2>Introduction</h2>
+
+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.
+
+The Axis2 REST implementation assumes the following properties:
+<ol type="1">
+ <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">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>
+
+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.
+<a name="rest_with_post"></a>
+
+<h2>REST Web Services with HTTP POST</h2>
+
+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.
+
+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>
+
+<pre>...
+Options options = new Options();
+options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
+...</pre>
+<a name="sample"></a>
+
+<h3>Sample REST - HTTP POST Client</h3>
+
+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.
+
+The class source will be as follows:<div class="source"><pre>
+<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>
+</pre></div><a name="rest_with_get"></a>
+
+<h2>Access a REST Web Service via HTTP GET</h2>
+
+<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"></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>will be converted into the following SOAP message for processing by
+Axis2.<div class="source"><pre>
+<pre>
+ <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
+ <soapenv:Body>
+ <axis2:getVersion xmlns:axis2="http://ws.apache.org/goGetWithREST" />
+ </soapenv:Body>
+ </soapenv:Envelope>
+ </pre>
+</pre></div>
+<h2>Resources</h2>
+
+<p>How I Explained REST to My Wife, By Ryan Tomayko- <a href="http://naeblis.cx/articles/2004/12/12/rest-to-my-wife">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">
+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/">http://www-128.ibm.com/developerworks/webservices/library/ws-restvsoap/</a></p>
+
+</html>
+ </div>
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ <div id="footer">
+ <div class="xright">©
+ 2004-2007
+
+ Apache Software Foundation
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ </body>
+</html>
Added: webservices/axis2/site/1_3/soapmonitor-module.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/soapmonitor-module.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/soapmonitor-module.html (added)
+++ webservices/axis2/site/1_3/soapmonitor-module.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,438 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title>Apache Axis2 - </title>
+ <style type="text/css" media="all">
+ @import url("../css/maven-base.css");
+ @import url("../css/maven-theme.css");
+ @import url("../css/site.css");
+ </style>
+ <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body class="composite">
+ <div id="banner">
+ <a href="../" id="bannerLeft">
+
+ <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+
+ </a>
+ <span id="bannerRight">
+
+ <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+
+ </span>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="breadcrumbs">
+
+
+
+
+
+
+
+ <div class="xleft">
+ Last Published: 08/13/2007
+ </div>
+ <div class="xright"> <a href="../index.html">Axis2/Java</a>
+ |
+ <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+ |
+ <a href="../../../">Apache WS</a>
+ |
+ <a href="http://www.apache.org">Apache</a>
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="leftColumn">
+ <div id="navcolumn">
+
+
+
+
+
+
+
+ <h5>Axis2/Java</h5>
+ <ul>
+
+ <li class="none">
+ <a href="../index.html">Home</a>
+ </li>
+ </ul>
+ <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>
+ <h5>Documentation</h5>
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="expanded">
+ <a href="../1_3/contents.html">Version 1.3</a>
+ <ul>
+
+ <li class="none">
+ <a href="../1_3/toc.html">Table of Contents</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/installationguide.html">Installation Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/quickstartguide.html">QuickStart Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/userguide.html">User Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/pojoguide.html">POJO Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/spring.html">Spring Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/webadminguide.html">Web Administrator's Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/migration.html">Migration Guide (from Axis1)</a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="none">
+ <a href="../1_2/contents.html">Version 1.2</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_1_1/contents.html">Version 1.1.1</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_1/contents.html">Version 1.1</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>
+ <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/">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_3/api/index.html">Online Java Docs</a>
+ </li>
+ </ul>
+ <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="../release-process.html">Release Process</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>
+ <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">Source Code</a>
+ </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">License</a>
+ </li>
+ </ul>
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="../images/logos/maven-feather.png"></img>
+ </a>
+
+
+
+
+
+
+
+ </div>
+ </div>
+ <div id="bodyColumn">
+ <div id="contentBox">
+ <html>
+<head>
+ <meta http-equiv="content-type" content=""></meta>
+ The SOAP Monitor Module
+ <link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+
+<h1>Using the SOAP Monitor</h1>
+
+<p>Web service developers often want to see the SOAP messages that are being
+used to invoke the Web services, along with the results of those messages.
+The goal of the SOAP Monitor utility is to provide a way for the developers
+to monitor these SOAP messages without requiring any special configuration or
+restarting the server.</p>
+
+<p>In this utility, a handler has been written and added to the global
+handler chain. As SOAP requests and responses are received, the SOAP message
+information is forwarded to a SOAP monitor service where it can be displayed
+using a Web browser interface. The SOAP message information is accessed by a
+Web browser by going to http://localhost:8080/axis2/SOAPMonitor (where 8080
+is the port number where the application server is running). The SOAP message
+information is displayed through a Web browser by using an applet that opens
+a socket connection to the SOAP monitor service. This applet requires a Java
+plug-in 1.3 or higher to be installed in your browser. If you do not have a
+correct plug-in, the browser will prompt you to install one. The port used by
+the SOAP monitor service to communicate with applets is configurable. Edit
+the web.xml file to change the port used by the Axis2 Web application.</p>
+
+<p>The SOAP Monitor module (soapmonitor.mar) is available in the axis2.war
+but it is not engaged by default. The SOAP Monitor is NOT enabled by default
+for security reasons.</p>
+
+<p>The SOAP Monitor can be engaged by inserting the following in the
+axis2.xml file.</p>
+<div class="source"><pre><pre> <module ref="soapmonitor"/></pre>
+</pre></div>
+<p>In the axis2.xml file, define your phase orders for the 'soapmonitorPhase'
+referenced in the module.xml of soapmonitor.mars. Below is an example which
+should NOT be copied exactly, since the default phases change occasionally.
+The important point here is that 'soapmonitorPhase' should be placed under
+the 'user can add his own phases to this area' comment in the 'inflow',
+'outflow', 'INfaultflow', and 'Outfaultflow' sections.</p>
+<pre> <phaseOrder type="inflow">
+ <!--System pre defined phases-->
+ <phase name="TransportIn"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+ <handler name="AddressingBasedDispatcher"
+ class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="RequestURIBasedDispatcher"
+ class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="SOAPActionBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="SOAPMessageBodyBasedDispatcher"
+ class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher">
+ <order phase="Dispatch"/>
+ </handler>
+ <handler name="InstanceDispatcher"
+ class="org.apache.axis2.engine.InstanceDispatcher">
+ <order phase="PostDispatch"/>
+ </handler>
+ </phase>
+ <!--System pre defined phases-->
+ <!--After Postdispatch phase module author or or service author can add any phase he want-->
+ <phase name="userphase1"/>
+ <phase name="soapmonitorPhase"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!--user can add his own phases to this area-->
+ <phase name="userphase1"/>
+ <phase name="soapmonitorPhase"/>
+ <!--system predefined phase-->
+ <!--these phase will run irrespective of the service-->
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <!--user can add his own phases to this area-->
+ <phase name="userphase1"/>
+ <phase name="soapmonitorPhase"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!--user can add his own phases to this area-->
+ <phase name="userphase1"/>
+ <phase name="soapmonitorPhase"/>
+ <phase name="PolicyDetermination"/>
+ <phase name="MessageOut"/>
+ </phaseOrder></pre>
+
+<p>To configure the servlet to communicate with the applet, add the following
+code to the web.xml (The SOAPMonitorPort is configurable.):</p>
+<pre> <servlet>
+ <servlet-name>SOAPMonitorService</servlet-name>
+ <display-name>SOAPMonitorService</display-name>
+ <servlet-class>
+ org.apache.axis2.soapmonitor.servlet.SOAPMonitorService
+ </servlet-class>
+ <init-param>
+ <param-name>SOAPMonitorPort</param-name>
+ <param-value>5001</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>SOAPMonitorService</servlet-name>
+ <url-pattern>/SOAPMonitor</url-pattern>
+ </servlet-mapping></pre>
+
+<p>Finally, compile the applet classes and place them at the root (eg:
+<CATALINA_HOME>/webapps/axis2/) of the extracted WAR file. You can find
+the SOAPMonitorApplet.java in the source distribution. To compile, use the
+following command:</p>
+<pre>javac -classpath axis2-soapmonitor.jar SOAPMonitorApplet.java</pre>
+
+<p>Alternatively, you can directly get the <strong>compiled applet
+classes</strong> from the WEB-INF/lib/soapmonitor-1.3.jar which is inside
+the extracted axis2.war. To extract the soapmonitor-1.3.jar file, simply
+execute the command, <code>jar -xf soapmonitor-1.3.jar</code> and place
+the compiled applet classes in the root directory of the extracted WAR, for
+example, in <CATALINA_HOME>/webapps/axis2/.</p>
+
+<p>Using a Web browser, go to http[s]://host[:port][/webapp]/SOAPMonitor
+(e.g.http://localhost:8080/axis2/SOAPMonitor) substituting the correct values
+for your Web application. This will show the SOAP Monitor applet used to view
+the service requests and responses. Any requests to services that have been
+configured and deployed correctly should show up in the applet.</p>
+
+<p>The SOAPMonitor with attachments currently serializes themselves as base64
+characters. It is therefore recommended to use the TCPMon tool to correctly
+capture MTOM and SWA messages as an multipart mime where the binary data is
+an attachment.</p>
+
+</html>
+ </div>
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ <div id="footer">
+ <div class="xright">©
+ 2004-2007
+
+ Apache Software Foundation
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ </body>
+</html>
Added: webservices/axis2/site/1_3/spring.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/spring.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/spring.html (added)
+++ webservices/axis2/site/1_3/spring.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,777 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title>Apache Axis2 - </title>
+ <style type="text/css" media="all">
+ @import url("../css/maven-base.css");
+ @import url("../css/maven-theme.css");
+ @import url("../css/site.css");
+ </style>
+ <link rel="stylesheet" href="../css/print.css" type="text/css" media="print" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body class="composite">
+ <div id="banner">
+ <a href="../" id="bannerLeft">
+
+ <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+
+ </a>
+ <span id="bannerRight">
+
+ <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+
+ </span>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="breadcrumbs">
+
+
+
+
+
+
+
+ <div class="xleft">
+ Last Published: 08/13/2007
+ </div>
+ <div class="xright"> <a href="../index.html">Axis2/Java</a>
+ |
+ <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+ |
+ <a href="../../../">Apache WS</a>
+ |
+ <a href="http://www.apache.org">Apache</a>
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="leftColumn">
+ <div id="navcolumn">
+
+
+
+
+
+
+
+ <h5>Axis2/Java</h5>
+ <ul>
+
+ <li class="none">
+ <a href="../index.html">Home</a>
+ </li>
+ </ul>
+ <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>
+ <h5>Documentation</h5>
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="expanded">
+ <a href="../1_3/contents.html">Version 1.3</a>
+ <ul>
+
+ <li class="none">
+ <a href="../1_3/toc.html">Table of Contents</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/installationguide.html">Installation Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/quickstartguide.html">QuickStart Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/userguide.html">User Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/pojoguide.html">POJO Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/spring.html">Spring Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/webadminguide.html">Web Administrator's Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_3/migration.html">Migration Guide (from Axis1)</a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="none">
+ <a href="../1_2/contents.html">Version 1.2</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_1_1/contents.html">Version 1.1.1</a>
+ </li>
+
+ <li class="none">
+ <a href="../1_1/contents.html">Version 1.1</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>
+ <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/">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_3/api/index.html">Online Java Docs</a>
+ </li>
+ </ul>
+ <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="../release-process.html">Release Process</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>
+ <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">Source Code</a>
+ </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">License</a>
+ </li>
+ </ul>
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="../images/logos/maven-feather.png"></img>
+ </a>
+
+
+
+
+
+
+
+ </div>
+ </div>
+ <div id="bodyColumn">
+ <div id="contentBox">
+ <html>
+<head>
+ <meta http-equiv="content-type" content=""></meta>
+ Axis2 integration with the Spring Framework
+ <link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+
+<h1>Axis2 Integration with the Spring Framework</h1>
+
+<p>This document is a guide on how to use Axis2 with the Spring Framework</p>
+
+<h2>Content</h2>
+<ul>
+ <li><a href="#1">Introduction</a></li>
+ <li><a href="#2">Configuring Axis2 to be Spring Aware</a>
+ <ul>
+ <li><a href="#21">Programming Model</a></li>
+ <li><a href="#22">Simple Spring Config Example</a></li>
+ <li><a href="#23">With a ServletContext</a></li>
+ <li><a href="#24">Without a ServletContext</a></li>
+ <li><a href="#25">Putting it All Together</a></li>
+ <li><a href="#26">Spring Inside an AAR </a>
+ <ul>
+ <li><a href="#261">The Spring Inside an AAR Layout</a></li>
+ <li><a href="#262">The Spring Inside an AAR init Class</a></li>
+ <li><a href="#263">Known Issues Running Spring Inside the
+ AAR</a></li>
+ </ul>
+ </li>
+ </ul>
+ </li>
+</ul>
+<a name="1"></a>
+
+<h2>Introduction</h2>
+
+Axis2 and Spring integration takes place when Spring supplies one of its
+pre-loaded beans to the Axis2 Message Receiver defined in the AAR
+services.xml. Axis2 typically uses reflection to instantiate the ServiceClass
+defined in the services.xml used by the Message Receiver. Alternatively, you
+can define a ServiceObjectSupplier that will supply the Object.
+
+This guide describes how to use two separate ServiceObjectSupplier classes
+that are a part of the Axis2 standard distribution - one for use with a
+ServletContext, and one without. Configuring Axis2 with a ServletContext is
+simpler than without, and is recommended for most use cases. Without a
+ServletContext, ie, Spring inside the AAR, requires an extra Spring bean
+and is considered an advanced use case. Once configured, the Web service itself
+acts like any other Spring wired bean. These Spring beans can be loaded any way
+desired as Axis2 has no configuration file dependencies from Spring. Spring
+versions 1.2.6, 1.2.8 and 2.0 have been tested, but probably any version
+would work as only the core functionality is required.
+
+This guide assumes some basic knowledge of Axis2. See the <a href="userguide.html">User's Guide</a> for more information.
+<a name="2"></a>
+
+<h3>Programming Model</h3>
+
+From an Axis2 standpoint, two hooks are needed to be placed into the AAR
+services.xml - the ServiceObjectSupplier that hooks Axis2 and Spring
+together, and the name of the Spring bean that Axis2 will use as the service.
+All Message Receivers are currently supported, as would be any Message
+Receiver that extends org.apache.axis2.receivers.AbstractMessageReceiver .
+<a name="22"></a>
+
+<h3>Simple Spring Config Example</h3>
+
+For the purpose of this example, we'll configure Spring via a WAR file's
+web.xml. Let's add a context-param and a listener:
+<pre><listener>
+ <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+</listener>
+<context-param>
+ <param-name>contextConfigLocation</param-name>
+ <param-value>/WEB-INF/applicationContext.xml</param-value>
+</context-param></pre>
+
+Next we will show two examples of Spring's /WEB-INF/applicationContext.xml
+referenced in the web.xml listener - one using a ServletContext, and one
+without.
+<a name="23"></a>
+
+<h3>With a ServletContext</h3>
+
+This example (with a ServletContext) applicationContext.xml should be
+familiar to any Spring user:
+<pre><?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+ <!-- Axis2 Web Service, but to Spring, its just another bean that has dependencies -->
+ <bean id="springAwareService" class="spring.SpringAwareService">
+ <property name="myBean" ref="myBean"/>
+ </bean>
+
+ <!-- just another bean / interface with a wired implementation, that's injected by Spring
+ into the Web Service -->
+ <bean id="myBean" class="spring.MyBeanImpl">
+ <property name="val" value="Spring, emerge thyself" />
+ </bean>
+</beans></pre>
+
+If the service is running in a Servlet Container, i.e., Axis2 will be able
+to get a hold of the ServletContext, the services.xml for the example would
+be using SpringServletContextObjectSupplier such as:
+<pre> <service name="SpringAwareService">
+ <description>
+ simple spring example
+ </description>
+ <parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier</parameter>
+ <parameter name="SpringBeanName">springAwareService</parameter>
+ <operation name="getValue">
+ <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+ </operation>
+</service> </pre>
+
+While the above example uses RawXMLINOutMessageReceiver as its
+messageReceiver class, all Message Receivers are currently supported, as
+would be any Message Receiver that extends
+org.apache.axis2.receivers.AbstractMessageReceiver .
+<a name="24"></a>
+
+<h3>Without a ServletContext</h3>
+
+In case Axis2 can't get a ServletContext, (i.e., uses a different
+transport or is running Axis2 inside the AAR etc,) you have the option of
+defining a bean that takes advantage of Spring's internal abilities
+(ApplicationContextAware interface, specifically) to provide an Application
+Context to Axis2, with a bean ref 'applicationContext' :
+<pre><?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+ <!-- Configure spring to give a hook to axis2 without a ServletContext -->
+ <bean id="applicationContext"
+ class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder" />
+
+ <!-- Axis2 Web Service, but to Spring, its just another bean that has dependencies -->
+ <bean id="springAwareService"
+ class="spring.SpringAwareService">
+ <property name="myBean" ref="myBean" />
+ </bean>
+
+ <!-- just another bean with a wired implementation, that's injected by Spring
+ into the Web Service -->
+ <bean id="myBean"
+ class="spring.MyBeanImpl">
+ <property name="val" value="Spring, emerge thyself" />
+ </bean>
+</beans></pre>
+
+If the service is <strong>not</strong> running in a Servlet Container,
+i.e., Axis2 will not be able to get a hold of ServletContext or you prefer
+not to, the services.xml for the example will be using
+SpringAppContextAwareObjectSupplier such as:
+<pre> <service name="SpringAwareService">
+ <description>
+ simple spring example
+ </description>
+ <parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
+ <parameter name="SpringBeanName">springAwareService</parameter>
+ <operation name="getValue">
+ <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+ </operation>
+</service> </pre>
+
+<p>While the above example uses RawXMLINOutMessageReceiver as its
+messageReceiver class, all Message Receivers are currently supported, as
+would be any Message Receiver that extends
+org.apache.axis2.receivers.AbstractMessageReceiver .</p>
+
+<p>In an environment <strong>without a ServletContext</strong>, one way you
+could load the applicationContext.xml file is in a place that will be run
+once. Upon start-up, execute the following:</p>
+<pre>import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+ public void createSpringAppCtx(ClassLoader cl)
+ throws Exception {
+
+ ClassPathXmlApplicationContext ctx = new
+ ClassPathXmlApplicationContext(new String[] {Constants.MY_PATH +
+ "spring/applicationContext.xml"}, false);
+ ctx.setClassLoader(cl);
+ ctx.refresh();</pre>
+} <a name="25"></a>
+
+<h3>Putting It All Together</h3>
+
+<p>From here, it's just standard Axis2 coding. Only now the service has
+Spring wiring capabilities. The implementation is the same whether using
+either SpringServletContextObjectSupplier or
+SpringAppContextAwareObjectSupplier. The service is as follows:</p>
+<pre>package spring;
+
+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.axiom.om.OMText;
+
+public class SpringAwareService {
+
+ private MyBean myBean = null;
+
+ //spring 'injects' this implementation
+ public void setMyBean(MyBean myBean) {
+ this.myBean = myBean;
+ }
+
+ // The web service
+ public OMElement getValue(OMElement ignore) {
+ OMFactory factory=
+ OMAbstractFactory.getOMFactory();
+ OMNamespace payloadNs= factory.createOMNamespace(
+ "http://springExample.org/example1", "example1");
+ OMElement payload =
+ factory.createOMElement("string", payloadNs);
+ OMText response = factory.createOMText(this.myBean.emerge());
+ payload.addChild(response);
+ return payload;
+ }
+} </pre>
+
+<p>For those who are new to Spring, one of the ideas is that you program an
+Interface, as the implementation is pluggable. This idea is referenced in the
+Spring config file above. Below is the interface:</p>
+<pre>package spring;
+
+/** Interface for Spring aware Bean */
+public interface MyBean {
+ String emerge();
+}</pre>
+
+<p>Here's the implementation:</p>
+<pre>/** Spring wired implementation */
+public class MyBeanImpl implements MyBean {
+
+ String str = null;
+ // spring 'injects' this value
+ public void setVal(String s) {
+ str = s;
+ }
+ // web service gets this value
+ public String emerge() {
+ return str;
+ }
+}</pre>
+
+<p>Lastly here's the client - not really necessary for the example, other
+than for completeness:</p>
+<pre>package client;
+
+import java.io.StringWriter;
+
+import javax.xml.stream.XMLOutputFactory;
+
+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.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+
+public class TestClient {
+ private static EndpointReference targetEPR =
+ new EndpointReference(
+ "http://localhost:8080/axis2/services/SpringAwareService");
+
+ /**
+ * Simple axis2 client.
+ *
+ * @param args Main
+ */
+ public static void main(String[] args) {
+ try {
+ OMFactory factory = OMAbstractFactory.getOMFactory();
+ OMNamespace omNs = factory.createOMNamespace(
+ "http://springExample.org/example1", "example1");
+
+ OMElement method = factory.createOMElement("getValue", omNs);
+ OMElement value = factory.createOMElement("Text", omNs);
+ value.addChild(factory.createOMText(value, "Some String "));
+ method.addChild(value);
+
+ ServiceClient serviceClient = new ServiceClient();
+
+ Options options = new Options();
+ serviceClient.setOptions(options);
+ options.setTo(targetEPR);
+
+ //Blocking invocation
+ OMElement result = serviceClient.sendReceive(method);
+
+ StringWriter writer = new StringWriter();
+ result.serialize(XMLOutputFactory.newInstance()
+ .createXMLStreamWriter(writer));
+ writer.flush();
+
+ System.out.println("Response: " + writer.toString());
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+} </pre>
+
+<p>The examples above assume that both the spring framework .jar and the
+axis2-spring-*.jar are under WEB-INF/lib. In such a case, the classes shown
+in this tutorial need to be placed in a JAR under WEB-INF/lib. In this
+example the JAR layout is:</p>
+<div class="source"><pre><pre>./mySpring.jar
+./META-INF
+./META-INF/MANIFEST.MF
+./spring
+./spring/MyBean.class
+./spring/MyBeanImpl.class
+./spring/SpringAwareService.class</pre>
+</pre></div>
+<p>Since all the user classes are in mySpring.jar in this example, the AAR
+merely contains the services.xml file:</p>
+<div class="source"><pre><pre>./springExample.aar
+./META-INF
+./META-INF/MANIFEST.MF
+./META-INF/services.xml</pre>
+</pre></div>
+<p>To run this example, make sure you have the axis2-spring*.jar that comes
+from the axis2-std-*-bin distro in the server side WEB-INF/lib, as well as
+the appropriate Spring jar - most will use the full spring.jar, but the
+minimum requirements are spring-core, spring-beans, spring-context, and
+spring-web. When running the client, you should see this output:</p>
+<pre>Response: <example1:string xmlns:example1="http://springExample.org/example1"
+ xmlns:tns="http://ws.apache.org/axis2">Spring, emerge thyself</example1:string></pre>
+<a name="26"></a>
+
+<h3>Spring Inside an AAR</h3>
+
+<p>Axis2 users frequently want to run Spring inside the AAR. Here we show you
+how it is done. There are four points to be aware of:</p>
+
+<p>(A) You need to configure Spring to use the Axis2 Service Classloader. See
+the <a href="#263">Known issues running Spring inside the AAR</a> area.</p>
+
+<p>(B) It's up to you to load Spring, though we give an example below.</p>
+
+<p>(C) For reasons such as classloader isolation, the
+SpringAppContextAwareObjectSupplier is the best choice.</p>
+
+<p>(D) The springframework .jar and axis2-spring-*.jar will be placed inside
+the AAR under the lib directory. Please <strong>move</strong> the
+axis2-spring-*.jar from WEB-INF/lib to inside the AAR, as shown below - it
+will <strong>not</strong> work otherwise.</p>
+<ul>
+ <li><strong><a name="261"></a>The Spring inside an AAR layout</strong></li>
+</ul>
+<div class="source"><pre><pre>./springExample.aar
+./META-INF
+./META-INF/MANIFEST.MF
+./META-INF/services.xml
+./applicationContext.xml
+./lib
+./lib/axis2-spring-1.3.jar
+./lib/spring.jar
+./spring
+./spring/MyBean.class
+./spring/MyBeanImpl.class
+./spring/SpringAwareService.class
+./spring/SpringInit.class </pre>
+</pre></div>
+As explained in the <a href="#24">Without a ServletContext</a> section,
+the 'Spring inside an AAR' config needs to hook Axis2 and Spring together via
+a Spring bean. Place the following in your Spring config file:
+<pre> <!-- Configure spring to give a hook to axis2 without a ServletContext -->
+ <bean id="applicationContext"
+ class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder" /></pre>
+<ul>
+ <li><strong><a name="262"></a>The Spring inside an AAR init
+ class</strong></li>
+</ul>
+
+One way to initialize Spring inside the AAR is to use the
+org.apache.axis2.engine.ServiceLifeCycle interface. Here we give an
+example:
+<div class="source"><pre><pre>package spring;
+
+import org.apache.axis2.engine.ServiceLifeCycle;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.AxisService;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+public class SpringInit implements ServiceLifeCycle {
+
+ /**
+ * This will be called during the deployement time of the service.
+ * irrespective
+ * of the service scope this method will be called
+ */
+ public void startUp(ConfigurationContext ignore, AxisService service) {
+
+ try {
+ System.out.println("Starting spring init");
+ ClassLoader classLoader = service.getClassLoader();
+ ClassPathXmlApplicationContext appCtx = new
+ ClassPathXmlApplicationContext(new String[] {"applicationContext.xml"}, false);
+ appCtx.setClassLoader(classLoader);
+ appCtx.refresh();
+ System.out.println("spring loaded");
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
+ }
+
+ /**
+ * This will be called during the system shut down time.
+ * irrespective
+ * of the service scope this method will be called
+ */
+ public void shutDown(ConfigurationContext ctxIgnore, AxisService ignore) {
+ }
+}</pre>
+</pre></div>
+<p>Here's the services.xml that now includes SpringInit and the
+SpringAwareService shown above. There is also the composite parameter which
+is needed when loading Spring in the AAR - see the <a href="#263">Known
+issues running Spring inside the AAR</a> area.</p>
+<div class="source"><pre><pre><serviceGroup>
+ <!-- Invoke SpringInit on server startup and shutdown -->
+ <service name="SpringAwareService" class="spring.SpringInit">
+ <description>
+ simple spring example - inside the AAR
+ </description>
+ <!-- need the TCCL param when using spring inside the AAR -->
+ <parameter name="ServiceTCCL">composite</parameter>
+ <parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
+ <parameter name="SpringBeanName">springAwareService</parameter>
+ <operation name="getValue">
+ <messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+ </operation>
+ </service>
+</serviceGroup></pre>
+</pre></div><ul>
+ <li><strong><a name="263"></a>Known issues running Spring inside the
+ AAR</strong></li>
+</ul>
+
+By default, the Axis2 classloader strategy does not permit Spring to run
+inside the AAR. To allow Spring to run inside the AAR, the 'composite'
+parameter is used in the services.xml as shown in the example above. There
+was default behavior of 'composite' in the development cycle in between 1.0
+and 1.1, but it resulted in the JIRA issue AXIS2-1214 -problems with getting
+an initContext.lookup() handle inside the AAR. Spring users typically have
+little desire to use initContext.lookup(), as they get their Datasources via
+org.springframework.jdbc.datasource.DriverManagerDataSource in an XML file or
+with annotations. For EJB home references and the like, Spring provides
+JndiObjectFactoryBean.
+
+<p>A common requirement is to run Hibernate along with Spring with Axis2 web services.
+It is easier to run Hibernate as well as Spring outside the AAR as shown in the
+ServletContext example, ie, place the Spring and Hibernate jars in WEB-INF/lib and
+the hibernate config files under WEB-INF/classes. With that advisement, Spring provides
+an API that allows Spring to load Hibernate under the contraints of an AAR. </p>
+
+<p>Hibernate by default looks for its config files in the classpath. By running Hibernate
+inside the AAR, Hibernate won't be able to find its config files. The way to get
+around this limitation is either to expand the AAR or place the hibernate config
+files in a specific directory under WEB-INF/classes - and then use
+<a href="http://www.springframework.org/docs/api/org/springframework/orm/hibernate/LocalSessionFactoryBean.html#setMappingDirectoryLocations(org.springframework.core.io.Resource[])">Spring's setMappingDirectoryLocations</a> for several options. </p>
+
+<p>By placing Spring into DEBUG mode you can look at the logs to see where Spring will look
+for your jar / class locations. Use the wildcards in the following example to list your mapping
+locations as shown: </p>
+
+<div class="source"><pre><pre><bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
+ <property name="mappingLocations">
+ <value>classpath*:**/MyEntity.hbm.xml</value>
+ </property>
+ ...
+</bean> </pre>
+</pre></div>
+</html>
+ </div>
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ <div id="footer">
+ <div class="xright">©
+ 2004-2007
+
+ Apache Software Foundation
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ </body>
+</html>
Added: webservices/axis2/site/1_3/src/Axis2SampleDocLitServiceCode.html
URL: http://svn.apache.org/viewvc/webservices/axis2/site/1_3/src/Axis2SampleDocLitServiceCode.html?view=auto&rev=565295
==============================================================================
--- webservices/axis2/site/1_3/src/Axis2SampleDocLitServiceCode.html (added)
+++ webservices/axis2/site/1_3/src/Axis2SampleDocLitServiceCode.html Mon Aug 13 03:13:18 2007
@@ -0,0 +1,467 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+
+
+
+
+
+
+
+
+<html>
+ <head>
+ <title>Apache Axis2 - </title>
+ <style type="text/css" media="all">
+ @import url("../../css/maven-base.css");
+ @import url("../../css/maven-theme.css");
+ @import url("../../css/site.css");
+ </style>
+ <link rel="stylesheet" href="../../css/print.css" type="text/css" media="print" />
+ <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+ </head>
+ <body class="composite">
+ <div id="banner">
+ <a href="../" id="bannerLeft">
+
+ <img src="http://www.apache.org/images/asf_logo_wide.png" alt="" />
+
+ </a>
+ <span id="bannerRight">
+
+ <img src="http://ws.apache.org/axis2/images/axis.jpg" alt="" />
+
+ </span>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="breadcrumbs">
+
+
+
+
+
+
+
+ <div class="xleft">
+ Last Published: 08/13/2007
+ </div>
+ <div class="xright"> <a href="../../index.html">Axis2/Java</a>
+ |
+ <a href="http://ws.apache.org/axis2/c">Axis2/C</a>
+ |
+ <a href="../../../../">Apache WS</a>
+ |
+ <a href="http://www.apache.org">Apache</a>
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ </div>
+ <div id="leftColumn">
+ <div id="navcolumn">
+
+
+
+
+
+
+
+ <h5>Axis2/Java</h5>
+ <ul>
+
+ <li class="none">
+ <a href="../../index.html">Home</a>
+ </li>
+ </ul>
+ <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>
+ <h5>Documentation</h5>
+ <ul>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <li class="expanded">
+ <a href="../../1_3/contents.html">Version 1.3</a>
+ <ul>
+
+ <li class="none">
+ <a href="../../1_3/toc.html">Table of Contents</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_3/installationguide.html">Installation Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_3/quickstartguide.html">QuickStart Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_3/userguide.html">User Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_3/pojoguide.html">POJO Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_3/spring.html">Spring Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_3/webadminguide.html">Web Administrator's Guide</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_3/migration.html">Migration Guide (from Axis1)</a>
+ </li>
+ </ul>
+ </li>
+
+ <li class="none">
+ <a href="../../1_2/contents.html">Version 1.2</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_1_1/contents.html">Version 1.1.1</a>
+ </li>
+
+ <li class="none">
+ <a href="../../1_1/contents.html">Version 1.1</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>
+ <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/">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_3/api/index.html">Online Java Docs</a>
+ </li>
+ </ul>
+ <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="../../release-process.html">Release Process</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>
+ <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">Source Code</a>
+ </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">License</a>
+ </li>
+ </ul>
+ <a href="http://maven.apache.org/" title="Built by Maven" id="poweredBy">
+ <img alt="Built by Maven" src="../../images/logos/maven-feather.png"></img>
+ </a>
+
+
+
+
+
+
+
+ </div>
+ </div>
+ <div id="bodyColumn">
+ <div id="contentBox">
+ <html>
+<head>
+ <meta http-equiv="content-type" content=""></meta>
+
+ <link href="../../css/axis-docs.css" rel="stylesheet" type="text/css" media="all"></link>
+</head>
+
+
+<h1>Code Listing For Axis2SampleDocLitService Service</h1>
+
+<h2>Server:</h2>
+
+<h3>echoString</h3>
+
+<p>Locate the following code segment in "Axis2SampleDocLitServiceSkeleton.java".<br></br>
+</p>
+<div class="source"><pre><pre>public org.apache.axis2.userguide.xsd.EchoStringReturnDocument
+ echoString(org.apache.axis2.userguide.xsd.EchoStringParamDocument param4 ){
+ //Todo: fill this with the necessary business logic
+ throw new java.lang.UnsupportedOperationException();
+ }
+</pre></pre></div>
+
+<p>Then complete the code by adding the business logic as shown below:</p>
+<div class="source"><pre>
+<pre>public org.apache.axis2.userguide.xsd.EchoStringReturnDocument
+ echoString(org.apache.axis2.userguide.xsd.EchoStringParamDocument param4) throws Exception {
+ //Use the factory to create the output document
+ org.apache.axis2.userguide.xsd.EchoStringReturnDocument retDoc =
+ org.apache.axis2.userguide.xsd.EchoStringReturnDocument.Factory.newInstance();
+ //send the string back.
+ retDoc.setEchoStringReturn(param4.getEchoStringParam());
+ return retDoc;
+ }</pre>
+</pre></div>
+
+<h3>echoStringArray</h3>
+
+<p>The code segment for echoStringArray is shown below:</p>
+<div class="source"><pre>
+<pre>public org.apache.axis2.userguide.xsd.EchoStringArrayReturnDocument
+ echoStringArray(org.apache.axis2.userguide.xsd.EchoStringArrayParamDocument param0) throws Exception {
+ //Use the factory to create the output document.
+ org.apache.axis2.userguide.xsd.EchoStringArrayReturnDocument retDoc =
+ org.apache.axis2.userguide.xsd.EchoStringArrayReturnDocument.Factory.newInstance();
+ //Get the String array from the input parameters.
+ String[] inParams = param0.getEchoStringArrayParam().getStringArray();
+ org.apache.axis2.userguide.xsd.ArrayOfstringLiteral retParams =
+ org.apache.axis2.userguide.xsd.ArrayOfstringLiteral.Factory.newInstance();
+ //Set the input parameters to the output parameters for echoing.
+ for (int i = 0; i < inParams.length; i++) {
+ retParams.addString(inParams[i]);<br></br> }
+ //return the output document.
+ retDoc.setEchoStringArrayReturn(retParams);
+ return retDoc;
+ }</pre>
+</pre></div>
+
+<h3>echoStruct</h3>
+
+<p>The code segment for echoStruct is shown below:</p>
+<div class="source"><pre><pre>
+ public org.apache.axis2.userguide.xsd.EchoStructReturnDocument
+ echoStruct(org.apache.axis2.userguide.xsd.EchoStructParamDocument param2) throws Exception {
+ //Use the factory to create the output document.
+ org.apache.axis2.userguide.xsd.EchoStructReturnDocument retDoc =
+ org.apache.axis2.userguide.xsd.EchoStructReturnDocument.Factory.newInstance();
+ //Get the SOAPStrcut from the incoming parameters
+ org.apache.axis2.userguide.xsd.SOAPStruct inStruct = param2.getEchoStructParam();
+ //Struct for the sending back
+ org.apache.axis2.userguide.xsd.SOAPStruct outStruct =
+ org.apache.axis2.userguide.xsd.SOAPStruct.Factory.newInstance();
+ //Fill the outgoing struct
+ outStruct.setVarFloat(inStruct.getVarFloat());
+ outStruct.setVarInt(inStruct.getVarInt());
+ outStruct.setVarString(inStruct.getVarString());
+ //Set the outgoing document.
+ retDoc.setEchoStructReturn(outStruct);
+ return retDoc;
+ }
+</pre></pre></div>
+
+<h2>Client:</h2>
+
+<h3>Client for echoString Operation</h3>
+
+<p>The following code fragment shows the necessary code for utilizing the
+echoString operation of the Axis2SampleDocLitService that we have already
+deployed. The code is very simple to understand and the explanations are in
+the form of comments.</p>
+<div class="source"><pre><pre> try {
+ org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub
+ = new org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
+ "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
+ //Create the request document to be sent.
+ org.apache.axis2.userguide.xsd.EchoStringParamDocument reqDoc =
+ org.apache.axis2.userguide.xsd.EchoStringParamDocument.Factory.newInstance();
+ reqDoc.setEchoStringParam("Axis2 Echo");
+ //invokes the Web service.
+ org.apache.axis2.userguide.xsd.EchoStringReturnDocument resDoc =
+ stub.echoString(reqDoc);
+ System.out.println(resDoc.getEchoStringReturn());
+ } catch (java.rmi.RemoteException e) {
+ e.printStackTrace();
+ }
+</pre></pre></div>
+
+<p>Similarly the following code fragments show client side code for
+echoStringArray operation and echoStruct operation respectively.</p>
+
+<h3>Client for echoStringArray Operation</h3>
+<div class="source"><pre><pre> try {
+ //Create the stub by passing the AXIS_HOME and target EPR.
+ //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOME
+ org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub =
+ new org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
+ "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
+ //Create the request document to be sent.
+ org.apache.axis2.userguide.xsd.EchoStringArrayParamDocument reqDoc =
+ org.apache.axis2.userguide.xsd.EchoStringArrayParamDocument.Factory.newInstance();
+ org.apache.axis2.userguide.xsd.ArrayOfstringLiteral paramArray =
+ org.apache.axis2.userguide.xsd.ArrayOfstringLiteral.Factory.newInstance();
+ paramArray.addString("Axis2");
+ paramArray.addString("Echo");
+ reqDoc.setEchoStringArrayParam(paramArray);
+ org.apache.axis2.userguide.xsd.EchoStringArrayReturnDocument resDoc =
+ stub.echoStringArray(reqDoc);
+ //Get the response params
+ String[] resParams = resDoc.getEchoStringArrayReturn().getStringArray();
+ for (int i = 0; i < resParams.length; i++) {
+ System.out.println(resParams[i]);
+ }
+ } catch (java.rmi.RemoteException e) {
+ e.printStackTrace();
+ }
+ </pre>
+ </pre></div>
+
+<h3>Client for echoStruct Operation</h3>
+<div class="source"><pre><pre>try {
+ //Create the stub by passing the AXIS_HOME and target EPR.
+ //We pass null to the AXIS_HOME and hence the stub will use the current directory as the AXIS_HOME
+ org.apache.axis2.userguide.Axis2SampleDocLitServiceStub stub =
+ new org.apache.axis2.userguide.Axis2SampleDocLitServiceStub(null,
+ "http://localhost:8080/axis2/services/Axis2SampleDocLitService");
+ //Create the request Document
+ org.apache.axis2.userguide.xsd.EchoStructParamDocument reqDoc =
+ org.apache.axis2.userguide.xsd.EchoStructParamDocument.Factory.newInstance();
+ //Create the complex type
+ org.apache.axis2.userguide.xsd.SOAPStruct reqStruct =
+ org.apache.axis2.userguide.xsd.SOAPStruct.Factory.newInstance();
+ reqStruct.setVarFloat(100.50F);
+ reqStruct.setVarInt(10);
+ reqStruct.setVarString("High");
+ reqDoc.setEchoStructParam(reqStruct);
+ //Service invocation
+ org.apache.axis2.userguide.xsd.EchoStructReturnDocument resDoc =
+ stub.echoStruct(reqDoc);
+ org.apache.axis2.userguide.xsd.SOAPStruct resStruct =
+ resDoc.getEchoStructReturn();
+ System.out.println("floot Value :" + resStruct.getVarFloat());
+ System.out.println("int Value :" + resStruct.getVarInt());
+ System.out.println("String Value :" + resStruct.getVarString());
+ } catch (java.rmi.RemoteException e) {
+ e.printStackTrace();
+ }
+</pre></pre></div>
+
+
+</html>
+ </div>
+ </div>
+ <div class="clear">
+ <hr/>
+ </div>
+ <div id="footer">
+ <div class="xright">©
+ 2004-2007
+
+ Apache Software Foundation
+
+
+
+
+
+
+
+ </div>
+ <div class="clear">
+ <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