axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject svn commit: r396813 - in /webservices/axis2/trunk/java/xdocs/latest: userguide3.html userguide4.html
Date Tue, 25 Apr 2006 08:36:19 GMT
Author: chinthaka
Date: Tue Apr 25 01:36:16 2006
New Revision: 396813

More changes to user guide. Specifically added information on how to put modules in the client


Modified: webservices/axis2/trunk/java/xdocs/latest/userguide3.html
--- webservices/axis2/trunk/java/xdocs/latest/userguide3.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/userguide3.html Tue Apr 25 01:36:16 2006
@@ -286,16 +286,13 @@
 <pre>  try {
             OMElement payload = ClientUtil.getEchoOMElement();
-            Options options = new Options();<br>            options.setTo(targetEPR);
-            //The boolean flag informs the axis2 engine to use two separate transport connection
-            //to retrieve the response.
-<br>            options.setUseSeparateListener(true);
-               options.setAction("urn:echo"); // this is the action mapping we put within
the service.xml
-            ServiceClient serviceClient = new ServiceClient();
-<br>        serviceClient.setOptions(options);</pre>
+            Options options = new Options();
+            options.setTo(targetEPR);
+            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
+            options.setUseSeparateListener(true);
+            options.setAction("urn:echo");  // this is the action mapping we put within the
             //Callback to handle the response
             Callback callback = new Callback() {
                 public void onComplete(AsyncResult result) {
@@ -308,18 +305,27 @@
             //Non-Blocking Invocation
-            serviceClient.sendReceiveNonBlocking(payload, callback);
+            sender = new ServiceClient();
+            sender.engageModule(new QName(Constants.MODULE_ADDRESSING));
+            sender.setOptions(options);
+            sender.sendReceiveNonBlocking(payload, callback);
             //Wait till the callback receives the response.
             while (!callback.isComplete()) {
-            serviceClient.finalizeInvoke();
+            //Need to close the Client Side Listener.
         } catch (AxisFault axisFault) {
         } catch (Exception ex) {
+        } finally {
+            try {
+                sender.finalizeInvoke();
+            } catch (AxisFault axisFault) {
+                //have to ignore this
+            }
 <p><font color="#0000ff"><font color="#000000">The boolean flag (value
@@ -331,8 +337,10 @@
 <p>Before we run the sample client we have one more step to perform. As
 mentioned earlier Axis2 uses addressing based correlation mechanism, hence we
-need to "engage" addressing module in the server side as well. According to
-the Axis2 architecture, addressing module put its handlers in the
+need to "engage" addressing module in both client and server sides. 
+<h5>Engaging Addressing in Server Side</h5>
+According to the Axis2 architecture, addressing module put its handlers in the
 "<strong>pre-dispatch</strong>" phase (See <a
 href="Axis2ArchitectureGuide.html" target="_blank">Architecture Guide</a> for
 more details about phases)  and hence "engaging" means simply adding module
@@ -344,7 +352,17 @@
 <p>Note: <font color="#000000">Once you change the "axis2.xml" you need to
 restart the servlet container.</font></p>
-<p>This will enable the addressing in the server side. Now you can test the
+<h5>Engaging Addressing in Client Side</h5>
+There are two ways of doing that. <br>One is to get the addressing-&lt;version&gt;.mar
from modules folder of the std-bin distribution. And then making that available in your classpath.
+<br>The second method is to create a ConfigurationContext giving a repository location.
Axis2 has the concept of a repository to keep the services and modules. You can use the extracted
standard binary distribution itself as the repository as it contains the proper structure
of an Axis2 repository (having services and modules folders inside it). ConfigurationContext
has the runtime context information of Axis2 system. <br>
+If you have extracted the standard binary distribution to, say, $user_home/axis2/dist, then
put the following line just before sender = new ServiceClient(); 
+ConfigurationContext configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(&lt;
Axis2RepositoryLocation &gt;, null);
+Then replace "sender = new ServiceClient();" line with "sender = new ServiceClient(configContext,
+<p>This will enable addressing in both client and server sides. Now you can test the
 "TestEchoNonBlockingDualClient" using the "testEchoNonBlockingDualClient"
 target of the ant file found at "Axis2Home/samples" directory. If you see the
 response OMElement printed in the client side, then you have successfully

Modified: webservices/axis2/trunk/java/xdocs/latest/userguide4.html
--- webservices/axis2/trunk/java/xdocs/latest/userguide4.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/userguide4.html Tue Apr 25 01:36:16 2006
@@ -4,7 +4,7 @@
   <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
   <title>Axis2 User's Guide</title>
-  <meta name="generator" content="amaya 9.2.1, see">
+  <meta name="generator" content="Bluefish 1.0.4">
 <body lang="en-US" dir="ltr">
@@ -67,16 +67,16 @@
 <h4><a name="Step1_:_LoggingModule_Class">Step1 : LoggingModule Class</a></h4>
 <p>LoggingModule is the implementation class of the Axis2 module. Axis2
-modules should implement the "org.apache.axis2.modules.Module" interface with
+modules should implement the "<a href="">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(AxisConfiguration axisSystem) throws AxisFault;//End of module processing
 public void engageNotify(AxisDescription axisDescription) throws AxisFault;</pre>
 <p>These methods can be used to control the module initialization and the
-termination. With the input parameter AxisConfiguration user is provided with
+termination. With the input parameter AxisConfiguration, user is provided with
 the complete configuration hierarchy. This can be used to fine-tune the
-module behavior using the module writers. For the simple logging service we
+module behavior by the module writers. For the simple logging service we
 can keep these methods blank in our implementation class.</p>
 <h4><a name="Step2_:_LogHandler">Step2 : LogHandler</a></h4>
@@ -84,8 +84,8 @@
 <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" target="_blank"> Architecture Guide</a>
-for more information about phases). For the logging module we will write a
-handle with the following methods. "public void invoke(MessageContext ctx);"
+for more information about phases). To write a handler one should implement <a href="">org.apache.axis2.engine.Handler</a>.
But for convenience, <a href="">org.apache.axis2.handlers.AbstractHandler</a>
provides an abstract implementation of the Handler interface.
+For the logging module we will write a handler with the following methods. "public void invoke(MessageContext
 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>
@@ -98,10 +98,6 @@
     public void invoke(MessageContext msgContext) throws AxisFault {
-    }
-    public void revoke(MessageContext msgContext) {;

View raw message