ws-axis-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r188794 - /webservices/axis/trunk/java/xdocs/userguide.html
Date Tue, 07 Jun 2005 15:14:52 GMT
Author: ajith
Date: Tue Jun  7 08:14:50 2005
New Revision: 188794

URL: http://svn.apache.org/viewcvs?rev=188794&view=rev
Log:
removed the erroneous picture

Modified:
    webservices/axis/trunk/java/xdocs/userguide.html

Modified: webservices/axis/trunk/java/xdocs/userguide.html
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/xdocs/userguide.html?rev=188794&r1=188793&r2=188794&view=diff
==============================================================================
--- webservices/axis/trunk/java/xdocs/userguide.html (original)
+++ webservices/axis/trunk/java/xdocs/userguide.html Tue Jun  7 08:14:50 2005
@@ -123,13 +123,13 @@
 properly. (See <a href="installationguide.htm">Installation Guide</a>)</p>
 <h3>MyService</h3>
 <p>First let's see how we can write a simple Web Service (MyService) and deploy it.
For this purpose we will create a Web Service with two operations as follows.</p>
-<source><pre>public void ping(OMElement element){} //IN-ONLY operation, just
accepts the OMElement and do some processing.
+<pre><code>public void ping(OMElement element){} //IN-ONLY operation, just accepts
the OMElement and do some processing.
 public OMElement echo(OMElement element){}//IN-OUT operation, accepts an OMElement and responds
with another OMElement after processing.</code></pre>
 <p>Complete code for this example Web Service (MyService) can be found in the &quot;Axis2Home/samples/userguide/src&quot;
directory under 
 &quot;userguide/example1&quot; package. As you can see, the two operations are very
simple and need no explanations on what they are doing. So let's see how we can write the
deployment descriptors for the service and deploy it.</p>
 <p>Axis2 uses &quot;service.xml&quot; to keep configurations for a Web Service.
Each Web Service deployed 
 in Axis2 needs a &quot;service.xml&quot; containing the configurations. &quot;service.xml&quot;
for MyService will be as follows; we will see what each parameter means later.</p>
-<source><pre>&lt;service name=&quot;MyService&quot;&gt;<br>
   &lt;description&gt;<br>        This is a sample Web Service with two operations,
echo and ping.<br>    &lt;/description&gt;<br>    &lt;parameter name=&quot;ServiceClass&quot;
locked=&quot;xsd:false&quot;&gt;userguide.example1.MyService&lt;/parameter&gt;<br>
   &lt;operation name=&quot;echo&quot;&gt;<br>        &lt;messageReceiver
class=&quot;org.apache.axis.receivers.RawXMLINOutMessageRecevier&quot;/&gt;<br>
   &lt;/operation&gt;<br>     &lt;operation name=&quot;ping&quot;&gt;<br>
       &lt;messageReceiver class=&quot;org.apache.axis.receivers.RawXMLINOnlyMessageRecevier&quot;/&gt;<br>
   &lt;/operation&gt;<br> &lt;/service&gt;</code></pre>
+<pre><code>&lt;service name=&quot;MyService&quot;&gt;<br>
   &lt;description&gt;<br>        This is a sample Web Service with two operations,
echo and ping.<br>    &lt;/description&gt;<br>    &lt;parameter name=&quot;ServiceClass&quot;
locked=&quot;xsd:false&quot;&gt;userguide.example1.MyService&lt;/parameter&gt;<br>
   &lt;operation name=&quot;echo&quot;&gt;<br>        &lt;messageReceiver
class=&quot;org.apache.axis.receivers.RawXMLINOutMessageRecevier&quot;/&gt;<br>
   &lt;/operation&gt;<br>     &lt;operation name=&quot;ping&quot;&gt;<br>
       &lt;messageReceiver class=&quot;org.apache.axis.receivers.RawXMLINOnlyMessageRecevier&quot;/&gt;<br>
   &lt;/operation&gt;<br> &lt;/service&gt;</code></pre>
 <p>As it can be seen, first line of the &quot;service.xml&quot; gives the name
of the Web Service. This is used in the URL to the service as the service name. Next comes
the description and the service class. The next two xml tags describe the operations that
are available in this service with respective message receivers. For the &quot;echo&quot;
operation we have used a <strong>RawXMLINOutMessageRecevier</strong> since it
is an 
 IN-OUT operation. For IN-ONLY operation, &quot;ping&quot; we have used <strong>RawXMLINOnlyMessageRecevier</strong>
as the message receiver. </p>
 <p>Axis2 use &quot;.aar&quot; (Axis Archive) file as the deployment package
for Web Services. So, 
@@ -224,7 +224,7 @@
 Services&nbsp; and let's see how to use them Now!</b></p>
 <h3>EchoBlockingClient</h3>
 <p>Axis2 provides the user with several invocation patterns for Web Services, ranging
from pure blocking single channel invocations to a non-blocking dual channel invocations.
First let's see how we can write a client to invoke &quot;echo&quot; operation of
&quot;MyService&quot; using the simplest good old blocking invocation. The client
code that you need to write will be as follows.</p>
-<source><pre>  try {
+<pre><code>  try {
             OMElement payload = ClientUtil.getEchoOMElement();
             <span class="style10">Call call = new Call();
             call.setTo(targetEPR);
@@ -248,11 +248,10 @@
 <p>The green lines shows the set of operations that you need to perform in-order to
invoke a web service while the rest is used to create the OMElement that needs to be sent
and to display the response OMElement. To test this 
 client you can use the provided ant build file that can be found in the 
 &quot;Axis2Home/samples&quot; directory. Run the &quot;testEchoBlockingClient&quot;
target . if you can see the response OMElement printed in your command line&nbsp;  then
you have successfully tested the client as well. </p>
-<p><img src="images/userguide/TestClient.jpg" width="951" height="132"></p>
 <h3>PingClient</h3>
 <p>In the Web Service &quot;MyService&quot; we had a IN-ONLY operation with
the name &quot;ping&quot; (see Web Services Using Axis2). So let's write a client
to invoke this operation as well. 
 The client code will be as follows.</p>
-<source><pre> try {
+<pre><code> try {
        OMElement payload = ClientUtil.getPingOMElement();
 
        MessageSender msgSender = new MessageSender();
@@ -275,10 +274,10 @@
 <p>In the EchoBlockingClient once the &quot;call.invokeBlocking("echo", payload);&quot;
is called, the client is blocked till the operation is completed. This behavior is not 
 desirable when there are many Web Service invocations to be done in a single client application.
A solution, would be to use a Non-Blocking API to invoke web services. Axis2 provides a callback
based non-blocking API for users. </p>
 <p>A sample client for this can be found under &quot;Axis2Home/samples/userguide/src/userguide/clients&quot;
with the name EchoNonBlockingClient. If we consider the changes that the user may have to
do with respect to the &quot;EchoBlockingClient&quot; that we have already seen, it
will be as follows.</p>
-<source><pre>call.invokeNonBlocking(&quot;echo&quot;, payload, callback);</code></pre>
+<pre><code>call.invokeNonBlocking(&quot;echo&quot;, payload, callback);</code></pre>
 <p>The invocation  accepts a callback object as a parameter. Axis2 client API provides
an 
 abstract Callback with the following methods.</p>
-<p><source><pre>public abstract void onComplete(AsyncResult result);
+<p><pre><code>public abstract void onComplete(AsyncResult result);
 public abstract void reportError(Exception e);
 public boolean isComplete() {}</code></pre></p>
 <p>The user is expected to implement the &quot;onComplete &quot; and &quot;reportError
&quot; methods of their extended call back class. Axis2 engine calls the onComplete method
once the Web Service 
@@ -303,7 +302,7 @@
 services (IN-OUT operations) using two separate transport connections. Let's see how we can
do it using an example. Following code 
 fragment shows how to invoke the same &quot;echo&quot; operation, using Non-Blocking
API with two transport 
 connections<strong>. The ultimate asynchrony!!</strong></p>
-<source><pre>  try {
+<pre><code>  try {
             OMElement payload = ClientUtil.getEchoOMElement();
 
             Call call = new Call();
@@ -342,7 +341,7 @@
             while (!callback.isComplete()) {
                 Thread.sleep(1000);
             }</code></pre>
-<source><pre>	  <font color="#33CC00">call.close();</font>
+<pre><code>	  <font color="#33CC00">call.close();</font>
 
         } catch (AxisFault axisFault) {
             axisFault.printStackTrace();
@@ -364,7 +363,7 @@
 phase (See <a href="Axis2ArchitectureGuide.html">Architecture Guide</a> for more

 details about phases)&nbsp; and hence &quot;engaging&quot; means simply adding
module reference in the &quot;server.xml&quot; (NOT the &quot;service.xml&quot;).
Please add the following line to the &quot;server.xml&quot; that you can find in the
&quot;/webapps/axis2/WEB-INF&quot; 
 directory in the servlet container. </p>
-<source><pre> &lt;module ref=&quot;addressing&quot;/&gt;</code></pre>
+<pre><code> &lt;module ref=&quot;addressing&quot;/&gt;</code></pre>
 <p>Note: Please note that<span class="style15"><font color="#000000"> once
you change the &quot;server.xml&quot; you need to restart the servlet container.</font></span></p>
 <p>This will enable the addressing in the server side and now you can test the &quot;TestEchoNonBlockingDualClient&quot;
using the &quot;testEchoNonBlockingDualClient&quot; 
 target of the ant file found at &quot;Axis2Home/samples&quot; directory. 
@@ -413,7 +412,7 @@
 <p>LoggingModule is the implementation class of the Axis2 module. Axis2 modules 
 should implement the &quot;org.apache.axis.modules.Module&quot; interface with the

 following methods.</p>
-<source><pre>public void init(AxisConfiguration axisSystem) throws AxisFault;//Initialize
the module
+<pre><code>public void init(AxisConfiguration axisSystem) throws AxisFault;//Initialize
the module
 public void shutdown(AxisConfiguration axisSystem) throws AxisFault;//End of module processing
 </code></pre>
 <p>These methods can be used to control the module initialization and the 
@@ -428,7 +427,7 @@
 invoke(MessageContext ctx);&quot; is the method that is called by the Axis2 engine 
 when the control is passed to the handler. &quot;public void revoke(MessageContext 
 ctx);&quot; is called when the handlers are revoked by the Axis2 engine. </p>
-<source><pre>public class LogHandler extends AbstractHandler implements Handler
{
+<pre><code>public class LogHandler extends AbstractHandler implements Handler
{
     private Log log = LogFactory.getLog(getClass());
     private QName name;
 
@@ -455,7 +454,7 @@
 it is the &quot;LoggingModule&quot; class and the various handlers that will run
in 
 different phases. &quot;module.xml&quot; for the logging module will be as follows.</p>
 <p>
-<source><pre>&lt;module name=&quot;logging&quot; class=&quot;userguide.loggingmodule.LoggingModule
&quot;&gt;
+<pre><code>&lt;module name=&quot;logging&quot; class=&quot;userguide.loggingmodule.LoggingModule
&quot;&gt;
 &lt;inflow&gt;
 	&lt;handler name=&quot;InFlowLogHandler&quot; class=&quot;userguide.loggingmodule.LogHandler&quot;&gt;
 	&lt;order phase=&quot;loggingPhase&quot; /&gt;
@@ -501,7 +500,7 @@
 can reuse the same handler in all these phases, however this may not be the same 
 for all the modules. &quot;&lt;order phase=&quot;loggingPhase&quot; /&gt;&quot;
describes the phase in 
 which this handler runs. </p>
-<source><pre>&lt;handler name=&quot;InFlowLogHandler&quot; class=&quot;userguide.loggingmodule.LogHandler&quot;&gt;
+<pre><code>&lt;handler name=&quot;InFlowLogHandler&quot; class=&quot;userguide.loggingmodule.LogHandler&quot;&gt;
 &lt;order phase=&quot;loggingPhase&quot; /&gt;
 &lt;/handler&gt;
 </code></pre></p>
@@ -518,7 +517,7 @@
 This is an extract of the phase section of the &quot;server.xml&quot;.</p>
 
 
-<source><pre>
+<pre><code>
 &lt;!-- ================================================= --&gt;
 &lt;!-- Phases --&gt;
 &lt;!-- ================================================= --&gt;
@@ -733,7 +732,8 @@
         &lt;parameter name="transport.mail.smtp.password" locked="xsd:false"&gt;password&lt;/parameter&gt;
         &lt;parameter name="transport.mail.smtp.port" locked="xsd:false"&gt;25&lt;/parameter&gt;
    &lt;/transportSender&gt;
-  </source></pre>
+  </pre>
+  </code>
   
   <h4>Transport Receiver</h4>
  
@@ -747,7 +747,7 @@
         &lt;parameter name="transport.mail.pop3.port" locked="xsd:false"&gt;110&lt;/parameter&gt;
         &lt;parameter name="transport.mail.replyToAddress" locked="xsd:false"&gt;email
address&lt;/parameter&gt;
   &lt;/transportReceiver&gt;
-  </source></pre>
+  </pre></code>
   
   <p>At the Client side if the Mail Listener is needed it is automatically started
by Axis2. If the Mail Listener is need to be started as the server it can be done with following
command with the all the axis2 jars and the mail dependency jars in the classpath.</p>
   
@@ -768,7 +768,8 @@
 Password:
 root
 Welcome root. HELP for a list of commands
-  </source></pre>
+  </pre>
+  </code>
 
   <p>add users to the James</p>
   <code>
@@ -777,7 +778,8 @@
 adduser axis2-client axis2
 User axis2-client added
 Connection closed by foreign host.
-  </source></pre>  
+  </pre>
+  </code>  
   
   <p>Now the James is up and running with the accounts</p>
   



Mime
View raw message