axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject cvs commit: xml-axis/java/test/RPCDispatch
Date Mon, 26 Nov 2001 02:21:39 GMT
gdaniels    01/11/25 18:21:39

  Modified:    java/docs user-guide.html
  Removed:     java/src/org/apache/axis/registries
  Some user guide updates for WSDD.
  Remove unused code (registries, suppliers, resolvers, events) to trim
  down the jar and reduce clutter.
  Revision  Changes    Path
  1.22      +59 -22    xml-axis/java/docs/user-guide.html
  Index: user-guide.html
  RCS file: /home/cvs/xml-axis/java/docs/user-guide.html,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- user-guide.html	2001/11/19 21:17:15	1.21
  +++ user-guide.html	2001/11/26 02:21:38	1.22
  @@ -114,9 +114,27 @@
   <h2><a name="Architecture"></a>Axis Architecture - a Brief Primer</h2>
   <p>(Skip this section if you want to dive right in - in many cases using the basic

     features of Axis requires zero knowledge of these topics.)</p>
  -<p><i><font color="#ff0000">TBD - explanation of Axis architecture, Handlers,

  -  Chains, Services... How transports and global chains work, our deployment architecture,

  -  etc...</font></i> </p>
  +<p>Axis consists of several subsystems working together. In this section we'll 
  +  give you an overview of how the package works, but for more details please see 
  +  the Axis Architecture Guide, a separate document.</p>
  +<h3>Handlers and the Message Path in Axis</h3>
  +<p>Put simply, Axis is all about processing Messages. When the central Axis processing

  +  logic runs, the </p>
  +<p>There are two basic ways which Axis is invoked:</p>
  +  <li>As a <b>server</b>, a <b>Transport Listener</b> will
create a MessageContext 
  +    and invoke the Axis processing framework.</li>
  +  <li>As a <b>client</b>, application code (aided in most cases by the
  +    programming model of Axis) will generate a MessageContext and invoke the Axis 
  +    processing framework.</li>
  +<p>In either case, the Axis framework's job is simply to pass the resulting MessageContext

  +  through a configurable set of Handlers, each of which has an opportunity to 
  +  do whatever it is designed to do with the MessageContext.</p>
  +<h3>From XML to Objects and Back Again - Parsing and Encoding</h3>
  +<p>SOAP is an XML protocol, and as such...</p>
  +<h4>The Axis SAX Framework</h4>
  +<p>Central classes include DeserializationContext, </p>
   <h2><a name="ConsumingServices"></a>Consuming Web Services with Axis</h2>
   <h3>Basics - Getting Started</h3>
   <p>Let's take a look at an example Web Service client that will call the <b>echoString</b>

  @@ -360,14 +378,16 @@
     what happens.</P>
   <P>You can also use the AdminClient to get a listing of all the deployed 
   components in the server:</P><PRE>% java org.apache.axis.client.AdminClient
list<BR>&lt;big XML document returned here&gt;</PRE>
  -<P>In there you'll see services, handlers, transports...</P>
  +<P>In there you'll see services, handlers, transports, etc. Note that this listing

  +  is an exact copy of the server's &quot;server-config.wsdd&quot; file, which 
  +  we'll talk about in more detail a little later.</P>
   <H4>More deployment - Handlers and Chains</H4>
   <p>Now let's start to explore some of the more powerful features of the Axis engine.

     Let's say you want to track how many times your service has been called. We've 
     included a sample handler in the samples/log directory to do just this. To use 
     a handler class like this, you first need to deploy the Handler itself, and 
     then use the name that you give it in deploying a service. Here's a sample deploy.wsdd

  -  file: </p>
  +  file (this is example 4in samples/userguide): </p>
   <pre>&lt;deployment xmlns=&quot;;
  @@ -390,11 +410,11 @@
     class samples.log.LogHandler. We give this Handler an option to let it know 
     which file to write its messages into.</p>
   <p>Then we define a service, MyService, which is an RPC service just like we saw

  -  above in our first example. The difference is the "requestFlow" element inside 
  -  the &lt;service&gt; - this indicates a set of Handlers that should be invoked

  -  when the service is invoked, before the provider. By inserting a reference to 
  -  "track", we ensure that the message will be logged each time this service is 
  -  invoked.<br>
  +  above in our first example. The difference is the &lt;requestFlow&gt; element

  +  inside the &lt;service&gt; - this indicates a set of Handlers that should be

  +  invoked when the service is invoked, before the provider. By inserting a reference 
  +  to "track", we ensure that the message will be logged each time this service 
  +  is invoked.<br>
   <h4>Remote Administration</h4>
   <p>Note that by default, the Axis server is configured to only accept administration

  @@ -417,23 +437,22 @@
     arbitrary Java classes which follow the standard JavaBean pattern of get/set 
     accessors. All you need to do is tell Axis which Java classes map to which XML 
     Schema types. Configuring a bean mapping looks like this:</p>
  -<pre class="xml">&lt;beanMappings&gt;
  - &lt;ns:local xmlns:ns="someNamespace" classname=""/&gt;
  -<p>Inside the &lt;beanMappings&gt; element is an arbitrary number of other
  -  each of which maps a Java class (presumably a bean) to an XML QName. The QName 
  -  of the element itself is the XML QName, and the value of the classname attribute 
  -  is the Java class name. So in this case, we'd be mapping the "" 
  -  class to the XML QName [someNamespace]:[local].</p>
  +<pre class="xml">&lt;beanMapping qname=&quot;ns:local&quot; xmlns:ns="someNamespace"
  +             languageSpecificType=""/&gt;
  +<p>The &lt;beanMapping&gt; tag maps a Java class (presumably a bean) to an
  +  QName. You'll note that it has two important attributes, <b>qname</b> and
  +  So in this case, we'd be mapping the "" class to the XML QName 
  +  [someNamespace]:[local].</p>
   <p>Let's take a look at how this works in practice. Go look at the samples/userguide/example5/

     file. (we won't reproduce it here, it's pretty straightforward) The key thing 
     to notice is that the argument to the service method is an Order object. Since 
     Order is not a basic type which Axis understands by default, trying to run this 
     service without a type mapping will result in a fault (if you want to try this 
  -  for yourself, you can use the bad-deploy.xml file in the example4 directory). 
  +  for yourself, you can use the bad-deploy.wsdd file in the example5 directory). 
     But if we put a beanMapping into our deployment, all will be well. Here's how 
  -  to run this example (from the example4 directory):</p>
  -<pre class="example">% java org.apache.axis.client.AdminClient -llocal:// deploy.xml
  +  to run this example (from the example5 directory):</p>
  +<pre class="example">% java org.apache.axis.client.AdminClient -llocal:///AdminService
   &lt;Admin&gt;Done processing&lt;/Admin&gt;
   % java Client -llocal:// -n "Glen"
  @@ -458,7 +477,25 @@
   <p><i><font color="#ff0000">TBD - this section will be expanded in a
future version! 
     For now, take a look at the ArraySerializer, the BeanSerializer (both in org.apache.axis.encoding),

     and the DataSer example (in samples/encoding) to see how custom serializers 
  -  work. </font></i></p>
  +  work.</font></i></p>
  +<h4>Deploying custom mappings - the &lt;typeMapping&gt; tag</h4>
  +<p>Now that you've built your serializers and deserializers, you need to tell 
  +  Axis which types they should be used for. You do this with a typeMapping tag 
  +  in WSDD, which looks like this:</p>
  +<pre class="xml">&lt;typeMapping qname=&quot;ns:local&quot; xmlns:ns="someNamespace"
  +             languageSpecificType=""
  +             serializer=&quot;&quot;
  +             deserializer=&quot;&quot;/&gt;</pre>
  +<p>This looks a lot like the &lt;beanMapping&gt; tag we saw earlier, but
  +  are two extra attributes. One, <b>serializer</b>, is the Java class name
  +  the Serializer class which should be used to write the specified Java class 
  +  (i.e. into XML. The other, <b>deserializer</b>, is the class

  +  name of a Deserializer <i>factory</i> that generates Deserializers which
  +  be used to unmarshall XML into the correct Java class.</p>
  +<p>(the &lt;beanMapping&gt; tag is really just shorthand for a &lt;typeMapping&gt;

  +  tag with serializer=&quot;org.apache.axis.encoding.BeanSerializer&quot; and 
  +  deserializer=&quot;org.apache.axis.encoding.BeanSerializer$BeanSerFactory&quot;,

  +  but clearly it can save a lot of typing!)</p>
   <h2><a name="WSDL"></a>Using WSDL with Axis</h2>
   <p>The <a href="">Web Service Description Language</a>

     is a specification authored by IBM and Microsoft, and supported by many other 
  1.20      +0 -1      xml-axis/java/samples/transport/
  RCS file: /home/cvs/xml-axis/java/samples/transport/,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  ---	2001/11/15 19:48:42	1.19
  +++	2001/11/26 02:21:38	1.20
  @@ -6,7 +6,6 @@
   import org.apache.axis.client.Service;
   import org.apache.axis.client.Transport;
   import org.apache.axis.encoding.XMLType;
  -import org.apache.axis.suppliers.TransportSupplier;
   import org.apache.axis.utils.Options;
   /** Tests the simple File transport.  To run:
  1.56      +0 -2      xml-axis/java/src/org/apache/axis/
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  ---	2001/11/26 00:58:34	1.55
  +++	2001/11/26 02:21:38	1.56
  @@ -64,8 +64,6 @@
   import org.apache.axis.encoding.TypeMappingRegistry;
   import org.apache.axis.handlers.BasicHandler;
   import org.apache.axis.handlers.soap.SOAPService;
  -import org.apache.axis.registries.HandlerRegistry;
  -import org.apache.axis.registries.SupplierRegistry;
   import org.apache.axis.session.Session;
   import org.apache.axis.session.SimpleSession;
   import org.apache.axis.utils.JavaUtils;
  1.28      +0 -1      xml-axis/java/src/org/apache/axis/
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  ---	2001/11/06 14:09:07	1.27
  +++	2001/11/26 02:21:38	1.28
  @@ -56,7 +56,6 @@
   package org.apache.axis ;
   import org.apache.axis.handlers.BasicHandler;
  -import org.apache.axis.registries.HandlerRegistry;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.log4j.Category;
  1.65      +0 -1      xml-axis/java/src/org/apache/axis/
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  ---	2001/11/08 12:53:10	1.64
  +++	2001/11/26 02:21:38	1.65
  @@ -58,7 +58,6 @@
   import org.apache.axis.client.AxisClient;
   import org.apache.axis.encoding.TypeMappingRegistry;
   import org.apache.axis.handlers.soap.SOAPService;
  -import org.apache.axis.registries.HandlerRegistry;
   import org.apache.axis.session.Session;
   import org.apache.axis.utils.AxisClassLoader;
   import org.apache.log4j.Category;
  1.87      +0 -42     xml-axis/java/src/org/apache/axis/utils/
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  ---	2001/11/13 14:26:10	1.86
  +++	2001/11/26 02:21:38	1.87
  @@ -72,12 +72,7 @@
   import org.apache.axis.encoding.*;
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.handlers.BasicHandler;
  -import org.apache.axis.registries.HandlerRegistry;
  -import org.apache.axis.registries.SupplierRegistry;
   import org.apache.axis.server.AxisServer;
  -import org.apache.axis.suppliers.SimpleChainSupplier;
  -import org.apache.axis.suppliers.TargetedChainSupplier;
  -import org.apache.axis.suppliers.TransportSupplier;
   import org.apache.log4j.Category;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
  @@ -534,43 +529,6 @@
           } catch (IOException e) {
               return null;
  -    }
  -    /**
  -     * Return an XML Element containing the configuration info for one
  -     * of the engine's Handler registries.
  -     *
  -     * @param root the Element to work with (same as the one we return)
  -     * @param registry the registry to write into this Element
  -     * @return Element our config element, suitable for pumping back through
  -     *                 Admin processing later, to redeploy.
  -     */
  -    public static Element list(Element root, HandlerRegistry registry)
  -        throws AxisFault
  -    {
  -        Document doc = root.getOwnerDocument();
  -        Element    elem = null ;
  -        Hashtable  opts = null ;
  -        String[]   names ;
  -        Handler    h ;
  -        int        i ;
  -        names = registry.list();
  -        for( i = 0 ; names != null && i < names.length ; i++ ) {
  -            h = registry.find(names[i]);
  -            if (h == null)
  -                throw new AxisFault("Server", JavaUtils.getMessage("noHandler02", names[i]),
null, null);
  -            elem = h.getDeploymentData(doc);
  -            if ( elem == null ) continue ;
  -            elem.setAttribute( "name", names[i] );
  -            root.appendChild( doc.importNode(elem,true) );
  -        }
  -        return root;
  1.21      +0 -1      xml-axis/java/test/RPCDispatch/
  RCS file: /home/cvs/xml-axis/java/test/RPCDispatch/,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  ---	2001/11/20 18:56:06	1.20
  +++	2001/11/26 02:21:39	1.21
  @@ -12,7 +12,6 @@
   import org.apache.axis.message.RPCElement;
   import org.apache.axis.message.RPCParam;
   import org.apache.axis.message.SOAPEnvelope;
  -import org.apache.axis.registries.HandlerRegistry;
   import org.apache.axis.server.AxisServer;
   import org.xml.sax.SAXException;

View raw message