axis-java-dev mailing list archives

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

  Modified:    java/docs user-guide.html
               java/samples/transport FileTest.java
               java/src/org/apache/axis AxisEngine.java
                        FaultableHandler.java MessageContext.java
               java/src/org/apache/axis/utils Admin.java
               java/test/RPCDispatch TestSerializedRPC.java
  Removed:     java/src/org/apache/axis/registries HandlerRegistry.java
                        SimpleRegistry.java SupplierRegistry.java
               java/src/org/apache/axis/resolver/ejb EJBResolver.java
               java/src/org/apache/axis/resolver/java JavaResolver.java
               java/src/org/apache/axis/resolver/jws JWSResolver.java
               java/src/org/apache/axis/resolver/sd SDResolver.java
                        ServiceDescriptor.java
               java/src/org/apache/axis/resolver/sd/schema Fault.java
                        HandlerList.java Provider.java SDConstants.java
                        SDElement.java Service.java
               java/src/org/apache/axis/resolver/sd/schema/providers
                        EJBProvider.java JWSProvider.java JavaProvider.java
               java/src/org/apache/axis/suppliers FactorySupplier.java
                        SimpleChainSupplier.java SimpleSupplier.java
                        TargetedChainSupplier.java TransportSupplier.java
               java/src/org/apache/axis/utils/events Event.java
                        EventListener.java EventNotifier.java
               java/src/org/apache/axis/utils/events/debug Debug.java
  Log:
  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>
  +<ol>
  +  <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
client 
  +    programming model of Axis) will generate a MessageContext and invoke the Axis 
  +    processing framework.</li>
  +</ol>
  +<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;http://xml.apache.org/axis/wsdd/&quot;
               xmlns:java=&quot;http://xml.apache.org/axis/wsdd/providers/java&quot;&gt;
    
  @@ -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>
   </p>
   <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="my.java.thingy"/&gt;
  -&lt;/beanMappings&gt;</pre>
  -<p>Inside the &lt;beanMappings&gt; element is an arbitrary number of other
elements, 
  -  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 "my.java.thingy" 
  -  class to the XML QName [someNamespace]:[local].</p>
  +<pre class="xml">&lt;beanMapping qname=&quot;ns:local&quot; xmlns:ns="someNamespace"
  +             languageSpecificType="java:my.java.thingy"/&gt;
  +</pre>
  +<p>The &lt;beanMapping&gt; tag maps a Java class (presumably a bean) to an
XML 
  +  QName. You'll note that it has two important attributes, <b>qname</b> and
<b>languageSpecificType</b>. 
  +  So in this case, we'd be mapping the "my.java.thingy" 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/BeanService.java

     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
deploy.wsdd
   &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="java:my.java.thingy"
  +             serializer=&quot;&quot;
  +             deserializer=&quot;&quot;/&gt;</pre>
  +<p>This looks a lot like the &lt;beanMapping&gt; tag we saw earlier, but
there 
  +  are two extra attributes. One, <b>serializer</b>, is the Java class name
of 
  +  the Serializer class which should be used to write the specified Java class 
  +  (i.e. my.java.thingy) into XML. The other, <b>deserializer</b>, is the class

  +  name of a Deserializer <i>factory</i> that generates Deserializers which
can 
  +  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="http://www.w3.org/TR/wsdl">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/FileTest.java
  
  Index: FileTest.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/transport/FileTest.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- FileTest.java	2001/11/15 19:48:42	1.19
  +++ FileTest.java	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/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- AxisEngine.java	2001/11/26 00:58:34	1.55
  +++ AxisEngine.java	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/FaultableHandler.java
  
  Index: FaultableHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/FaultableHandler.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- FaultableHandler.java	2001/11/06 14:09:07	1.27
  +++ FaultableHandler.java	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/MessageContext.java
  
  Index: MessageContext.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/MessageContext.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- MessageContext.java	2001/11/08 12:53:10	1.64
  +++ MessageContext.java	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/Admin.java
  
  Index: Admin.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Admin.java,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- Admin.java	2001/11/13 14:26:10	1.86
  +++ Admin.java	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/TestSerializedRPC.java
  
  Index: TestSerializedRPC.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/RPCDispatch/TestSerializedRPC.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TestSerializedRPC.java	2001/11/20 18:56:06	1.20
  +++ TestSerializedRPC.java	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;
  
  
  

Mime
View raw message