You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ch...@apache.org on 2006/12/20 10:04:28 UTC

svn commit: r488985 [3/5] - in /webservices/axis2/branches/java/1_1/xdocs/1_1: ./ images/

Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/modules.html
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/xdocs/1_1/modules.html?view=diff&rev=488985&r1=488984&r2=488985
==============================================================================
--- webservices/axis2/branches/java/1_1/xdocs/1_1/modules.html (original)
+++ webservices/axis2/branches/java/1_1/xdocs/1_1/modules.html Wed Dec 20 01:04:27 2006
@@ -1,354 +1,354 @@
-<html>
-<head>
-  <meta http-equiv="content-type" content="">
-  <title>Writing your Own Axis2 Module</title>
-  <link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all" />
-</head>
-
-<body dir="ltr" lang="en-US">
-
-<a name="Modules"></a>
-<h1></a>Writing your Own Axis2 Module</h1>
-
-<p>Axis2 provides extended support for modules (See <a
-href="Axis2ArchitectureGuide.html" target="_blank">Architecture Guide</a> for
-more details about modules in Axis2). Let's create a custom module and deploy
-it to MyService which we created earlier.</p>
-
-<p><i>Send your feedback or questions to: <a
-href="mailto:axis-dev@ws.apache.org">axis-dev@ws.apache.org</a></i>. Prefix
-subject with [Axis2]. To subscribe to mailing list see <a
-href="http://ws.apache.org/axis2/mail-lists.html">here.</a></p>
-
-<h2>Content List</h2>
-<ul>
-  <li><a href="#MyService_with_a_Logging_Module">MyService with a Logging Module</a></li>
-  <ul>
-      <li><a href="#Step1_:_LoggingModule_Class">Step1 : LoggingModule Class</a></li>
-      <li><a href="#Step2_:_LogHandler">Step2 : LogHandler</a></li>
-      <li><a href="#Step3_:_module_xml">Step3 : module.xml</a></li>
-      <li><a href="#Step_4:_Modify_the_&#34;axis2_xml&#34;">Step 4: Modify the "axis2.xml"</a></li>
-      <li><a href="#Step5_:_Modify_the_&#34;services_xml&#34;">Step5 : Modify the "services.xml</a></li>
-      <li><a href="#Step6_:_Packaging">Step6 : Packaging</a></li>
-      <li><a href="#Step7_:_Deploy_the_Module_in_Axis2">Step7 : Deploy the Module in Axis2</a></li>
-  </ul>
-</ul>
-
-
-<p>Following steps show the actions that need to be performed to deploy a
-custom module for a given Web service:</p>
-<ol>
-  <li><p style="margin-bottom: 0in">Create the Module Implementation</p>
-  </li>
-  <li><p style="margin-bottom: 0in">Create the Handlers</p>
-  </li>
-  <li><p style="margin-bottom: 0in">Create the module.xml</p>
-  </li>
-  <li><p style="margin-bottom: 0in">Modify the "axis2.xml" (if you need
-    custom phases)</p>
-  </li>
-  <li><p style="margin-bottom: 0in">Modify the "services.xml" to engage
-    modules at the deployment time.</p>
-  </li>
-  <li><p style="margin-bottom: 0in">Package in a ".mar" (Module Archive)</p>
-  </li>
-  <li><p>Deploy the module in Axis2</p>
-  </li>
-</ol>
-
-<a name="MyService_with_a_Logging_Module"></a>
-<h3>MyService with a Logging Module</h3>
-
-<p>Let's write a simple logging module for our sample located at
-<b>"samples\userguide\src"</b> directory of the binary distribution. This
-module contains one handler that just logs the message that is passed through
-it. Axis2 uses ".mar" (Module Archive) to deploy modules in Axis2. Following
-diagram shows the file structure inside which needs to be there in the ".mar"
-archive. Let's create all these and see how it works.</p>
-
-<p><img src="images/userguide/ModuleView.jpg" name="Graphic5" align="bottom"
-border="0"></p>
-
-<a name="Step1_:_LoggingModule_Class"></a>
-<h4>Step1 : LoggingModule Class</h4>
-
-<p>LoggingModule is the implementation class of the Axis2 module. Axis2
-modules should implement the "<a
-href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/modules/Module.java?rev=396785&amp;view=log">org.apache.axis2.modules.Module</a>"
-interface with the following methods.</p>
-<pre>public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault;//Initialize the module
-public void shutdown(ConfigurationContext configurationContext) throws AxisFault;//End of module processing
-public void engageNotify(AxisDescription axisDescription) throws AxisFault;
-public String[] getPolicyNamespaces() throws AxisFault;
-public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault ;
-public boolean canSupportAssertion(Assertion assertion) ;
-</pre>
-
-<p>Firt three methods can be used to control the module initialization and the
-termination , and the next three methods are used to perform policy related stuff
-With the input parameter AxisConfiguration, the user is provided
-with the complete configuration hierarchy. This can be used to fine-tune the
-module behavior by the module writers. For the simple logging service we can
-keep these methods blank in our implementation class.</p>
-
-<a name="Step2_:_LogHandler"></a>
-<h4>Step2 : LogHandler</h4>
-
-<p>A module in Axis2 can contain, one or more handlers that perform various
-SOAP header processing at different phases. (See<a
-href="Axis2ArchitectureGuide.html#incomingsoap" target="_blank"> Architecture
-Guide</a> for more information on phases). To write a handler one should
-implement <a
-href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Handler.java?rev=357187&amp;view=log">org.apache.axis2.engine.Handler</a>.
-But for convenience, <a
-href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/handlers/AbstractHandler.java?rev=396788&amp;view=log">org.apache.axis2.handlers.AbstractHandler</a>
-provides an abstract implementation of the Handler interface.</p>
-
-<p>For the logging module we will write a handler with the following methods.
-"public void invoke(MessageContext ctx);" is the method that is called by
-Axis2 engine when the control is passed to the handler. "public void
-revoke(MessageContext ctx);" is called when the handlers are revoked by the
-Axis2 engine.</p>
-<pre>public class LogHandler extends AbstractHandler implements Handler {
-    private static final Log log = LogFactory.getLog(LogHandler.class);
-    private String name;
-
-    public String getName() {
-        return name;
-    }
-
-    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
-        log.info(msgContext.getEnvelope().toString());
-        return InvocationResponse.CONTINUE;        
-    }
-
-    public void revoke(MessageContext msgContext) {
-        log.info(msgContext.getEnvelope().toString());
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-}</pre>
-
-<a name="Step3_:_module_xml"></a>
-<h4>Step3 : module.xml</h4>
-
-<p>"module.xml" contains the deployment configurations for a particular
-module. It contains details such as Implementation class of the module (in
-this example it is the "LoggingModule" class and various handlers that will
-run in different phases). "module.xml" for the logging module will be as
-follows:</p>
-<pre>&lt;module name="logging" class="userguide.loggingmodule.LoggingModule "&gt;
-   &lt;inflow&gt;
-        &lt;handler name="InFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
-        &lt;order phase="loggingPhase" /&gt;
-        &lt;/handler&gt;
-   &lt;/inflow&gt;
-
-   &lt;outflow&gt;
-        &lt;handler name="OutFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
-        &lt;order phase="loggingPhase"/&gt;
-        &lt;/handler&gt;
-   &lt;/outflow&gt;
-
-   &lt;Outfaultflow&gt;
-        &lt;handler name="FaultOutFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
-        &lt;order phase="loggingPhase"/&gt;
-        &lt;/handler&gt;
-   &lt;/Outfaultflow&gt;
-
-   &lt;INfaultflow&gt;
-        &lt;handler name="FaultInFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
-        &lt;order phase="loggingPhase"/&gt;
-        &lt;/handler&gt;
-   &lt;/INfaultflow&gt;
-&lt;/module&gt;</pre>
-
-<p>As you can see there are four flows defined in this "module.xml"</p>
-<ol>
-  <li>inflow - Represents the handler chain that will run when a message is
-    coming in. </li>
-  <li><p style="margin-bottom: 0in">outflow - Represents the handler chain
-    that will run when the message is going out. </p>
-  </li>
-  <li><p style="margin-bottom: 0in">Outfaultflow - Represents the handler
-    chain that will run when there is a fault and the fault is going out</p>
-  </li>
-  <li><p>INfaultflow - Represents the handler chain that will run when there
-    is a fault and the fault is coming in </p>
-  </li>
-</ol>
-
-<p>Following set of tags describe the name of the handler, handler class and
-the phase in which this handler is going to run. "InFlowLogHandler" is the
-name given for the particular instance of this handler class. The value of
-class attribute is the actual implementation class for this handler. Since we
-are writing logging handler, we can reuse the same handler in all these
-phases. However this may not be the same for all the modules. "&lt;order
-phase="loggingPhase" /&gt;" describes the phase in which this handler
-runs.</p>
-<pre>&lt;handler name="InFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
-&lt;order phase="loggingPhase" /&gt;
-&lt;/handler&gt;</pre>
-
-<p>To learn more about Phase rules, check out the article <a
-href="http://www.developer.com/java/web/article.php/3529321"
-target="_blank">Axis2 Execution Framework</a></p>
-
-<a name="Step_4:_Modify_the_&#34;axis2_xml&#34;"></a>
-<h4>Step 4: Modify the "axis2.xml"</h4>
-
-<p>In this handler, the phase "loggingPhase", is defined by the module
-writer. It is not a pre-defined handler phase, hence the module writer should
-introduce it to the "axis2.xml" (NOT the services.xml) so that the Axis2
-engine knows where to place the handler in different "flows" ( inFlow,
-outFlow, etc.). Following xml lines show the respective changes made to the
-"axis2.xml" in order to deploy this logging module in the Axis2 engine. This
-is an extract of the phase section of "axis2.xml".</p>
-<pre>&lt;!-- ================================================= --&gt;
-&lt;!-- Phases --&gt;
-&lt;!-- ================================================= --&gt;
-
-&lt;phaseOrder type="inflow"&gt;
-        &lt;!--  System pre defined phases       --&gt;
-        &lt;phase name="TransportIn"/&gt;
-        &lt;phase name="PreDispatch"/&gt;
-        &lt;phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"&gt;
-            &lt;handler name="AddressingBasedDispatcher"
-                     class="org.apache.axis2.engine.AddressingBasedDispatcher"&gt;
-                &lt;order phase="Dispatch"/&gt;
-            &lt;/handler&gt;
-
-            &lt;handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"&gt;
-                &lt;order phase="Dispatch"/&gt;
-            &lt;/handler&gt;
-
-            &lt;handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"&gt;
-                &lt;order phase="Dispatch"/&gt;
-            &lt;/handler&gt;
-
-            &lt;handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"&gt;
-                &lt;order phase="Dispatch"/&gt;
-            &lt;/handler&gt;
-            &lt;handler name="InstanceDispatcher"
-                     class="org.apache.axis2.engine.InstanceDispatcher"&gt;
-                &lt;order phase="PostDispatch"/&gt;
-            &lt;/handler&gt;
-        &lt;/phase&gt;
-        &lt;!--  System pre defined phases       --&gt;
-        &lt;!--   After Postdispatch phase module author or service author can add any phase he wants      --&gt;
-        &lt;phase name="OperationInPhase"/&gt;
-        &lt;phase name="<span style="color: rgb(36, 193, 19);">loggingPhase</span>"/&gt;
-    &lt;/phaseOrder&gt;
-    &lt;phaseOrder type="outflow"&gt;
-        &lt;!--      user can add his own phases to this area  --&gt;
-        &lt;phase name="OperationOutPhase"/&gt;
-        &lt;phase name="<span style="color: rgb(36, 193, 19);">loggingPhase</span>"/&gt;
-        &lt;!--system predefined phases--&gt;
-        &lt;!--these phases will run irrespective of the service--&gt;
-        &lt;phase name="PolicyDetermination"/&gt;
-        &lt;phase name="MessageOut"/&gt;
-    &lt;/phaseOrder/&gt;
-    &lt;phaseOrder type="INfaultflow"&gt;
-        &lt;!--      user can add his own phases to this area  --&gt;
-        &lt;phase name="OperationInFaultPhase"/&gt;
-        &lt;phase name="<span style="color: rgb(36, 193, 19);">loggingPhase</span>"/&gt;
-    &lt;/phaseOrder&gt;
-    &lt;phaseOrder type="Outfaultflow"&gt;
-        &lt;!--      user can add his own phases to this area  --&gt;
-        &lt;phase name="OperationOutFaultPhase"/&gt;
-        &lt;phase name="<span style="color: rgb(36, 193, 19);">loggingPhase</span>"/&gt;
-        &lt;phase name="PolicyDetermination"/&gt;
-        &lt;phase name="MessageOut"/&gt;
-    &lt;/phaseOrder&gt;
-    </pre>
-
-<p>The text in green, the custom phase "loggingPhase" is placed in all the
-flows, hence that phase will be called in all the message flows in the
-engine. Since our module is associated with this phase, the LogHandler inside
-the module will now be executed in this phase.</p>
-
-<a name="Step5_:_Modify_the_&#34;services_xml&#34;"></a>
-<h4>Step5 : Modify the "services.xml"</h4>
-
-<p>Up to this point we have created the required classes and configuration
-descriptions for the logging module and by changing the "axis2.xml" we have
-created the required phases for the logging module.</p>
-
-<p>Next step is to "<b>engage</b>" (use) this module in one of our services.
-For this, let's use the same Web service that we have used throughout the
-user's guide- MyService. However, since we need to modify the "services.xml"
-of MyService in order to engage this module, we use a separate Web service,
-but with the similar operations.</p>
-
-<p>The code for this service can be found in the
-"<strong>Axis2_HOME/samples/userguide/src/userguide/example2</strong>"
-directory. The simple changes that we have done to "services.xml' are shown
-in green in the following lines of xml.</p>
-<pre>&lt;service name="<span style="color: rgb(36, 193, 19);">MyServiceWithModule</span>"&gt;
-    &lt;description&gt;
-    This is a sample Web service with a logging module engaged.
-    &lt;/description&gt;
-    <span style="color: rgb(36, 193, 19);">&lt;module ref="logging"/&gt;</span>
-    &lt;parameter name="ServiceClass" locked="xsd:false"&gt;userguide.example2.MyService&lt;/parameter&gt;
-    &lt;operation name="echo"&gt;
-    &lt;messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/&gt;
-    &lt;/operation&gt;
-    &lt;operation name="ping"&gt;
-    &lt;messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/&gt;
-    &lt;/operation&gt;
-&lt;/service&gt;</pre>
-
-<p>In this example we have changed the service name (the implementation class
-is very similar to what we have used earlier although it is in a different
-package). In addition we have added the line <b>"&lt;module
-ref="logging"/&gt;"</b> to "services.xml". This informs the Axis2 engine that
-the module "logging" should be engaged for this service. The handler inside
-the module will be executed in their respective phases as described by the
-"module.xml".</p>
-
-<a name="Step6_:_Packaging"></a>
-<p><b>Step6 : Packaging</b></p>
-
-<p>Before deploying the module we need to create the ".mar" file for this
-module. This can be done, using the "jar" command and then renaming the
-created jar file. Or you can find the "logging.mar" that is already created
-for you in the "<strong>Axis2_HOME/samples/userguide</strong>" directory.</p>
-
-<a name="Step7_:_Deploy_the_Module_in_Axis2"></a>
-<h4>Step7 : Deploy the Module in Axis2</h4>
-
-<p>Deploying a module in Axis2 require the user to create a directory with
-the name "modules" in the "webapps/axis2/WEB-INF" directory of their servlet
-container and then copying the ".mar" file to that directory. So let's first
-create the "modules" directory and drop the "logging.mar" in to this
-directory.</p>
-
-<p>Although the required changes to the "services.xml" is very little, we
-have created a separate service archive (MyServiceWithModule.aar) for users
-to deploy and see.</p>
-
-<p>Deploy this service using the same steps used in <a href="userguide.html#Step5_Deploy_web_service">'Step 4: Deploy Web Service'</a> sub section in '<a href="userguide.html#ws_codegen">Writing a New Service using Codegeneration</a>', and copy the
-"logging.mar" file to the "modules" directory.</p>
-
-<p>Then run using the "TestWebServiceWithModuleClient.bat" or
-"TestWebServiceWithModuleClient.sh" in the
-"<strong>Axis2Home/samples/userguide/src/userguide/clients/bin</strong>"
-directory.</p>
-
-<p>Note: To see logs, the user needs to modify the "log4j.properties" to log
-INFO. The property file is located in
-"<strong>webapps/axis2/WEB-INF/classes</strong>" of your servlet container.
-Change the line "log4j.rootCategory= ERROR, LOGFILE" to
-"log4j.rootCategory=INFO, ERROR, LOGFILE".</p>
-
-<p><font size="4"><b>Note (on samples):</b></font> All samples mentioned in
-the user's guide are located at <b>"samples\userguide\src"</b> directory of
-the binary distribution.</p>
-
-</body>
-</html>
+<html>
+<head>
+  <meta http-equiv="content-type" content="">
+  <title>Writing your Own Axis2 Module</title>
+  <link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+
+<body dir="ltr" lang="en-US">
+
+<a name="Modules"></a>
+<h1></a>Writing your Own Axis2 Module</h1>
+
+<p>Axis2 provides extended support for modules (See <a
+href="Axis2ArchitectureGuide.html" target="_blank">Architecture Guide</a> for
+more details about modules in Axis2). Let's create a custom module and deploy
+it to MyService which we created earlier.</p>
+
+<p><i>Send your feedback or questions to: <a
+href="mailto:axis-dev@ws.apache.org">axis-dev@ws.apache.org</a></i>. Prefix
+subject with [Axis2]. To subscribe to mailing list see <a
+href="http://ws.apache.org/axis2/mail-lists.html">here.</a></p>
+
+<h2>Content List</h2>
+<ul>
+  <li><a href="#MyService_with_a_Logging_Module">MyService with a Logging Module</a></li>
+  <ul>
+      <li><a href="#Step1_:_LoggingModule_Class">Step1 : LoggingModule Class</a></li>
+      <li><a href="#Step2_:_LogHandler">Step2 : LogHandler</a></li>
+      <li><a href="#Step3_:_module_xml">Step3 : module.xml</a></li>
+      <li><a href="#Step_4:_Modify_the_&#34;axis2_xml&#34;">Step 4: Modify the "axis2.xml"</a></li>
+      <li><a href="#Step5_:_Modify_the_&#34;services_xml&#34;">Step5 : Modify the "services.xml</a></li>
+      <li><a href="#Step6_:_Packaging">Step6 : Packaging</a></li>
+      <li><a href="#Step7_:_Deploy_the_Module_in_Axis2">Step7 : Deploy the Module in Axis2</a></li>
+  </ul>
+</ul>
+
+
+<p>Following steps show the actions that need to be performed to deploy a
+custom module for a given Web service:</p>
+<ol>
+  <li><p style="margin-bottom: 0in">Create the Module Implementation</p>
+  </li>
+  <li><p style="margin-bottom: 0in">Create the Handlers</p>
+  </li>
+  <li><p style="margin-bottom: 0in">Create the module.xml</p>
+  </li>
+  <li><p style="margin-bottom: 0in">Modify the "axis2.xml" (if you need
+    custom phases)</p>
+  </li>
+  <li><p style="margin-bottom: 0in">Modify the "services.xml" to engage
+    modules at the deployment time.</p>
+  </li>
+  <li><p style="margin-bottom: 0in">Package in a ".mar" (Module Archive)</p>
+  </li>
+  <li><p>Deploy the module in Axis2</p>
+  </li>
+</ol>
+
+<a name="MyService_with_a_Logging_Module"></a>
+<h3>MyService with a Logging Module</h3>
+
+<p>Let's write a simple logging module for our sample located at
+<b>"samples\userguide\src"</b> directory of the binary distribution. This
+module contains one handler that just logs the message that is passed through
+it. Axis2 uses ".mar" (Module Archive) to deploy modules in Axis2. Following
+diagram shows the file structure inside which needs to be there in the ".mar"
+archive. Let's create all these and see how it works.</p>
+
+<p><img src="images/userguide/ModuleView.jpg" name="Graphic5" align="bottom"
+border="0"></p>
+
+<a name="Step1_:_LoggingModule_Class"></a>
+<h4>Step1 : LoggingModule Class</h4>
+
+<p>LoggingModule is the implementation class of the Axis2 module. Axis2
+modules should implement the "<a
+href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/modules/Module.java?rev=396785&amp;view=log">org.apache.axis2.modules.Module</a>"
+interface with the following methods.</p>
+<pre>public void init(ConfigurationContext configContext, AxisModule module) throws AxisFault;//Initialize the module
+public void shutdown(ConfigurationContext configurationContext) throws AxisFault;//End of module processing
+public void engageNotify(AxisDescription axisDescription) throws AxisFault;
+public String[] getPolicyNamespaces() throws AxisFault;
+public void applyPolicy(Policy policy, AxisDescription axisDescription) throws AxisFault ;
+public boolean canSupportAssertion(Assertion assertion) ;
+</pre>
+
+<p>Firt three methods can be used to control the module initialization and the
+termination , and the next three methods are used to perform policy related stuff
+With the input parameter AxisConfiguration, the user is provided
+with the complete configuration hierarchy. This can be used to fine-tune the
+module behavior by the module writers. For the simple logging service we can
+keep these methods blank in our implementation class.</p>
+
+<a name="Step2_:_LogHandler"></a>
+<h4>Step2 : LogHandler</h4>
+
+<p>A module in Axis2 can contain, one or more handlers that perform various
+SOAP header processing at different phases. (See<a
+href="Axis2ArchitectureGuide.html#incomingsoap" target="_blank"> Architecture
+Guide</a> for more information on phases). To write a handler one should
+implement <a
+href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/Handler.java?rev=357187&amp;view=log">org.apache.axis2.engine.Handler</a>.
+But for convenience, <a
+href="http://svn.apache.org/viewcvs.cgi/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/handlers/AbstractHandler.java?rev=396788&amp;view=log">org.apache.axis2.handlers.AbstractHandler</a>
+provides an abstract implementation of the Handler interface.</p>
+
+<p>For the logging module we will write a handler with the following methods.
+"public void invoke(MessageContext ctx);" is the method that is called by
+Axis2 engine when the control is passed to the handler. "public void
+revoke(MessageContext ctx);" is called when the handlers are revoked by the
+Axis2 engine.</p>
+<pre>public class LogHandler extends AbstractHandler implements Handler {
+    private static final Log log = LogFactory.getLog(LogHandler.class);
+    private String name;
+
+    public String getName() {
+        return name;
+    }
+
+    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
+        log.info(msgContext.getEnvelope().toString());
+        return InvocationResponse.CONTINUE;        
+    }
+
+    public void revoke(MessageContext msgContext) {
+        log.info(msgContext.getEnvelope().toString());
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}</pre>
+
+<a name="Step3_:_module_xml"></a>
+<h4>Step3 : module.xml</h4>
+
+<p>"module.xml" contains the deployment configurations for a particular
+module. It contains details such as Implementation class of the module (in
+this example it is the "LoggingModule" class and various handlers that will
+run in different phases). "module.xml" for the logging module will be as
+follows:</p>
+<pre>&lt;module name="logging" class="userguide.loggingmodule.LoggingModule "&gt;
+   &lt;inflow&gt;
+        &lt;handler name="InFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
+        &lt;order phase="loggingPhase" /&gt;
+        &lt;/handler&gt;
+   &lt;/inflow&gt;
+
+   &lt;outflow&gt;
+        &lt;handler name="OutFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
+        &lt;order phase="loggingPhase"/&gt;
+        &lt;/handler&gt;
+   &lt;/outflow&gt;
+
+   &lt;Outfaultflow&gt;
+        &lt;handler name="FaultOutFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
+        &lt;order phase="loggingPhase"/&gt;
+        &lt;/handler&gt;
+   &lt;/Outfaultflow&gt;
+
+   &lt;INfaultflow&gt;
+        &lt;handler name="FaultInFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
+        &lt;order phase="loggingPhase"/&gt;
+        &lt;/handler&gt;
+   &lt;/INfaultflow&gt;
+&lt;/module&gt;</pre>
+
+<p>As you can see there are four flows defined in this "module.xml"</p>
+<ol>
+  <li>inflow - Represents the handler chain that will run when a message is
+    coming in. </li>
+  <li><p style="margin-bottom: 0in">outflow - Represents the handler chain
+    that will run when the message is going out. </p>
+  </li>
+  <li><p style="margin-bottom: 0in">Outfaultflow - Represents the handler
+    chain that will run when there is a fault and the fault is going out</p>
+  </li>
+  <li><p>INfaultflow - Represents the handler chain that will run when there
+    is a fault and the fault is coming in </p>
+  </li>
+</ol>
+
+<p>Following set of tags describe the name of the handler, handler class and
+the phase in which this handler is going to run. "InFlowLogHandler" is the
+name given for the particular instance of this handler class. The value of
+class attribute is the actual implementation class for this handler. Since we
+are writing logging handler, we can reuse the same handler in all these
+phases. However this may not be the same for all the modules. "&lt;order
+phase="loggingPhase" /&gt;" describes the phase in which this handler
+runs.</p>
+<pre>&lt;handler name="InFlowLogHandler" class="userguide.loggingmodule.LogHandler"&gt;
+&lt;order phase="loggingPhase" /&gt;
+&lt;/handler&gt;</pre>
+
+<p>To learn more about Phase rules, check out the article <a
+href="http://www.developer.com/java/web/article.php/3529321"
+target="_blank">Axis2 Execution Framework</a></p>
+
+<a name="Step_4:_Modify_the_&#34;axis2_xml&#34;"></a>
+<h4>Step 4: Modify the "axis2.xml"</h4>
+
+<p>In this handler, the phase "loggingPhase", is defined by the module
+writer. It is not a pre-defined handler phase, hence the module writer should
+introduce it to the "axis2.xml" (NOT the services.xml) so that the Axis2
+engine knows where to place the handler in different "flows" ( inFlow,
+outFlow, etc.). Following xml lines show the respective changes made to the
+"axis2.xml" in order to deploy this logging module in the Axis2 engine. This
+is an extract of the phase section of "axis2.xml".</p>
+<pre>&lt;!-- ================================================= --&gt;
+&lt;!-- Phases --&gt;
+&lt;!-- ================================================= --&gt;
+
+&lt;phaseOrder type="inflow"&gt;
+        &lt;!--  System pre defined phases       --&gt;
+        &lt;phase name="TransportIn"/&gt;
+        &lt;phase name="PreDispatch"/&gt;
+        &lt;phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase"&gt;
+            &lt;handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"&gt;
+                &lt;order phase="Dispatch"/&gt;
+            &lt;/handler&gt;
+
+            &lt;handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"&gt;
+                &lt;order phase="Dispatch"/&gt;
+            &lt;/handler&gt;
+
+            &lt;handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"&gt;
+                &lt;order phase="Dispatch"/&gt;
+            &lt;/handler&gt;
+
+            &lt;handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"&gt;
+                &lt;order phase="Dispatch"/&gt;
+            &lt;/handler&gt;
+            &lt;handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher"&gt;
+                &lt;order phase="PostDispatch"/&gt;
+            &lt;/handler&gt;
+        &lt;/phase&gt;
+        &lt;!--  System pre defined phases       --&gt;
+        &lt;!--   After Postdispatch phase module author or service author can add any phase he wants      --&gt;
+        &lt;phase name="OperationInPhase"/&gt;
+        &lt;phase name="<span style="color: rgb(36, 193, 19);">loggingPhase</span>"/&gt;
+    &lt;/phaseOrder&gt;
+    &lt;phaseOrder type="outflow"&gt;
+        &lt;!--      user can add his own phases to this area  --&gt;
+        &lt;phase name="OperationOutPhase"/&gt;
+        &lt;phase name="<span style="color: rgb(36, 193, 19);">loggingPhase</span>"/&gt;
+        &lt;!--system predefined phases--&gt;
+        &lt;!--these phases will run irrespective of the service--&gt;
+        &lt;phase name="PolicyDetermination"/&gt;
+        &lt;phase name="MessageOut"/&gt;
+    &lt;/phaseOrder/&gt;
+    &lt;phaseOrder type="INfaultflow"&gt;
+        &lt;!--      user can add his own phases to this area  --&gt;
+        &lt;phase name="OperationInFaultPhase"/&gt;
+        &lt;phase name="<span style="color: rgb(36, 193, 19);">loggingPhase</span>"/&gt;
+    &lt;/phaseOrder&gt;
+    &lt;phaseOrder type="Outfaultflow"&gt;
+        &lt;!--      user can add his own phases to this area  --&gt;
+        &lt;phase name="OperationOutFaultPhase"/&gt;
+        &lt;phase name="<span style="color: rgb(36, 193, 19);">loggingPhase</span>"/&gt;
+        &lt;phase name="PolicyDetermination"/&gt;
+        &lt;phase name="MessageOut"/&gt;
+    &lt;/phaseOrder&gt;
+    </pre>
+
+<p>The text in green, the custom phase "loggingPhase" is placed in all the
+flows, hence that phase will be called in all the message flows in the
+engine. Since our module is associated with this phase, the LogHandler inside
+the module will now be executed in this phase.</p>
+
+<a name="Step5_:_Modify_the_&#34;services_xml&#34;"></a>
+<h4>Step5 : Modify the "services.xml"</h4>
+
+<p>Up to this point we have created the required classes and configuration
+descriptions for the logging module and by changing the "axis2.xml" we have
+created the required phases for the logging module.</p>
+
+<p>Next step is to "<b>engage</b>" (use) this module in one of our services.
+For this, let's use the same Web service that we have used throughout the
+user's guide- MyService. However, since we need to modify the "services.xml"
+of MyService in order to engage this module, we use a separate Web service,
+but with the similar operations.</p>
+
+<p>The code for this service can be found in the
+"<strong>Axis2_HOME/samples/userguide/src/userguide/example2</strong>"
+directory. The simple changes that we have done to "services.xml' are shown
+in green in the following lines of xml.</p>
+<pre>&lt;service name="<span style="color: rgb(36, 193, 19);">MyServiceWithModule</span>"&gt;
+    &lt;description&gt;
+    This is a sample Web service with a logging module engaged.
+    &lt;/description&gt;
+    <span style="color: rgb(36, 193, 19);">&lt;module ref="logging"/&gt;</span>
+    &lt;parameter name="ServiceClass" locked="xsd:false"&gt;userguide.example2.MyService&lt;/parameter&gt;
+    &lt;operation name="echo"&gt;
+    &lt;messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/&gt;
+    &lt;/operation&gt;
+    &lt;operation name="ping"&gt;
+    &lt;messageReceiver class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/&gt;
+    &lt;/operation&gt;
+&lt;/service&gt;</pre>
+
+<p>In this example we have changed the service name (the implementation class
+is very similar to what we have used earlier although it is in a different
+package). In addition we have added the line <b>"&lt;module
+ref="logging"/&gt;"</b> to "services.xml". This informs the Axis2 engine that
+the module "logging" should be engaged for this service. The handler inside
+the module will be executed in their respective phases as described by the
+"module.xml".</p>
+
+<a name="Step6_:_Packaging"></a>
+<p><b>Step6 : Packaging</b></p>
+
+<p>Before deploying the module we need to create the ".mar" file for this
+module. This can be done, using the "jar" command and then renaming the
+created jar file. Or you can find the "logging.mar" that is already created
+for you in the "<strong>Axis2_HOME/samples/userguide</strong>" directory.</p>
+
+<a name="Step7_:_Deploy_the_Module_in_Axis2"></a>
+<h4>Step7 : Deploy the Module in Axis2</h4>
+
+<p>Deploying a module in Axis2 require the user to create a directory with
+the name "modules" in the "webapps/axis2/WEB-INF" directory of their servlet
+container and then copying the ".mar" file to that directory. So let's first
+create the "modules" directory and drop the "logging.mar" in to this
+directory.</p>
+
+<p>Although the required changes to the "services.xml" is very little, we
+have created a separate service archive (MyServiceWithModule.aar) for users
+to deploy and see.</p>
+
+<p>Deploy this service using the same steps used in <a href="adv-userguide.html#Step5_Deploy_web_service">'Step 4: Deploy Web Service'</a> sub section in '<a href="userguide.html#ws_codegen">Writing a New Service using Codegeneration</a>', and copy the
+"logging.mar" file to the "modules" directory.</p>
+
+<p>Then run using the "TestWebServiceWithModuleClient.bat" or
+"TestWebServiceWithModuleClient.sh" in the
+"<strong>Axis2Home/samples/userguide/src/userguide/clients/bin</strong>"
+directory.</p>
+
+<p>Note: To see logs, the user needs to modify the "log4j.properties" to log
+INFO. The property file is located in
+"<strong>webapps/axis2/WEB-INF/classes</strong>" of your servlet container.
+Change the line "log4j.rootCategory= ERROR, LOGFILE" to
+"log4j.rootCategory=INFO, ERROR, LOGFILE".</p>
+
+<p><font size="4"><b>Note (on samples):</b></font> All samples mentioned in
+the user's guide are located at <b>"samples\userguide\src"</b> directory of
+the binary distribution.</p>
+
+</body>
+</html>

Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/tcp-transport.html
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/xdocs/1_1/tcp-transport.html?view=diff&rev=488985&r1=488984&r2=488985
==============================================================================
--- webservices/axis2/branches/java/1_1/xdocs/1_1/tcp-transport.html (original)
+++ webservices/axis2/branches/java/1_1/xdocs/1_1/tcp-transport.html Wed Dec 20 01:04:27 2006
@@ -1,127 +1,127 @@
-<html>
-
-<head>
-  <title>TCP transport</title>
-  <link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all" />
-</head>
-
-<body lang="en">
-<h1>TCP Transport</h1>
-
-This document will explain how to send and receive SOAP Messages via TCP in
-Axis2. 
-
-<p><i>Send your feedback or questions to: <a
-href="mailto:axis-dev@ws.apache.org">axis-dev@ws.apache.org</a></i>. Prefix
-subject with [Axis2]. To subscribe to mailing list see <a
-href="http://ws.apache.org/axis2/mail-lists.html">here.</a></p>
-
-<h2>Content</h2>
-<ul>
-  <li><a href="#intro">Introduction</a></li>
-  <li><a href="#start">How to Start the TCPServer</a></li>
-  <li><a href="#send">How to Send SOAP Messages Using TCP Transport</a></li>
-  <li><a href="#samples">Samples</a></li>
-  <li><a href="#components">Transport Components</a></li>
-</ul>
-
-<a name="intro"></a>
-<h2>Introduction</h2>
-
-<p>Axis2 supports TCP as a transport. It has support for both send and receive SOAP 
-Messages via TCP. TCP transport does not have any application
-level headers and the SOAP Message that is sent should be self contained.
-This makes the interaction fast and simple. However, since there are no
-application headers, it does not have the privilege of having request URI,
-and Service dispatching should be done by an alternative method. Thus,
-RequestURIBasedDispatcher can not be used. The following are the two main
-alternatives available for dispatching in the Axis2 environment:</p>
-<ol>
-  <li>Use the name space URI of the first child element of SOAPBody.
-    (SOAPMessageBodyBasedDispatcher).</li>
-  <li>Enable WS-Addressing. In the case of version 1.1 release Addressing is
-    default (SOAPActionBasedDispatcher).</li>
-</ol>
-
-<p>When the TCP request is sent it is the user's responsibility to use either
-Addressing or SOAP body base mechanism.</p>
-
-<a name="start"></a>
-<h2>How to Start the TCPServer</h2>
-
-<p>The TCP server can be started by running the class
-org.apache.axis2.transport.tcp.TCPServer with two parameters - <a
-href="../faq.html#c5">repository</a> and port number, as arguments. This
-class needs all the Axis dependency jars in the classpath. New services can
-be added in the usual way by dropping the archives to the repository (See <a
-href="userguide.html">User's Guide</a> for more information)</p>
-
-<!--<p>Alternatively the TCP Server can run with tcp-server.bat/ tcp-server.sh
-file in the bin directory of the Binary distribution of TCP Server.</p>-->
-<a name="send"></a>
-<h2>How to Send SOAP Messages Using TCP Transport</h2>
-
-<p>TCP transport can be enabled easily from the call API. The following code
-segment demonstrates how it can be done.</p>
-<source><pre>
-OMElement payload = ...
-ServiceClient serviceClient = new ServiceClient();
-Options options = new Options();
-options.setTo(targetEPR);
-<!--options.useSeperateListener(false);-->
-<!--commented off as their is an error--- "The method useSeperateListener(boolean)is undefined for the type Options">
-serviceClient.setOptions(options);
-
-OMElement response =
-        serviceClient.sendReceive(payload);
-</pre>
-</source>
-<p>The transport that should be invoked is inferred from the targetEPR
-(tcp://...). In this case it is TCP and the listener, also TCP . SOAP Message
-has to be self contained in order to use Addressing. The other option is to
-use the URI of the first child of the SOAP Body to dispatch the service. The
-Parameter is of the type <a href="../faq.html#a2">OMElement</a>, the XML
-representation of Axis2.</p>
-
-<a name="samples"></a>
-<h2>Samples</h2>
-
-<p>Sample for a TCP Client can be found from the
-samples/userguide/src/userguide/clients/TCPClient.java in the binary
-distribution. This accesses the same Web service explained in the <a
-href="userguide.html">Axis2 User's Guide</a>. The client first starts the
-TCPServer with the same repository used for the <a
-href="userguide.html">Axis2 User's Guide</a> samples. Since sample is already
-deployed in the repository while trying the userguide it will be
-automatically available.</p>
-
-<p>In order to run the TCPClient.java, addressing should be engaged both in the 
-client and server sides. In client side, you can engage addressing by copying 
-the addressing-1.1.mar (AXIS2_HOME/repository/module) to AXIS2_HOME/lib directory.</p>
-
-<a name="components"></a>
-<h2>Transport Components</h2>
-
-<p>Axis2 TCP transport has two components, a transport Listener for receiving
-the Messages and transport Sender to send the SOAP Messages. Axis2
-installation has both the components built in to itself by default. In the
-axis2.xml configuration file the two TCP transport components would look as
-follows.</p>
-
-<p>If the TCP server is started manually this configuration does not take
-effect. In return this effects the transport Listener's start by Axis2. (e.g.
-Listener started by the Complete Async interaction)</p>
-
-<p>The following xml lines initializes the TCPTransport Receiver:</p>
-<source><pre>
-&lt;transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer"&gt;
-    &lt;parameter name="port" locked="false"&gt;6060&lt;/parameter&gt;
-&lt;/transportReceiver&gt;</pre>
-</source>
-<p>The following xml lines adds the TCPTransport Sender:</p>
-<source><pre>&lt;transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/&gt;</pre>
-</source>
-
-</body>
-
-</html>
+<html>
+
+<head>
+  <title>TCP transport</title>
+  <link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all" />
+</head>
+
+<body lang="en">
+<h1>TCP Transport</h1>
+
+This document will explain how to send and receive SOAP Messages via TCP in
+Axis2. 
+
+<p><i>Send your feedback or questions to: <a
+href="mailto:axis-dev@ws.apache.org">axis-dev@ws.apache.org</a></i>. Prefix
+subject with [Axis2]. To subscribe to mailing list see <a
+href="http://ws.apache.org/axis2/mail-lists.html">here.</a></p>
+
+<h2>Content</h2>
+<ul>
+  <li><a href="#intro">Introduction</a></li>
+  <li><a href="#start">How to Start the TCPServer</a></li>
+  <li><a href="#send">How to Send SOAP Messages Using TCP Transport</a></li>
+  <li><a href="#samples">Samples</a></li>
+  <li><a href="#components">Transport Components</a></li>
+</ul>
+
+<a name="intro"></a>
+<h2>Introduction</h2>
+
+<p>Axis2 supports TCP as a transport. It has support for both send and receive SOAP 
+Messages via TCP. TCP transport does not have any application
+level headers and the SOAP Message that is sent should be self contained.
+This makes the interaction fast and simple. However, since there are no
+application headers, it does not have the privilege of having request URI,
+and Service dispatching should be done by an alternative method. Thus,
+RequestURIBasedDispatcher can not be used. The following are the two main
+alternatives available for dispatching in the Axis2 environment:</p>
+<ol>
+  <li>Use the name space URI of the first child element of SOAPBody.
+    (SOAPMessageBodyBasedDispatcher).</li>
+  <li>Enable WS-Addressing. In the case of version 1.1 release Addressing is
+    default (SOAPActionBasedDispatcher).</li>
+</ol>
+
+<p>When the TCP request is sent it is the user's responsibility to use either
+Addressing or SOAP body base mechanism.</p>
+
+<a name="start"></a>
+<h2>How to Start the TCPServer</h2>
+
+<p>The TCP server can be started by running the class
+org.apache.axis2.transport.tcp.TCPServer with two parameters - <a
+href="../faq.html#c5">repository</a> and port number, as arguments. This
+class needs all the Axis dependency jars in the classpath. New services can
+be added in the usual way by dropping the archives to the repository (See <a
+href="adv-userguide.html">Advance User's Guide</a> for more information)</p>
+
+<!--<p>Alternatively the TCP Server can run with tcp-server.bat/ tcp-server.sh
+file in the bin directory of the Binary distribution of TCP Server.</p>-->
+<a name="send"></a>
+<h2>How to Send SOAP Messages Using TCP Transport</h2>
+
+<p>TCP transport can be enabled easily from the call API. The following code
+segment demonstrates how it can be done.</p>
+<source><pre>
+OMElement payload = ...
+ServiceClient serviceClient = new ServiceClient();
+Options options = new Options();
+options.setTo(targetEPR);
+<!--options.useSeperateListener(false);-->
+<!--commented off as their is an error--- "The method useSeperateListener(boolean)is undefined for the type Options">
+serviceClient.setOptions(options);
+
+OMElement response =
+        serviceClient.sendReceive(payload);
+</pre>
+</source>
+<p>The transport that should be invoked is inferred from the targetEPR
+(tcp://...). In this case it is TCP and the listener, also TCP . SOAP Message
+has to be self contained in order to use Addressing. The other option is to
+use the URI of the first child of the SOAP Body to dispatch the service. The
+Parameter is of the type <a href="../faq.html#a2">OMElement</a>, the XML
+representation of Axis2.</p>
+
+<a name="samples"></a>
+<h2>Samples</h2>
+
+<p>Sample for a TCP Client can be found from the
+samples/userguide/src/userguide/clients/TCPClient.java in the binary
+distribution. This accesses the same Web service explained in the <a
+href="adv-userguide.html">Axis2 Advacnce User's Guide</a>. The client first starts the
+TCPServer with the same repository used for the <a
+href="adv-userguide.html">Axis2 Advance User's Guide</a> samples. Since sample is already
+deployed in the repository while trying the userguide it will be
+automatically available.</p>
+
+<p>In order to run the TCPClient.java, addressing should be engaged both in the 
+client and server sides. In client side, you can engage addressing by copying 
+the addressing-1.1.mar (AXIS2_HOME/repository/module) to AXIS2_HOME/lib directory.</p>
+
+<a name="components"></a>
+<h2>Transport Components</h2>
+
+<p>Axis2 TCP transport has two components, a transport Listener for receiving
+the Messages and transport Sender to send the SOAP Messages. Axis2
+installation has both the components built in to itself by default. In the
+axis2.xml configuration file the two TCP transport components would look as
+follows.</p>
+
+<p>If the TCP server is started manually this configuration does not take
+effect. In return this effects the transport Listener's start by Axis2. (e.g.
+Listener started by the Complete Async interaction)</p>
+
+<p>The following xml lines initializes the TCPTransport Receiver:</p>
+<source><pre>
+&lt;transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer"&gt;
+    &lt;parameter name="port" locked="false"&gt;6060&lt;/parameter&gt;
+&lt;/transportReceiver&gt;</pre>
+</source>
+<p>The following xml lines adds the TCPTransport Sender:</p>
+<source><pre>&lt;transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/&gt;</pre>
+</source>
+
+</body>
+
+</html>

Modified: webservices/axis2/branches/java/1_1/xdocs/1_1/toc.html
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/xdocs/1_1/toc.html?view=diff&rev=488985&r1=488984&r2=488985
==============================================================================
--- webservices/axis2/branches/java/1_1/xdocs/1_1/toc.html (original)
+++ webservices/axis2/branches/java/1_1/xdocs/1_1/toc.html Wed Dec 20 01:04:27 2006
@@ -1,246 +1,74 @@
 <html>
 <head>
 <link href="../css/axis-docs.css" rel="stylesheet" type="text/css" media="all" />
+<style type="text/css" media="screen"><!--
+ul { list-style-type: none; margin: 0 0 0 5px; padding: 0; border-width: 0; list-style-position: outside; }
+--></style>
 </head>
 
 <body lang="en-US" dir="ltr">
 <h1>Table of Contents</h1>
-
-<table width="100%">
-<tr>
-<td width="20">1.</td>
-<td><a href="contents.html" target="mainFrame">Introduction</a></td>
-</tr>
-
-<tr>
-<td width="20">2.</td>
-<td><a href="installationguide.html" target="mainFrame">Installation Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">3.</td>
-<td><a href="../modules/index.html" target="mainFrame">Addon Modules</a></td>
-</tr>
-<tr>
-<td width="20">4.</td>
-<td><a href="app_server.html" target="mainFrame">Application Server Specific Configuration Guide</a></td>
-</tr>
-<tr>
-<td width="20">5.</td>
-<td><a href="quickstartguide.html" target="mainFrame">QuickStart Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">6.</td>
-<td><a href="userguide.html" target="mainFrame">User Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">7.</td>
-<td><a href="axis2config.html" target="mainFrame">Configuration Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">8.</td>
-<td><a href="Axis2ArchitectureGuide.html" target="mainFrame">Architecture Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">9.</td>
-<td><a href="pojoguide.html" target="mainFrame">POJO Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">10.</td>
-<td><a href="spring.html" target="mainFrame">Spring Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">11.</td>
-<td><a href="modules.html" target="mainFrame">Modules Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">12.</td>
-<td>ADB Data Binding
-<table width="100%">
-  <tr>
-  <td width="20">12.1</td>
-  <td><a href="adb/adb-howto.html" target="mainFrame">Architecture</a></td>
-  </tr>
-  <tr>
-  <td width="20">12.2</td>
-  <td><a href="adb/adb-advanced.html" target="mainFrame">Advanced Features</a></td>
-  </tr>
-  <tr>
-  <td width="20">12.3</td>
-  <td><a href="adb/adb-codegen-integration.html" target="mainFrame">Code generation integration</a></td>
-  </tr>
-  <tr>
-  <td width="20">12.4</td>
-  <td><a href="adb/adb-tweaking.html" target="mainFrame">Tweaking</a></td>
-  </tr>
-</td>
-</tr>
-</table>
-</tr>
-
-<tr>
-<td width="20">13.</td>
-<td>JiBX Data binding
-<table width="100%">
-  <tr>
-  <td width="20">13.1</td>
-  <td><a href="jibx/jibx-codegen-integration.html" target="mainFrame">Code generation integration</a></td>
-  </tr>
-  <tr>
-  <td width="20">13.2</td>
-  <td><a href="jibx/jibx-doclit-example.html" target="mainFrame">doc/lit example</a></td>
-  </tr>
-  <tr>
-  <td width="20">13.2</td>
-  <td><a href="jibx/jibx-unwrapped-example.html" target="mainFrame">unwrapped example</a></td>
-  </tr>
-</td>
-</tr>
-</table>
-</tr>
-
-<tr>
-<td width="20">14.</td>
-<td>Advanced
-<table width="100%">
-  <tr>
-  <td width="20">14.1</td>
-  <td><a href="xmlbased-server.html" target="mainFrame">AXIOM based Service</a></td>
-  </tr>
-  <tr>
-  <td width="20">14.2</td>
-  <td><a href="dii.html" target="mainFrame">AXIOM based Client</a></td>
-  </tr>
-</td>
-</tr>
-</table>
-</tr>
-
-<tr>
-<td width="20">15.</td>
-<td><a href="mtom-guide.html" target="mainFrame">Attachments/MTOM Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">16.</td>
-<td>Transports
-<table width="100%">
-  <tr>
-  <td width="20">16.1</td>
-  <td><a href="http-transport.html" target="mainFrame">HTTP Transport</a></td>
-  </tr>
-  <tr>
-  <td width="20">16.2</td>
-  <td><a href="jms-transport.html" target="mainFrame">JMS Transport</a></td>
-  </tr>
-  <tr>
-  <td width="20">16.3</td>
-  <td><a href="tcp-transport.html" target="mainFrame">TCP Transport</a></td>
-  </tr>
-  <tr>
-  <td width="20">16.4</td>
-  <td><a href="mail-transport.html" target="mainFrame">Mail Transport</a> / <a href="mail-configuration.html" target="mainFrame">(Configuration)</a> </td>
-  </tr>
-  <tr>
-  <td width="20">16.5</td>
-  <td><a href="transport_howto.html" target="mainFrame">Custom Transport</a></td>
-  </tr>
-</td>
-</tr>
-</table>
-
-<tr>
-<td width="20">17.</td>
-<td><a href="WS_policy.html" target="mainFrame">WS-Policy Support</a></td>
-</tr>
-
-<tr>
-<td width="20">18.</td>
-<td><a href="rest-ws.html" target="mainFrame">REST Support</a></td>
-</tr>
-
-<tr>
-<td width="20">19.</td>
-<td><a href="webadminguide.html" target="mainFrame">Web Administrator's Guide</a></td>
-</tr>
-
-<tr>
-<td width="20">20.</td>
-<td><a href="soapmonitor-module.html" target="mainFrame">SOAP Monitor</a></td>
-</tr>
-
-<tr>
-<td width="20">21.</td>
-<td><a href="reference.html" target="mainFrame">Command line tools</a></td>
-</tr>
-
-<tr>
-<td width="20">22.</td>
-<td><a href="../tools/index.html" target="mainFrame">Tools/Plugins</a>
-<table width="100%">
-  <tr>
-  <td width="20">22.1</td>
-  <td><a href="../tools/1_1/CodegenToolReference.html" target="mainFrame">Code Generator Tool - Command Line and Ant Task</a></td>
-  </tr>
-  <tr>
-  <td width="20">22.2</td>
-  <td><a href="../tools/1_1/idea/Idea_plug-in_userguide.html" target="mainFrame">Axis2 plugin for IntelliJ IDEA</a></td>
-  </tr>
-  <tr>
-  <td width="20">22.3</td>
-  <td><a href="../tools/1_1/eclipse/servicearchiver-plugin.html" target="mainFrame">Service Archive Generator Wizard - Eclipse Plug-in</a></td>
-  </tr>
-  <tr>
-  <td width="20">22.4</td>
-  <td><a href="../tools/1_1/eclipse/wsdl2java-plugin.html" target="mainFrame">Code Generator Wizard - Eclipse Plug-in</a></td>
-  </tr>
-  <tr>
-  <td width="20">22.5</td>
-  <td><a href="../tools/1_1/maven-plugins/maven-aar-plugin.html" target="mainFrame">AAR Maven2 Plug-in</a></td>
-  </tr>
-  <tr>
-  <td width="20">22.6</td>
-  <td><a href="../tools/1_1/maven-plugins/maven-java2wsdl-plugin.html" target="mainFrame">Java2WSDL Maven2 Plug-in</a></td>
-  </tr>
-  <tr>
-  <td width="20">22.7</td>
-  <td><a href="../tools/1_1/maven-plugins/maven-wsdl2code-plugin.html" target="mainFrame">WSDL2Code Maven2 Plug-in</a></td>
-  </tr>
-  <tr>
-  <td width="20">22.8</td>
-  <td><a href="../tools/previous.html" target="mainFrame">Tools Archive</a></td>
-  </tr>
-</td>
-</tr>
-</table>
-</tr>
-
-<tr>
-<td width="20">23.</td>
-<td><a href="migration.html" target="mainFrame">Migration Guide (from Axis1)</a></td>
-</tr>
-
-<tr>
-<td width="20">24.</td>
-<td>Design Notes
-<table width="100%">
-  <tr>
-  <td width="20">24.1</td>
-  <td><a href="Axis2-rpc-support.html" target="mainFrame">RPC Support</a></td>
-  </tr>
-</td>
-</tr>
-</table>
-</tr>
-
-
-</table>
+<ol>
+           <li><a href="contents.html" target="mainFrame">Introduction</a>
+           <li><a href="installationguide.html" target="mainFrame">Installation Guide</a>
+           <li><a href="../modules/index.html" target="mainFrame">Addon Modules</a>
+           <li><a href="app_server.html" target="mainFrame">Application Server Specific Configuration Guide</a>
+           <li><a href="quickstartguide.html" target="mainFrame">QuickStart Guide</a>
+           <li><a href="userguide.html" target="mainFrame">User's Guide</a>
+ 	     <li><a href="adv-userguide.html" target="mainFrame">Advance User's Guide</a>
+           <li><a href="axis2config.html" target="mainFrame">Configuration Guide</a>
+           <li><a href="Axis2ArchitectureGuide.html" target="mainFrame">Architecture Guide</a>
+           <li><a href="pojoguide.html" target="mainFrame">POJO Guide</a>
+           <li><a href="spring.html" target="mainFrame">Spring Guide</a>
+           <li><a href="modules.html" target="mainFrame">Modules Guide</a>
+           <li>ADB Data Binding
+               <ul>
+                   <li>13.1 <a href="adb/adb-howto.html" target="mainFrame">Architecture</a>
+                   <li>13.2 <a href="adb/adb-advanced.html" target="mainFrame">Advanced Features</a>
+                   <li>13.3 <a href="adb/adb-codegen-integration.html" target="mainFrame">Code generation integration</a>
+                   <li>13.4 <a href="adb/adb-tweaking.html" target="mainFrame">Tweaking</a>
+               </ul>
+                     <li>JiBX Data binding
+               <ul>
+                   <li>14.1 <a href="jibx/jibx-codegen-integration.html" target="mainFrame">Code generation integration</a>
+                   <li>14.2 <a href="jibx/jibx-doclit-example.html" target="mainFrame">doc/lit example</a>
+                   <li>14.3 <a href="jibx/jibx-unwrapped-example.html" target="mainFrame">unwrapped example</a>
+               </ul>
+           <li>Advanced
+               <ul>
+                   <li>15.1 <a href="xmlbased-server.html" target="mainFrame">AXIOM based Service</a>
+                   <li>15.2 <a href="dii.html" target="mainFrame">AXIOM based Client</a>
+               </ul>
+           <li><a href="mtom-guide.html" target="mainFrame">Attachments/MTOM Guide</a>
+           <li>Transports
+               <ul>
+                   <li>17.1 <a href="http-transport.html" target="mainFrame">HTTP Transport</a>
+                   <li>17.2 <a href="jms-transport.html" target="mainFrame">JMS Transport</a>
+                   <li>17.3 <a href="tcp-transport.html" target="mainFrame">TCP Transport</a>
+                   <li>17.4 <a href="mail-transport.html" target="mainFrame">Mail Transport</a> / <a href="mail-configuration.html" target="mainFrame">(Configuration)</a>
+                   <li>17.5 <a href="transport_howto.html" target="mainFrame">Custom Transport</a>
+               </ul>
+           <li><a href="WS_policy.html" target="mainFrame">WS-Policy Support</a>
+           <li><a href="rest-ws.html" target="mainFrame">REST Support</a>
+           <li><a href="webadminguide.html" target="mainFrame">Web Administrator's Guide</a>
+           <li><a href="soapmonitor-module.html" target="mainFrame">SOAP Monitor</a>
+           <li><a href="reference.html" target="mainFrame">Command line tools</a>
+           <li><a href="../tools/index.html" target="mainFrame">Tools/Plugins</a>
+               <ul>
+                   <li>23.1 <a href="../tools/1_1/CodegenToolReference.html" target="mainFrame">Code Generator Tool - Command Line and Ant Task</a>
+                   <li>23.2 <a href="../tools/1_1/idea/Idea_plug-in_userguide.html" target="mainFrame">Axis2 plugin for IntelliJ IDEA</a>
+                   <li>23.3 <a href="../tools/1_1/eclipse/servicearchiver-plugin.html" target="mainFrame">Service Archive Generator Wizard - Eclipse Plug-in</a>
+                   <li>23.4 <a href="../tools/1_1/eclipse/wsdl2java-plugin.html" target="mainFrame">Code Generator Wizard - Eclipse Plug-in</a>
+                   <li>23.5 <a href="../tools/1_1/maven-plugins/maven-aar-plugin.html" target="mainFrame">AAR Maven2 Plug-in</a>
+                   <li>23.6 <a href="../tools/1_1/maven-plugins/maven-java2wsdl-plugin.html" target="mainFrame">Java2WSDL Maven2 Plug-in</a>
+                   <li>23.7 <a href="../tools/1_1/maven-plugins/maven-wsdl2code-plugin.html" target="mainFrame">WSDL2Code Maven2 Plug-in</a>
+                   <li>23.8 <a href="../tools/previous.html" target="mainFrame">Tools Archive</a>
+               </ul>
+           <li><a href="migration.html" target="mainFrame">Migration Guide (from Axis1)</a>
+           <li>Design Notes
+               <ul>
+                   <li>25.1 <a href="Axis2-rpc-support.html" target="mainFrame">RPC Support</a>
+               </ul>
+                 </ol>
 </body>
 </html>

Added: webservices/axis2/branches/java/1_1/xdocs/1_1/userguide-buildingservices.html
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/xdocs/1_1/userguide-buildingservices.html?view=auto&rev=488985
==============================================================================
--- webservices/axis2/branches/java/1_1/xdocs/1_1/userguide-buildingservices.html (added)
+++ webservices/axis2/branches/java/1_1/xdocs/1_1/userguide-buildingservices.html Wed Dec 20 01:04:27 2006
@@ -0,0 +1,580 @@
+<?xml version="1.0" encoding=""?>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+  <meta http-equiv="content-type" content="" />
+  <title>Introducing Axis2</title>
+  <link href="../css/axis-docs.css" rel="stylesheet" type="text/css"
+  media="all" />
+</head>
+
+<body>
+<a name="buildservices"></a>
+
+<h1>Apache Axis2 User's Guide -Building Services</h1>
+
+<p>Now that you know how to use Axis2 to generate clients from WSDL, this
+section digs a little deeper, showing you how to create services, and how to
+create both services and clients "from scratch", so to speak.</p>
+<ul>
+  <li><a href="userguide.html#intro">Introducing Axis2</a><br />
+
+    <ul>
+      <li><a href="userguide.html#whatis">What is Axis2</a></li>
+      <li><a href="userguide.html#underhood">What's under the hood?</a></li>
+      <li><a href="userguide.html#handlessoap">How Axis2 handles SOAP
+        messages</a></li>
+      <li><a href="userguide.html#distributions">Axis2 distributions</a></li>
+      <li><a href="userguide.html#sbd">The Axis2 Standard Binary
+        Distribution</a></li>
+      <li><a href="userguide.html#hierarchy">Axis2.war Directory
+      hierarchy</a></li>
+      <li><a href="userguide.html#docs">Axis2 Documents Distribution</a></li>
+      <li><a href="userguide.html#clients">Axis2 and clients</a></li>
+    </ul>
+  </li>
+  <li><a href="userguide-installingtesting.html#installingtesting">Installing
+    and testing client code</a></li>
+  <li><a href="userguide-introtoservices.html#introservices">Introduction to
+    Services</a><br />
+
+    <ul>
+      <li><a href="userguide-introtoservices.html#messageexchange">Message
+        Exchange Patterns</a></li>
+    </ul>
+  </li>
+  <li><a href="userguide-creatingclients.html#createclients">Creating
+    Clients</a><br />
+
+    <ul>
+      <li><a href="userguide-creatingclients.html#choosingclient">Choosing a
+        Client Generation Method</a></li>
+      <li><a href="userguide-creatingclients.html#generating">Generating
+        Clients</a></li>
+      <li><a href="userguide-creatingclients.html#adb">Axis Data Binding
+        (ADB)</a></li>
+    </ul>
+  </li>
+  <li><a
+    href="userguide-buildingservices.html#buildservices"><strong>Building
+    Services</strong></a><br />
+
+    <ul>
+      <li><a
+        href="userguide-buildingservices.html#getcomfortable"><strong>Getting
+        Comfortable with Available Options</strong></a></li>
+      <li><a
+        href="userguide-buildingservices.html#createscratch"><strong>Creating
+        a service from scratch</strong></a></li>
+      <li><a
+        href="userguide-buildingservices.html#deploypojo"><strong>Deploying
+        Plain Old Java Objects</strong></a></li>
+      <li><a
+        href="userguide-buildingservices.html#deployrun"><strong>Deploying
+        and running an Axis2 service created from WSDL</strong></a></li>
+    </ul>
+  </li>
+  <li><a href="userguide-samples.html">Samples</a></li>
+  <li><a href="userguide-forfurtherstudy.html">For Further Study</a></li>
+</ul>
+
+<p><a name="getcomfortable"></a></p>
+
+<h2>Getting Comfortable with Available Options</h2>
+
+<p>Axis2 provides a number of ways to create a service, such as:</p>
+<ul>
+  <li>Create a service and build it from scratch: In this case, you build
+    your service class to specifically access AXIOM OMElement objects, then
+    create the services.xml file and package it up for deployment.</li>
+  <li>Deploy Plain Old Java Objects (POJOs) as a service.</li>
+  <li>Generate the service from WSDL: Just as you can generate clients with
+    WSDL, you can generate the skeleton of a service.</li>
+</ul>
+
+<p>Let's look at these three options.</p>
+<a name="createscratch"></a>
+
+<h2>Creating a Service From Scratch</h2>
+
+<p>Creating a service from scratch is not the most convenient way to do it,
+but it does give you the most control. The process involves several steps.</p>
+
+<p><b>The short story:</b></p>
+<ol>
+  <li>Create the service class, with each operation represented by a method
+    that takes as its argument a org.apache.axiom.om.OMElement object. (An
+    OMElement is how the AXIs2 Object Model (AXIOM) represents an XML
+    element.)</li>
+  <li>Create the service descriptor, services.xml, which defines the class to
+    be used by the service and the appropriate message receivers.</li>
+  <li>Create the .aar file, with the classes in their proper locations based
+    on package and the services.xml file in the META-INF directory.</li>
+  <li>Deploy the .aar file by using the <a href="webadminguide.html">Web
+    Administration application</a> or by copying it to the Axis2 services
+    directory.</li>
+</ol>
+
+<p><b>The long story:</b></p>
+
+<p>Start by creating the service class, a plain Java class that uses classes
+from the Axis2 libraries (see Code Listing 8).</p>
+
+<h3>Code Listing 8-Creating the Service Class</h3>
+<pre>package org.apache.axis2.axis2userguide;
+
+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;
+
+public class SampleService {
+
+    public OMElement sayHello(OMElement element) 
+                             throws XMLStreamException {
+            element.build();
+            element.detach();
+
+            String rootName = element.getLocalName();
+            System.out.println("Reading "+rootName+" element");
+            
+            OMElement childElement = element.getFirstElement();
+            String personToGreet = childElement.getText();
+
+            OMFactory fac = OMAbstractFactory.getOMFactory();
+            OMNamespace omNs = fac.createOMNamespace(
+                    "http://example1.org/example1", "example1");
+            OMElement method = fac.createOMElement("sayHelloResponse", 
+omNs);
+            OMElement value = fac.createOMElement("greeting", omNs);
+            value.addChild(fac.createOMText(value, "Hello, 
+"+personToGreet));
+            method.addChild(value);
+
+            return method;
+        }
+
+     private void ping(){
+     }
+    
+}</pre>
+
+<p>Make sure to include Axis2 libraries in your class path when compiling the
+source.</p>
+
+<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).
+Methods that act as services must take as their argument an OMElement, which
+represents the payload of the incoming SOAP message. (An OMElement is just
+AXIOM's way of representing an XML element, like a DOM Element object.) In
+this case, 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>To turn this class into a service, create the service description file,
+services.xml, as in Code Listing 9.</p>
+
+<h3>Code Listing 9 - Create the Service Description</h3>
+<pre>&lt;service name="UserGuideSampleService"&gt;
+    &lt;description&gt;
+        This is a sample service created in the Axis2 User's Guide
+    &lt;/description&gt;
+
+    &lt;parameter name="ServiceClass" 
+locked="false"&gt;org.apache.axis2.axis2userguide.SampleService
+&lt;/parameter&gt;
+
+    &lt;operation name="sayHello"&gt;
+        &lt;messageReceiver 
+class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/&gt;
+    &lt;/operation&gt;
+    &lt;operation name="ping"&gt;
+        &lt;messageReceiver 
+class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/&gt;
+    &lt;/operation&gt;
+&lt;/service&gt;</pre>
+
+<p>This document defines the service, what it's called by the <a
+href="webadminguide.html">Web Administration Application</a>, and the class
+used to serve requests. For each operation, it defines the appropriate
+message receiver class.</p>
+
+<p>Create a new directory, META-INF, in the main directory for the class. (In
+this case, that's the same directory that contains the org directory) and
+place the services.xml file in it.</p>
+
+<p>Create the .aar file by typing: jar cvf SampleService.aar ./*</p>
+
+<p>Deploy the SampleService.aar file by using the <a
+href="webadminguide.html">Web Administration application</a> or by copying it
+to the Axis2 services directory.</p>
+
+<p>Now you can create a client class that accesses the service directly (see
+Code Listing 10).</p>
+
+<h3>Code Listing 10 - Create a Client Class that Accesses the Service
+Directly</h3>
+<pre>package org.apache.axis2.axis2userguide;
+
+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 org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.Constants;
+import org.apache.axis2.client.ServiceClient;
+
+public class SampleClient {
+
+       private static EndpointReference targetEPR = 
+             new EndpointReference(
+               "http://localhost:8080/axis2/services/UserGuideSampleService");
+
+        public static OMElement greetUserPayload(String personToGreet) {
+            OMFactory fac = OMAbstractFactory.getOMFactory();
+            OMNamespace omNs = fac.createOMNamespace(
+                    "http://example1.org/example1", "example1");
+            OMElement method = fac.createOMElement("sayHello", omNs);
+            OMElement value = fac.createOMElement("personToGreet", 
+omNs);
+            value.addChild(fac.createOMText(value, personToGreet));
+            method.addChild(value);
+            return method;
+        }
+
+        public static void main(String[] args) {
+            try {
+                OMElement payload = 
+SampleClient.greetUserPayload("John");
+                Options options = new Options();
+                options.setTo(targetEPR);
+                
+options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+
+                ServiceClient sender = new ServiceClient();
+                sender.setOptions(options);
+                OMElement result = sender.sendReceive(payload);
+
+                String response = result.getFirstElement().getText();
+                System.out.println(response);
+
+            } catch (Exception e) { //(XMLStreamException e) {
+                System.out.println(e.toString());
+            }
+        }
+    
+}</pre>
+
+<p>This class uses the same technique of sending and receiving OMElements,
+but it's also important to note the use of the Options class. This class
+enables you to determine properties such as the transport used for the return
+message -- the transport used for the outgoing message can be inferred from
+the URL of the destination -- and the SOAP version to use. In addition to
+providing setter and getter methods of specific properties that affect how
+the client interacts with the service, the Options class enables you to
+create inheritance relationships between Options objects, so that if a
+property is not found in the current Options object used, the client can
+check the parent Options object of the current Options object.</p>
+
+<p>Compile and run the above SampleClient.java. Make sure to have all axis2
+libraries in your class path. If all has gone well, 'Hello, John' will be
+shown as the output in the console.</p>
+<a name="deploypojo"></a>
+
+<h2>Deploying Plain Old Java Objects (POJOs)</h2>
+
+<p>One very easy way to create a Web service is simply to deploy the Java
+objects that represent the service. Start with the class, shown in Code
+Listing 11.</p>
+
+<h3><b>Code Listing 11 - Creating the Class SampleService</b></h3>
+<pre>package org.apache.axis2.axis2userguide;
+
+public class SampleService {
+
+    public void doInOnly(){
+     return; 
+    } 
+     
+    public String noParameters(){
+      return "Hello";
+    } 
+    
+    public String twoWayOneParameterEcho(String toEcho){
+      return toEcho;
+    } 
+    
+    public boolean multipleParametersAdd(float price, int itemId, 
+                             String description, String itemName){
+      //Code to handle the logic
+	    	return true;
+    } 
+ 
+}</pre>
+
+<p>Next, you'll need to tell Axis2 what class corresponds to what Web service
+calls. Do this by creating a file called services.xml and adding the
+following shown in Code Listing 12.</p>
+
+<h3><b>Code Listing 12 - Creating services.xml</b></h3>
+<pre>&lt;service name="SampleService" scope="application"&gt;
+    &lt;description&gt;
+        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;
+        org.apache.axis2.axis2userguide.SampleService
+    &lt;/parameter&gt;
+&lt;/service&gt;</pre>
+
+<p>This file makes the InOnly and InOut MEPs available to the service and
+tells Axis2 which class to call; operations must match method names. In other
+words, Axis2 automatically sends a call to the multipleParametersAdd
+operation to the
+org.apache.axis2.axis2userguide.SampleService.multipleParametersAdd()
+method.</p>
+
+<p>Now it's time to create the distribution. Arrange your files in the
+following directory structure (see Code Listing 13).</p>
+
+<h3><b>Code Listing 13- Create the Directory Structure for the
+Distribution</b></h3>
+<pre> - SampleService
+   - META-INF
+     - services.xml
+   - org
+     - apache
+       - axis2
+         - axis2userguide
+           - SampleService.class</pre>
+
+<p>Finally, deploy the service by copying the SampleService directory to the
+webapps/axis2/WEB-INF/services directory on the servlet engine. You can check to make
+sure that it's been properly deployed by checking <a
+href="http://&lt;host&gt;:&lt;port&gt;/axis2/services/listServices">http://&lt;host&gt;:&lt;port&gt;/axis2/services/listServices</a>.</p>
+<a name="deployrun"></a>
+
+<h2>Deploying and Running an Axis2 Service Created from WSDL</h2>
+
+<p>If you have a WSDL file, you can easily create and deploy a service based
+on that description. For example, to create a service based on the same WSDL
+file used in the <a href="userguide-creatingclients.html">clients section</a>
+of this document, you'd employ the following steps.</p>
+
+<p><b>The short story:</b></p>
+<ol>
+  <li>If you haven't already, <a
+    href="http://ws.apache.org/axis2/download/1_1/download.cgi#std-bin">download</a>
+    the Axis2 standard distribution.</li>
+  <li>Generate the skeleton using the WSDL2Java utility, as in: <br />
+
+    <pre>java org.apache.axis2.wsdl.WSDL2Java -uri file:///C:/apps/axis2/samples/zSample/Axis2UserGuide.wsdl -p org.apache.axis2.axis2userguide -d adb -s -wv 1.1 -ss -sd -ssi</pre>
+  </li>
+  <li>Open the *Skeleton.java file and add the functionality of your service
+    to the generated methods.</li>
+  <li>Build a service using Ant by typing ant jar.server</li>
+  <li>Deploy the service by copying the build/lib/*.aar file to
+    &lt;J2EE_HOME&gt;/webapps/axis2/WEB-INF/services</li>
+  <li>Check http://&lt;server&gt;:&lt;port&gt;/axis2/services/listServices to
+    make sure the service has been properly deployed</li>
+</ol>
+
+<p><b>The long story:</b></p>
+
+<p>As was the case in generating clients, you will need the <a
+href="http://ws.apache.org/axis2/download/1_1/download.cgi#std-bin">Axis2
+Standard Distribution</a>, because the <a
+href="http://ws.apache.org/axis2/download/1_1/download.cgi#war">Axis2 War
+Distribution</a> does not include the WSDL2Java utility. Once you've got it
+downloaded and unpacked, make sure that you set the AXIS2_HOME variable to
+point to the location in which you've unpacked it.</p>
+
+<p>Now you are ready to generate the actual service. To keep things neat,
+create a new directory and change to it. The WSDL file is the same one
+referenced in <a href="userguide-creatingclients#generating.xhtml">Generating
+Clients</a> and includes four operations: NoParameters,
+TwoWayOneParameterEcho, MultipleParametersAddItem, and DoInOnly. To generate
+the service, use the WSDL2Java utility, as in Code Listing 14.</p>
+
+<h3>Code Listing 14 - Using the WSDL2Java Utility to Generate the Service</h3>
+<pre>java org.apache.axis2.wsdl.WSDL2Java -uri 
+file:///C:/apps/axis2/samples/zSample/Axis2UserGuide.wsdl -p 
+org.apache.axis2.axis2userguide -d adb -s -wv 1.1 -ss -sd</pre>
+
+<p>This statement tells the utility you want to create a service out of the
+operations in the file Axis2UserGuide.wsdl, and that the Java classes
+generated should be in the org.apache.axis2.axis2userguide package (-p). (You
+should see the appropriate directories created.) It also indicates that you
+want to use the Axis2 DataBinding Framework, or ADB (-d), to generate only
+synchronous, or blocking code (-s), and to generate server-side code (-ss) as
+opposed to a client, including the services.xml service descriptor file
+(-sd). It also specifies version 1.1 for the WSDL file (-wv). 
+</p>
+
+<p>At this point, you should see three new items in your chosen directory:
+the build.xml file, which includes instructions for Ant, the src directory,
+which includes all of the generated classes and stubs, the resources
+directory, which includes a regenerated version of the WSDL, and the
+services.xml file, which ultimately controls the service's behavior.</p>
+
+<p>You can compile the service at this point, but it doesn't actually do
+anything yet. You can solve that problem by opening the
+src\org\apache\axis2\axis2userguide\Axis2UserGuideServiceSkeleton.java file
+and either editing the code in bold -- make sure you manage parameter numbers
+-- or replacing all of the code with the following in Code Listing 15.</p>
+
+<h3>Code Listing 15 - Compiling the Service</h3>
+<pre>/**
+ * Axis2UserGuideServiceSkeleton.java
+ *
+ * This file was auto-generated from WSDL
+ * by the Apache Axis2 version: SNAPSHOT Oct 15, 2006 (11:23:18 
+GMT+00:00)
+ */
+package org.apache.axis2.axis2userguide;
+/**
+ *  Axis2UserGuideServiceSkeleton java skeleton for the axisService
+ */
+public class Axis2UserGuideServiceSkeleton {
+     
+         
+    /**
+     * Auto generated method signature
+         
+     * @param param7
+         
+    */
+    public  org.apache.axis2.axis2userguide.NoParametersResponse 
+NoParameters
+        (org.apache.axis2.axis2userguide.NoParametersRequest param7)
+         
+    {
+        <b>System.out.println(param7);
+
+        NoParametersResponse res =
+            new NoParametersResponse();
+
+        return res;</b>
+    }
+     
+         
+    /**
+     * Auto generated method signature
+         
+     * @param param9
+         
+    */
+    public  
+org.apache.axis2.axis2userguide.TwoWayOneParameterEchoResponse 
+TwoWayOneParameterEcho
+        (
+         org.apache.axis2.axis2userguide.TwoWayOneParameterEchoRequest 
+param9
+         )
+         
+    {
+        <b>System.out.println(param9.getEchoString());
+
+        TwoWayOneParameterEchoResponse res =
+            new TwoWayOneParameterEchoResponse();
+        
+        res.setEchoString(param9.getEchoString());
+
+        return res;</b>
+    }
+     
+         
+    /**
+     * Auto generated method signature
+         
+     * @param param11
+         
+    */
+    public  void DoInOnly
+        (
+         org.apache.axis2.axis2userguide.DoInOnlyRequest param11
+         )
+         
+    {
+        <b>System.out.println(param11.getMessageString());</b>
+    }
+     
+         
+    /**
+     * Auto generated method signature
+         
+     * @param param12
+         
+    */
+    public  
+org.apache.axis2.axis2userguide.MultipleParametersAddItemResponse 
+MultipleParametersAddItem
+        (
+         
+org.apache.axis2.axis2userguide.MultipleParametersAddItemRequest 
+param12
+         )
+         
+    {
+        <b>System.out.println(param12.getPrice());
+        System.out.println(param12.getItemId());
+        System.out.println(param12.getDescription());
+        System.out.println(param12.getItemName());
+
+        MultipleParametersAddItemResponse res =
+            new MultipleParametersAddItemResponse();
+        
+        res.setSuccessfulAdd(true);
+        res.setItemId(param12.getItemId());
+
+        return res;</b>
+    }
+     
+}</pre>
+
+<p>As in the case of generating clients, all of these classes, such as
+MultipleParametersAddItemRequest and TwoWayOneParameterEchoResponse, are
+generated by the utility, and can be found in the same directory as the
+skeleton file. They include methods such as setSuccessfulAdd(), which set the
+value of the content of an element in the response, and getItemName(), which
+retrieve the content of elements in the request.</p>
+
+<p>Save the file and compile it by typing: ant jar.server</p>
+
+<p>If all goes well, you should see the BUILD SUCCESSFUL message in your
+window, and the Axis2UserGuideService.aar file in the newly created build/lib
+directory.</p>
+
+<p><img alt="The BUILD SUCCESSFUL message in your window"
+src="images/fig05.jpg" /></p>
+
+<p>Now you need to deploy the service to the server. To do that, copy the
+Axis2UserGuideService.aar file to the WEB-INF/services directory of the
+application server. (You also have the option to use the administration
+tools. See the <a href="webadminguide.html">Web Administrator's Guide</a> for
+more information.)</p>
+
+<p>To verify that the service has been properly deployed, check the list of
+services at <a
+href="http://&lt;host&gt;:&lt;port&gt;/axis2/services/listServices">http://&lt;host&gt;:&lt;port&gt;/axis2/services/listServices</a>.</p>
+
+<p><img alt="Checking the list of services" src="images/fig06.jpg" /></p>
+
+<p>Now you should be able to access the service using any of the clients
+built in the <a href="userguide-creatingclients.html#generating">Generating
+Clients</a> document.</p>
+
+<p><strong>See Next Section</strong>- <a
+href="userguide-samples.html">Samples</a></p>
+</body>
+</html>



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