Return-Path: Delivered-To: apmail-xml-axis-dev-archive@xml.apache.org Received: (qmail 15165 invoked by uid 500); 26 Nov 2001 02:37:52 -0000 Mailing-List: contact axis-dev-help@xml.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-dev@xml.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list axis-dev@xml.apache.org Received: (qmail 15156 invoked by uid 500); 26 Nov 2001 02:37:52 -0000 Delivered-To: apmail-xml-axis-cvs@apache.org Date: 26 Nov 2001 02:21:39 -0000 Message-ID: <20011126022139.54032.qmail@icarus.apache.org> From: gdaniels@apache.org To: xml-axis-cvs@apache.org Subject: cvs commit: xml-axis/java/test/RPCDispatch TestSerializedRPC.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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 @@

Axis Architecture - a Brief Primer

(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.)

-

TBD - explanation of Axis architecture, Handlers, - Chains, Services... How transports and global chains work, our deployment architecture, - etc...

+

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.

+

Handlers and the Message Path in Axis

+

Put simply, Axis is all about processing Messages. When the central Axis processing + logic runs, the

+

There are two basic ways which Axis is invoked:

+
    +
  1. As a server, a Transport Listener will create a MessageContext + and invoke the Axis processing framework.
  2. +
  3. As a client, application code (aided in most cases by the client + programming model of Axis) will generate a MessageContext and invoke the Axis + processing framework.
  4. +
+

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.

+

From XML to Objects and Back Again - Parsing and Encoding

+

SOAP is an XML protocol, and as such...

+

The Axis SAX Framework

+

Central classes include DeserializationContext,

Consuming Web Services with Axis

Basics - Getting Started

Let's take a look at an example Web Service client that will call the echoString @@ -360,14 +378,16 @@ what happens.

You can also use the AdminClient to get a listing of all the deployed components in the server:

% java org.apache.axis.client.AdminClient list
<big XML document returned here>
-

In there you'll see services, handlers, transports...

+

In there you'll see services, handlers, transports, etc. Note that this listing + is an exact copy of the server's "server-config.wsdd" file, which + we'll talk about in more detail a little later.

More deployment - Handlers and Chains

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:

+ file (this is example 4in samples/userguide):

<deployment xmlns="http://xml.apache.org/axis/wsdd/"
               xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
    
  @@ -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.

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 <service> - 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.
+ above in our first example. The difference is the <requestFlow> element + inside the <service> - 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.

Remote Administration

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:

-
<beanMappings>
  - <ns:local xmlns:ns="someNamespace" classname="my.java.thingy"/>
  -</beanMappings>
-

Inside the <beanMappings> 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].

+
<beanMapping qname="ns:local" xmlns:ns="someNamespace"
  +             languageSpecificType="java:my.java.thingy"/>
  +
+

The <beanMapping> tag maps a Java class (presumably a bean) to an XML + QName. You'll note that it has two important attributes, qname and languageSpecificType. + So in this case, we'd be mapping the "my.java.thingy" class to the XML QName + [someNamespace]:[local].

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):

-
% java org.apache.axis.client.AdminClient -llocal:// deploy.xml
  +  to run this example (from the example5 directory):

+
% java org.apache.axis.client.AdminClient -llocal:///AdminService deploy.wsdd
   <Admin>Done processing</Admin>
   
   % java Client -llocal:// -n "Glen"
  @@ -458,7 +477,25 @@
   

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.

+ work.

+

Deploying custom mappings - the <typeMapping> tag

+

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:

+
<typeMapping qname="ns:local" xmlns:ns="someNamespace"
  +             languageSpecificType="java:my.java.thingy"
  +             serializer=""
  +             deserializer=""/>
+

This looks a lot like the <beanMapping> tag we saw earlier, but there + are two extra attributes. One, serializer, 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, deserializer, is the class + name of a Deserializer factory that generates Deserializers which can + be used to unmarshall XML into the correct Java class.

+

(the <beanMapping> tag is really just shorthand for a <typeMapping> + tag with serializer="org.apache.axis.encoding.BeanSerializer" and + deserializer="org.apache.axis.encoding.BeanSerializer$BeanSerFactory", + but clearly it can save a lot of typing!)

Using WSDL with Axis

The Web Service Description Language 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;