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/wsdl Wsdl2javaTestSuite.xml
Date Mon, 05 Aug 2002 05:10:48 GMT
gdaniels    2002/08/04 22:10:48

  Modified:    java/src/org/apache/axis MessageContext.java
               java/src/org/apache/axis/deployment/wsdd WSDDService.java
               java/src/org/apache/axis/description ServiceDesc.java
               java/src/org/apache/axis/handlers JWSProcessor.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
               java/src/org/apache/axis/message RPCElement.java
               java/src/org/apache/axis/providers BSFProvider.java
                        BasicProvider.java ComProvider.java
                        JWSProvider.java
               java/src/org/apache/axis/providers/java JavaProvider.java
                        MsgProvider.java RPCProvider.java
               java/src/org/apache/axis/utils axisNLS.properties
               java/src/org/apache/axis/wsdl/fromJava Emitter.java
               java/test/RPCDispatch TestRPC.java
               java/test/encoding TestArrayListConversions.java
               java/test/wsdl Wsdl2javaTestSuite.xml
  Log:
  Start cleaning up a bunch of stuff that's been confusing for a while, and
  perhaps fixing the sporadic allowed methods problem while we're at it.
  
  The main change has to do with ServiceDescs and providers.  I expanded
  on the existing support for getting the correct class into a
  ServiceDesc by asking the provider to handle the whole initialization
  (i.e. synchronization) of a ServiceDesc.  This does two things.
  First, it should make sure that the allowedMethods are correctly
  set up for JavaProvider services, and so there should now NEVER be
  OperationDescs for non-allowed methods (allowed method processing
  is now centralized, instead of scattered).  Second, it allows for
  future providers that don't directly tie to Java backends (i.e.
  BSFProvider, etc) to have more control over the building of the
  OperationDescs.  This will come in handy later as we continue to
  clean this up / abstract it.
  
  ServiceDesc.getInitializedServiceDesc() no longer takes any arguments,
  since the TypeMapping and the implementation Class should have already
  been set up by the time this is called.
  
  The MsgProvider has also been seriously cleaned up.  See comments in
  MsgProvider.java - next I believe we should a) make the arguments for
  the multi-element method consistent (either Element[] or Vector,
  not both), b) remove the MessageContext version, replacing it with a
  version which takes + returns a Document, and c) add the ability
  to have a QName/operation map in the WSDD, instead of just a single
  operation.
  
  Allowed/disallowed methods are now dealt with by the serviceDesc
  directly in all cases.
  
  When we set the service on a MessageContext, we now call
  getInitializedServiceDesc() at that point.
  
  SOAPService no longer keeps its own TypeMappingRegistry.  Instead it
  uses the one from the ServiceDesc.
  
  Removed unneeded arguments from JavaUtils.processMessage().
  
  Was having problems building with latest CVS, so added compilation
  step for "step6" of import2/import3 tests to Wsdl2JavaTestSuite.xml
  
  Various bits of cleanup.
  
  NOTE : is checkMethodName() in RPCProvider appropriate anymore?
         There should be a better way to deal with this, I think
  
  Revision  Changes    Path
  1.113     +18 -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.112
  retrieving revision 1.113
  diff -u -r1.112 -r1.113
  --- MessageContext.java	2 Aug 2002 17:27:41 -0000	1.112
  +++ MessageContext.java	5 Aug 2002 05:10:47 -0000	1.113
  @@ -78,6 +78,7 @@
   import javax.xml.rpc.handler.soap.SOAPMessageContext;
   import java.io.File;
   import java.util.Hashtable;
  +import java.util.List;
   
   /**
    * Some more general docs will go here.
  @@ -231,7 +232,7 @@
           }
   
           if (serviceHandler != null) {
  -            ServiceDesc desc = serviceHandler.getInitializedServiceDesc(this);
  +            ServiceDesc desc = serviceHandler.getInitializedServiceDesc();
   
               if (desc != null) {
                   possibleOperations = desc.getOperationsByQName(qname);
  @@ -617,6 +618,22 @@
               // of deserialized messages according to the setting on the
               // new service.
               highFidelity = service.needsHighFidelityRecording();
  +
  +            ServiceDesc sd = null;
  +            try {
  +                sd = service.getInitializedServiceDesc();
  +            } catch (AxisFault axisFault) {
  +                // FIXME
  +            }
  +
  +            if (service.getStyle() == Style.MESSAGE) {
  +                // There should be only one operation
  +                List ops = sd.getOperations();
  +                if (ops.size() != 1) {
  +                    // ERROR
  +                }
  +                this.currentOperation = (OperationDesc)ops.get(0);
  +            }
           }
       }
   
  
  
  
  1.77      +10 -16    xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java
  
  Index: WSDDService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDService.java,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- WSDDService.java	17 Jul 2002 20:27:27 -0000	1.76
  +++ WSDDService.java	5 Aug 2002 05:10:47 -0000	1.77
  @@ -71,7 +71,6 @@
   import org.apache.axis.enum.Style;
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.providers.java.JavaProvider;
  -import org.apache.axis.utils.ClassUtils;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.XMLUtils;
   import org.w3c.dom.Element;
  @@ -84,7 +83,9 @@
   import java.util.Vector;
   
   /**
  + * A service represented in WSDD.
    *
  + * @author Glen Daniels (gdaniels@apache.org)
    */
   public class WSDDService
       extends WSDDTargetedChain
  @@ -202,10 +203,12 @@
               }
           }
   
  +        initTMR();
  +
           // call to validate standard descriptors for this service
           validateDescriptors();
       }
  -    
  +
       /**
        * This method can be used for dynamic deployment using new WSDDService()
        * etc.  It validates some standard parameters for some standard providers
  @@ -213,25 +216,17 @@
        */
       public void validateDescriptors()
       {
  -        String className = this.getParameter(JavaProvider.OPTION_CLASSNAME);
  -        if (className != null) {
  -            try {
  -                Class cls = ClassUtils.forName(className);
  -                desc.setImplClass(cls);
  -                initTMR();
  -                desc.setTypeMapping(getTypeMapping(desc.getStyle().getEncoding()));
  -            } catch (Exception ex) {
  -            }
  -        }
  +        desc.setTypeMappingRegistry(tmr);
  +        desc.setTypeMapping(getTypeMapping(desc.getStyle().getEncoding()));
   
           String allowedMethods = getParameter(JavaProvider.OPTION_ALLOWEDMETHODS);
  -        if (allowedMethods != null) {
  +        if (allowedMethods != null && !"*".equals(allowedMethods)) {
               ArrayList methodList = new ArrayList();
               StringTokenizer tokenizer = new StringTokenizer(allowedMethods, " ,");
               while (tokenizer.hasMoreTokens()) {
                   methodList.add(tokenizer.nextToken());
               }
  -            //desc.setAllowedMethods(methodList);
  +            desc.setAllowedMethods(methodList);
           }
       }
   
  @@ -405,7 +400,6 @@
           AxisEngine.normaliseOptions(service);
   
           initTMR();
  -        service.setTypeMappingRegistry(tmr);
           tmr.delegate(registry.getTypeMappingRegistry());
   
           WSDDFaultFlow [] faultFlows = getFaultFlows();
  @@ -584,7 +578,7 @@
               }
           }
       }
  -    
  +
       public TypeMapping getTypeMapping(String encodingStyle) {
           return (TypeMapping) tmr.getTypeMapping(encodingStyle);
       }
  
  
  
  1.45      +47 -1     xml-axis/java/src/org/apache/axis/description/ServiceDesc.java
  
  Index: ServiceDesc.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/description/ServiceDesc.java,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- ServiceDesc.java	2 Aug 2002 12:55:33 -0000	1.44
  +++ ServiceDesc.java	5 Aug 2002 05:10:47 -0000	1.45
  @@ -62,17 +62,22 @@
   import java.util.HashMap;
   import java.util.Iterator;
   import java.util.List;
  +import java.util.StringTokenizer;
   
   import javax.xml.namespace.QName;
   import javax.xml.rpc.holders.Holder;
   
   import org.apache.axis.encoding.TypeMapping;
  +import org.apache.axis.encoding.TypeMappingRegistry;
  +import org.apache.axis.encoding.TypeMappingRegistryImpl;
  +import org.apache.axis.encoding.DefaultTypeMappingImpl;
   import org.apache.axis.enum.Style;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.components.bytecode.ExtractorFactory;
   import org.apache.axis.wsdl.Skeleton;
   
   import org.apache.axis.components.logger.LogFactory;
  +import org.apache.axis.AxisServiceConfig;
   import org.apache.commons.logging.Log;
   
   
  @@ -152,7 +157,10 @@
       private ArrayList completedNames = new ArrayList();
   
       /** Our typemapping for resolving Java<->XML type issues */
  -    private TypeMapping tm = null;
  +    private TypeMapping tm = DefaultTypeMappingImpl.getSingleton();
  +
  +    private TypeMappingRegistry tmr = null;
  +
       private boolean haveAllSkeletonMethods = false;
       private boolean introspectionComplete = false;
   
  @@ -656,6 +664,33 @@
               return;
           }
   
  +        /** If the class knows what it should be exporting,
  +        * respect its wishes.
  +        */
  +        AxisServiceConfig axisConfig = null;
  +        try {
  +            Method method = implClass.getDeclaredMethod(
  +                    "getAxisServiceConfig", new Class [] {});
  +            if (method != null && Modifier.isStatic(method.getModifiers())) {
  +                axisConfig = (AxisServiceConfig)method.invoke(null, null);
  +            }
  +        } catch (Exception e) {
  +            // No problem, just continue without...
  +        }
  +
  +        if (axisConfig != null) {
  +            String allowedMethodsStr = axisConfig.getAllowedMethods();
  +            if (allowedMethodsStr != null && !"*".equals(allowedMethodsStr)) {
  +                ArrayList methodList = new ArrayList();
  +                StringTokenizer tokenizer =
  +                        new StringTokenizer(allowedMethodsStr, " ,");
  +                while (tokenizer.hasMoreTokens()) {
  +                    methodList.add(tokenizer.nextToken());
  +                }
  +                setAllowedMethods(methodList);
  +            }
  +        }
  +
           loadServiceDescByIntrospectionRecursive(implClass);
           introspectionComplete = true;
       }
  @@ -1022,5 +1057,16 @@
   
       public void setEndpointURL(String endpointURL) {
           this.endpointURL = endpointURL;
  +    }
  +
  +    public TypeMappingRegistry getTypeMappingRegistry() {
  +        if (tmr == null) {
  +            tmr = new TypeMappingRegistryImpl();
  +        }
  +        return tmr;
  +    }
  +
  +    public void setTypeMappingRegistry(TypeMappingRegistry tmr) {
  +        this.tmr = tmr;
       }
   }
  
  
  
  1.59      +6 -0      xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java
  
  Index: JWSProcessor.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/JWSProcessor.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- JWSProcessor.java	2 Aug 2002 17:27:42 -0000	1.58
  +++ JWSProcessor.java	5 Aug 2002 05:10:47 -0000	1.59
  @@ -58,6 +58,7 @@
   import org.apache.axis.AxisProperties;
   import org.apache.axis.Constants;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.encoding.TypeMappingRegistry;
   import org.apache.axis.description.ServiceDesc;
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.providers.java.RPCProvider;
  @@ -298,7 +299,12 @@
                   // Set up service description
                   ServiceDesc sd = rpc.getServiceDescription();
                   sd.setImplClass(ClassUtils.forName(clsName, true, cl));
  +
  +                TypeMappingRegistry tmr = msgContext.getAxisEngine().getTypeMappingRegistry();
  +                sd.setTypeMappingRegistry(tmr);
                   sd.setTypeMapping(msgContext.getTypeMapping());
  +
  +                rpc.getInitializedServiceDesc();
   
                   soapServices.put(clsName, rpc);
   
  
  
  
  1.75      +29 -45    xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java
  
  Index: SOAPService.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/soap/SOAPService.java,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- SOAPService.java	1 Aug 2002 18:35:41 -0000	1.74
  +++ SOAPService.java	5 Aug 2002 05:10:47 -0000	1.75
  @@ -61,31 +61,21 @@
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
   import org.apache.axis.SimpleTargetedChain;
  +import org.apache.axis.components.logger.LogFactory;
   import org.apache.axis.description.ServiceDesc;
   import org.apache.axis.encoding.TypeMappingRegistry;
  -import org.apache.axis.encoding.TypeMappingRegistryImpl;
  -import org.apache.axis.encoding.TypeMapping;
  -import org.apache.axis.encoding.DefaultTypeMappingImpl;
   import org.apache.axis.enum.Style;
  -import org.apache.axis.providers.java.JavaProvider;
  -import org.apache.axis.providers.BasicProvider;
   import org.apache.axis.handlers.BasicHandler;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeaderElement;
  -import org.apache.axis.utils.ClassUtils;
  +import org.apache.axis.providers.BasicProvider;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.utils.LockableHashtable;
   import org.apache.axis.utils.XMLUtils;
  -import org.apache.axis.utils.cache.ClassCache;
  -import org.apache.axis.utils.cache.JavaClass;
  -
  -import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  -
   import org.w3c.dom.Document;
   
   import javax.xml.namespace.QName;
  -
   import java.io.FileInputStream;
   import java.util.ArrayList;
   import java.util.Enumeration;
  @@ -113,10 +103,6 @@
        */
       private Vector validTransports = null;
   
  -    /** Service-specific type mappings
  -     */
  -    private TypeMappingRegistry tmr;
  -
       /**
        * Does this service require a high-fidelity SAX recording of messages?
        * (default is true)
  @@ -210,7 +196,7 @@
                                                             nextElement();
                           QName badQName = new QName(badHeader.getNamespaceURI(),
                                                      badHeader.getName());
  -                        SOAPHeaderElement newHeader = new 
  +                        SOAPHeaderElement newHeader = new
                               SOAPHeaderElement(Constants.URI_SOAP12_FAULT,
                                                 Constants.ELEM_MISUNDERSTOOD);
                           newHeader.addAttribute(null,
  @@ -233,7 +219,6 @@
       public SOAPService()
       {
           initHashtable(true);
  -        initTypeMappingRegistry();
   
           // For now, always assume we're the ultimate destination.
           // TODO : Handle SOAP 1.2 ultimateDestination actor as well
  @@ -250,37 +235,29 @@
           init(reqHandler, new SOAPRequestHandler(), pivHandler, null, respHandler);
       }
   
  -    private void initTypeMappingRegistry() {
  -        tmr = new TypeMappingRegistryImpl();
  -    }
  -    
       public TypeMappingRegistry getTypeMappingRegistry()
       {
  -        return tmr;
  +        return serviceDescription.getTypeMappingRegistry();
       }
  -    
  -    public void setTypeMappingRegistry(TypeMappingRegistry map)
  -    {
  -        tmr = map;
  -    }
  -    
  +
       /** Convenience constructor for wrapping SOAP semantics around
        * "service handlers" which actually do work.
        */
       public SOAPService(Handler serviceHandler)
       {
           init(null, new SOAPRequestHandler(), serviceHandler, null, null);
  -        initTypeMappingRegistry();
       }
  -    
  +
       /** Tell this service which engine it's deployed to.
        *
        */
       public void setEngine(AxisEngine engine)
       {
           this.engine = engine;
  -        if (engine != null)
  -            tmr.delegate(engine.getTypeMappingRegistry());
  +    }
  +
  +    public AxisEngine getEngine() {
  +        return engine;
       }
   
       public boolean availableFromTransport(String transportName)
  @@ -293,7 +270,7 @@
               }
               return false;
           }
  -        
  +
           return true;
       }
   
  @@ -311,18 +288,25 @@
   
       /**
        * Returns a service description with the implementation class filled in.
  -     * 
  +     *
        * Syncronized to prevent simutaneous modification of serviceDescription.
  -     */ 
  -    public synchronized ServiceDesc getInitializedServiceDesc(MessageContext msgContext) throws AxisFault {
  +     */
  +    public synchronized ServiceDesc getInitializedServiceDesc()
  +            throws AxisFault {
  +
           if (serviceDescription.getImplClass() == null) {
  -            // Fill in the service class from the provider
  +
  +            // Let the provider do the work of filling in the service
  +            // descriptor.  This is so that it can decide itself how best
  +            // to map the Operations.  In the future, we may want to support
  +            // providers which don't strictly map to Java class backends
  +            // (BSFProvider, etc.), and as such we hand off here.
               if (pivotHandler instanceof BasicProvider) {
  -                serviceDescription = 
  -                     ((BasicProvider)pivotHandler).getServiceDesc(msgContext, serviceDescription);
  +                ((BasicProvider)pivotHandler).initServiceDesc(this);
               }
  +
           }
  -        
  +
           return serviceDescription;
       }
   
  @@ -372,19 +356,19 @@
        *
        *********************************************************************
        */
  -    
  +
       /** Placeholder for "enable this service" method
        */
       public void start()
       {
       }
  -    
  +
       /** Placeholder for "disable this service" method
        */
       public void stop()
       {
       }
  -    
  +
       /**
        * Make this service available on a particular transport
        */
  @@ -399,7 +383,7 @@
               validTransports = new Vector();
           validTransports.addElement(transportName);
       }
  -    
  +
       /**
        * Disable access to this service from a particular transport
        */
  
  
  
  1.68      +1 -7      xml-axis/java/src/org/apache/axis/message/RPCElement.java
  
  Index: RPCElement.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCElement.java,v
  retrieving revision 1.67
  retrieving revision 1.68
  diff -u -r1.67 -r1.68
  --- RPCElement.java	26 Jul 2002 14:57:48 -0000	1.67
  +++ RPCElement.java	5 Aug 2002 05:10:47 -0000	1.68
  @@ -61,7 +61,6 @@
   import org.apache.axis.MessageContext;
   import org.apache.axis.description.OperationDesc;
   import org.apache.axis.description.ServiceDesc;
  -import org.apache.axis.description.ParameterDesc;
   import org.apache.axis.encoding.DeserializationContext;
   import org.apache.axis.encoding.SerializationContext;
   import org.apache.axis.enum.Style;
  @@ -74,9 +73,6 @@
   import javax.xml.namespace.QName;
   
   import java.util.Vector;
  -import java.util.ArrayList;
  -import java.lang.reflect.Array;
  -import java.util.Collection;
   
   public class RPCElement extends SOAPBodyElement
   {
  @@ -94,8 +90,6 @@
       {
           super(namespace, localName, prefix, attributes, context);
   
  -//        recorder = new SAX2EventRecorder();
  -
           encodingStyle = Constants.URI_DEFAULT_SOAP_ENC;
   
           // This came from parsing XML, so we need to deserialize it sometime
  @@ -107,7 +101,7 @@
           if (operations == null) {
               SOAPService service    = msgContext.getService();
               if (service != null) {
  -                ServiceDesc serviceDesc = service.getInitializedServiceDesc(msgContext);
  +                ServiceDesc serviceDesc = service.getInitializedServiceDesc();
                   
                   String lc = Utils.xmlNameToJava(name);
                   if (serviceDesc == null) {
  
  
  
  1.5       +2 -2      xml-axis/java/src/org/apache/axis/providers/BSFProvider.java
  
  Index: BSFProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/BSFProvider.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BSFProvider.java	1 Aug 2002 18:35:42 -0000	1.4
  +++ BSFProvider.java	5 Aug 2002 05:10:47 -0000	1.5
  @@ -57,6 +57,7 @@
   
   import org.apache.axis.MessageContext;
   import org.apache.axis.AxisFault;
  +import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.description.ServiceDesc;
   
   public class BSFProvider extends BasicProvider {
  @@ -69,8 +70,7 @@
           System.out.println(getOption("Script"));
       }
   
  -    public ServiceDesc getServiceDesc(MessageContext msgContext, ServiceDesc serviceDesc)
  +    public void initServiceDesc(SOAPService service)
               throws AxisFault {
  -        return serviceDesc;
       }
   }
  
  
  
  1.11      +2 -3      xml-axis/java/src/org/apache/axis/providers/BasicProvider.java
  
  Index: BasicProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/BasicProvider.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- BasicProvider.java	1 Aug 2002 18:35:42 -0000	1.10
  +++ BasicProvider.java	5 Aug 2002 05:10:47 -0000	1.11
  @@ -56,9 +56,8 @@
   package org.apache.axis.providers;
   
   import org.apache.axis.handlers.BasicHandler;
  -import org.apache.axis.MessageContext;
  +import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.description.ServiceDesc;
   
   import javax.xml.namespace.QName;
   
  @@ -75,7 +74,7 @@
        * This method returns a ServiceDesc that contains the correct 
        * implimentation class. 
        */ 
  -    public abstract ServiceDesc getServiceDesc(MessageContext msgContext, ServiceDesc serviceDesc) 
  +    public abstract void initServiceDesc(SOAPService service)
               throws AxisFault;
       
       public void addOperation(String name, QName qname) {
  
  
  
  1.5       +2 -3      xml-axis/java/src/org/apache/axis/providers/ComProvider.java
  
  Index: ComProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/ComProvider.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ComProvider.java	1 Aug 2002 18:35:42 -0000	1.4
  +++ ComProvider.java	5 Aug 2002 05:10:47 -0000	1.5
  @@ -57,7 +57,7 @@
   
   import org.apache.axis.MessageContext;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.description.ServiceDesc;
  +import org.apache.axis.handlers.soap.SOAPService;
   
   public class ComProvider extends BasicProvider {
       
  @@ -68,8 +68,7 @@
       public void invoke(MessageContext msgContext) {
       }
   
  -    public ServiceDesc getServiceDesc(MessageContext msgContext, ServiceDesc serviceDesc)
  +    public void initServiceDesc(SOAPService service)
               throws AxisFault {
  -        return serviceDesc;
       }
   }
  
  
  
  1.5       +3 -4      xml-axis/java/src/org/apache/axis/providers/JWSProvider.java
  
  Index: JWSProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/JWSProvider.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- JWSProvider.java	1 Aug 2002 18:35:42 -0000	1.4
  +++ JWSProvider.java	5 Aug 2002 05:10:47 -0000	1.5
  @@ -55,17 +55,16 @@
   
   package org.apache.axis.providers;
   
  -import org.apache.axis.MessageContext;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.description.ServiceDesc;
  +import org.apache.axis.MessageContext;
  +import org.apache.axis.handlers.soap.SOAPService;
   
   public class JWSProvider extends BasicProvider {
       
       public void invoke(MessageContext msgContext) {
       }
   
  -    public ServiceDesc getServiceDesc(MessageContext msgContext, ServiceDesc serviceDesc)
  +    public void initServiceDesc(SOAPService service)
               throws AxisFault {
  -        return serviceDesc;
       }
   }
  
  
  
  1.71      +28 -133   xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java
  
  Index: JavaProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/JavaProvider.java,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- JavaProvider.java	2 Aug 2002 20:46:55 -0000	1.70
  +++ JavaProvider.java	5 Aug 2002 05:10:47 -0000	1.71
  @@ -57,7 +57,6 @@
   
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
  -import org.apache.axis.AxisServiceConfig;
   import org.apache.axis.Handler;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  @@ -69,7 +68,6 @@
   import org.apache.axis.utils.cache.ClassCache;
   import org.apache.axis.wsdl.fromJava.Emitter;
   import org.apache.axis.encoding.TypeMapping;
  -import org.apache.axis.encoding.DefaultTypeMappingImpl;
   import org.apache.axis.enum.Style;
   import org.apache.axis.enum.Scope;
   import org.apache.axis.Constants;
  @@ -83,10 +81,9 @@
   
   import javax.xml.rpc.server.ServiceLifecycle;
   import javax.xml.rpc.holders.IntHolder;
  -import java.lang.reflect.Method;
  -import java.lang.reflect.Modifier;
  -import java.lang.reflect.InvocationTargetException;
   import java.net.URL;
  +import java.util.ArrayList;
  +import java.util.StringTokenizer;
   
   /**
    * Base class for Java dispatching.  Fetches various fields out of envelope,
  @@ -212,19 +209,13 @@
        * Process the current message.  Side-effect resEnv to create return value.
        *
        * @param msgContext self-explanatory
  -     * @param serviceName the class name of the ServiceHandler
  -     * @param allowedMethods the 'method name' of ditto
        * @param reqEnv the request envelope
        * @param resEnv the response envelope
  -     * @param jc the JavaClass of the service object
        * @param obj the service object itself
        */
       public abstract void processMessage (MessageContext msgContext,
  -                                         String serviceName,
  -                                         String allowedMethods,
                                            SOAPEnvelope reqEnv,
                                            SOAPEnvelope resEnv,
  -                                         JavaClass jc,
                                            Object obj)
           throws Exception;
   
  @@ -246,7 +237,6 @@
           /* Now get the service (RPC) specific info  */
           /********************************************/
           String  clsName    = getServiceClassName(service);
  -        String  allowedMethods = getAllowedMethods(service);
   
           if ((clsName == null) || clsName.equals("")) {
               throw new AxisFault("Server.NoClassForService",
  @@ -254,23 +244,12 @@
                   null, null);
           }
   
  -        if ((allowedMethods == null) || allowedMethods.equals("")) {
  -            throw new AxisFault("Server.NoMethodConfig",
  -                JavaUtils.getMessage("noOption00",
  -                                     OPTION_ALLOWEDMETHODS, serviceName),
  -                null, null);
  -        }
  -
  -        if (allowedMethods.equals("*"))
  -            allowedMethods = null;
  -
           try {
               IntHolder scope   = new IntHolder();
               Object obj        = getServiceObject(msgContext,
                                                    service,
                                                    clsName,
                                                    scope);
  -            JavaClass jc	  = JavaClass.find(obj.getClass());
   
               Message        reqMsg  = msgContext.getRequestMessage();
               SOAPEnvelope   reqEnv  = (SOAPEnvelope)reqMsg.getSOAPEnvelope();
  @@ -286,17 +265,9 @@
                   msgContext.setResponseMessage( resMsg );
               }
   
  -            /** If the class knows what it should be exporting,
  -            * respect its wishes.
  -            */
  -            AxisServiceConfig axisConfig = getConfiguration(obj);
  -            if (axisConfig != null) {
  -                allowedMethods = axisConfig.getAllowedMethods();
  -            }
  -
               try {
  -                processMessage(msgContext, clsName, allowedMethods, reqEnv,
  -                               resEnv, jc, obj);
  +                processMessage(msgContext, reqEnv,
  +                               resEnv, obj);
               } catch (Exception exp) {
                   throw exp;
               } finally {
  @@ -329,27 +300,8 @@
   
           /* Find the service we're invoking so we can grab it's options */
           /***************************************************************/
  -        String serviceName = msgContext.getTargetService();
           SOAPService service = msgContext.getService();
  -        ServiceDesc serviceDesc = service.getInitializedServiceDesc(msgContext);
  -
  -        /* Now get the service (RPC) specific info  */
  -        /********************************************/
  -        String  allowedMethods = getAllowedMethods(service);
  -
  -        /** ??? Should we enforce setting methodName?  As it was,
  -         * if it's null, we allowed any method.  This seems like it might
  -         * be considered somewhat insecure (it's an easy mistake to
  -         * make).  Tossing an Exception if it's not set, and using "*"
  -         * to explicitly indicate "any method" is probably better.
  -         */
  -        if ((allowedMethods == null) || allowedMethods.equals(""))
  -          throw new AxisFault("Server.NoMethodConfig",
  -            JavaUtils.getMessage("noOption00", getServiceClassNameOptionName(), serviceName),
  -            null, null);
  -
  -        if (allowedMethods.equals("*"))
  -          allowedMethods = null;
  +        ServiceDesc serviceDesc = service.getInitializedServiceDesc();
   
           try {
               String url = msgContext.getStrProp(MessageContext.TRANS_URL);
  @@ -383,16 +335,6 @@
                   }
               }
   
  -
  -            Class cls = getServiceClass(msgContext, getServiceClassName(service));
  -
  -            // If the class knows what it should be exporting, respect it's
  -            // wishes.
  -            AxisServiceConfig axisConfig = getConfiguration(cls);
  -            if (axisConfig != null) {
  -                allowedMethods = axisConfig.getAllowedMethods();
  -            }
  -
               Emitter emitter = new Emitter();
   
               // service alias may be provided if exact naming is required,
  @@ -404,8 +346,7 @@
                                ? Emitter.MODE_RPC
                                : Emitter.MODE_DOCUMENT);
   
  -            emitter.setClsSmart(cls,url);
  -            emitter.setAllowedMethods(allowedMethods);
  +            emitter.setClsSmart(serviceDesc.getImplClass(),url);
   
               // If a wsdl target namespace was provided, use the targetNamespace.
               // Otherwise use the interfaceNamespace constructed above.
  @@ -505,20 +446,15 @@
       /**
        * Returns the Class info about the service class.
        */
  -    protected Class getServiceClass(MessageContext msgContext, String clsName)
  +    protected Class getServiceClass(String clsName, AxisEngine engine)
               throws AxisFault {
  -        AxisEngine engine = null;
           ClassLoader cl = null;
           Class serviceClass = null;
           
           // If we have a message context, use that to get classloader and engine
           // otherwise get the current threads classloader
  -        if (msgContext == null) {
  -            cl = Thread.currentThread().getContextClassLoader();
  -        } else {
  -            cl = msgContext.getClassLoader();
  -            engine = msgContext.getAxisEngine();
  -        }
  +        cl = Thread.currentThread().getContextClassLoader();
  +
           // If we have an engine, use its class cache
           if (engine != null) {
               ClassCache cache     = engine.getClassCache();
  @@ -542,79 +478,38 @@
       }
   
       /**
  -     * For a given object or class, if there is a static method called
  -     * "getAxisServiceConfig()", we call it and return the value as an
  -     * AxisServiceConfig object.  This allows us to obtain metadata about
  -     * a class' configuration without instantiating an object of that class.
  -     *
  -     * @param obj an object, which may be a Class
  -     */
  -    public AxisServiceConfig getConfiguration(Object obj)
  -    {
  -        Class cls;
  -        if (obj instanceof Class) {
  -            cls = (Class)obj;
  -        } else {
  -            cls = obj.getClass();
  -        }
  -
  -        try {
  -            Method method =
  -                    cls.getDeclaredMethod("getAxisServiceConfig", new Class [] {});
  -            if (method != null && Modifier.isStatic(method.getModifiers())) {
  -                return (AxisServiceConfig)method.invoke(null, null);
  -            }
  -        } catch (NoSuchMethodException e) {
  -        } catch (SecurityException e) {
  -        } catch (IllegalAccessException e) {
  -        } catch (IllegalArgumentException e) {
  -        } catch (InvocationTargetException e) {
  -        }
  -
  -        return null;
  -    }
  -
  -    /**
        * Fill in a service description with the correct impl class
        * and typemapping set.  This uses methods that can be overridden by
        * other providers (like the EJBProvider) to get the class from the
        * right place.
  -     * 
  -     * @param msgContext message context
  -     * @param serviceDescription service description to be updated
  -     * @return updated service description
  -     */ 
  -    public ServiceDesc getServiceDesc(MessageContext msgContext, ServiceDesc serviceDescription) 
  +     */
  +    public void initServiceDesc(SOAPService service)
               throws AxisFault 
       {
  -        // Set up the Implimentation class for the service
  +        // Set up the Implementation class for the service
  +
  +        String clsName = getServiceClassName(service);
  +        ServiceDesc serviceDescription = service.getServiceDescription();
   
  -        String clsName = null;
  -        if (msgContext != null) {
  -            SOAPService service = msgContext.getService();
  -            clsName = getServiceClassName(service);
  -        } else {
  -            // no service, try the local options
  -            clsName = (String) getOption(getServiceClassNameOptionName());
  -        }
  -        
           if (clsName != null) {
  -            Class cls = getServiceClass(msgContext, clsName);
  +            Class cls = getServiceClass(clsName, service.getEngine());
               serviceDescription.setImplClass(cls);
           }
           
  -        // Set up the type mapping for the service
  -        TypeMapping tm;
  -        if (msgContext == null) {
  -            tm = DefaultTypeMappingImpl.getSingleton();
  -        } else {
  -            tm = msgContext.getTypeMapping();
  +        // And the allowed methods, if necessary
  +        if (serviceDescription.getAllowedMethods() == null && service != null) {
  +            String allowedMethods = getAllowedMethods(service);
  +            if (allowedMethods != null && !"*".equals(allowedMethods)) {
  +                ArrayList methodList = new ArrayList();
  +                StringTokenizer tokenizer = new StringTokenizer(allowedMethods, " ,");
  +                while (tokenizer.hasMoreTokens()) {
  +                    methodList.add(tokenizer.nextToken());
  +                }
  +                serviceDescription.setAllowedMethods(methodList);
  +            }
           }
  -        serviceDescription.setTypeMapping(tm);
   
  -        // return the updated ServiceDesc
  -        return serviceDescription;
  +        serviceDescription.loadServiceDescByIntrospection();
       }
  -    
       
   }
  
  
  
  1.27      +85 -99    xml-axis/java/src/org/apache/axis/providers/java/MsgProvider.java
  
  Index: MsgProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/MsgProvider.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- MsgProvider.java	20 Jun 2002 16:48:19 -0000	1.26
  +++ MsgProvider.java	5 Aug 2002 05:10:47 -0000	1.27
  @@ -57,11 +57,11 @@
   
   import org.apache.axis.Handler;
   import org.apache.axis.MessageContext;
  +import org.apache.axis.AxisFault;
  +import org.apache.axis.utils.JavaUtils;
  +import org.apache.axis.description.OperationDesc;
   import org.apache.axis.message.SOAPBodyElement;
   import org.apache.axis.message.SOAPEnvelope;
  -import org.apache.axis.utils.ClassUtils;
  -import org.apache.axis.utils.JavaUtils;
  -import org.apache.axis.utils.cache.JavaClass;
   import org.w3c.dom.Document;
   import org.w3c.dom.Element;
   
  @@ -69,50 +69,84 @@
   import java.util.Vector;
   
   /**
  + * Deal with message-style Java services.  For now, these are services
  + * with exactly ONE OperationDesc, pointing to a method which looks like
  + * one of the following:
  + *
  + * public Element [] method(Vector v);
  + * (NOTE : This is silly, we should change it to either be Vector/Vector
  + * or Element[]/Element[])
  + *
  + * public Document method(Document doc);
  + *
  + * public void method(MessageContext mc);
    *
    * @author Doug Davis (dug@us.ibm.com)
  + * @author Glen Daniels (gdaniels@apache.org)
    */
   public class MsgProvider extends JavaProvider {
       /**
  -     * This is pretty much a pass-thru to the util.Admin tool.  This will just
  -     * take the Request xml file and call the Admin processing.
  +     * Process the message.  This means figuring out what our actual
  +     * backend method takes (we could cache this somehow) and doing the
  +     * invocation.  Note that we don't catch exceptions here, preferring to
  +     * bubble them right up through to someone who'll catch it above us.
  +     *
  +     * @param msgContext the active MessageContext
  +     * @param reqEnv the request SOAPEnvelope
  +     * @param resEnv the response SOAPEnvelope (we should fill this in)
  +     * @param obj the service target object
  +     * @throws Exception
        */
       public void processMessage (MessageContext msgContext,
  -                                String serviceName,
  -                                String methodName,
                                   SOAPEnvelope reqEnv,
                                   SOAPEnvelope resEnv,
  -                                JavaClass jc,
                                   Object obj)
           throws Exception
       {
           Handler targetService = msgContext.getService();
  -        
  +        OperationDesc operation = msgContext.getOperation();
  +        Method method = operation.getMethod();
  +
           // is this service a body-only service?
  -        // if true (the default), the servic3e expects two args,
  -        // a MessageContext and a Document which is the contents of the first body element.
  +        // if true, we expect to pass a Vector of body Elements (as DOM) and
  +        //   get back an array of DOM Elements for the return body, OR
  +        //   to pass a Document and get back a Document.
  +        //
           // if false, the service expects just one MessageContext argument,
  -        // and looks at the entire request envelope in the MessageContext
  -        // (hence it's a "FullMessageService").
  +        //   and looks at the entire request envelope in the MessageContext
  +        //   (hence it's a "FullMessageService").
  +        //
  +        // Q (Glen) : Why would you ever do the latter instead of just defining
  +        //            a Handler provider yourself?  I think we should change
  +        //            this to simply pass the whole SOAP envelope as a Document
  +        //            and get back a Document.  Or even SOAPEnvelope/
  +        //            SOAPEnvelope...
           boolean bodyOnlyService = true;
           if (targetService.getOption("FullMessageService") != null) {
               bodyOnlyService = false;
           }
  -        
  -        Class[]         argClasses;
  -        Object[]        argObjects;
  -        ClassLoader     clsLoader = msgContext.getClassLoader();
  -        
  -        // the document which is the contents of the first body element
  -        // (generated only if we are not an envelope service)
  -        Method   method = null ;
  +
  +        // Collect the types so we know what we're dealing with in the target
  +        // method.
  +        Class [] params = method.getParameterTypes();
  +
  +        if (params.length != 1) {
  +            // Must have exactly one argument in all cases.
  +            throw new AxisFault(
  +                    JavaUtils.getMessage("msgMethodMustHaveOneParam",
  +                                         method.getName(),
  +                                         ""+params.length));
  +
  +        }
  +
  +        Object argObjects[] = new Object [params.length];
  +
           Document doc = null ;
           
           if (bodyOnlyService) {
  -            // dig out just the body, and pass it with the MessageContext
  +            // dig out just the body, and pass it on
               Vector                bodies  = reqEnv.getBodyElements();
               SOAPBodyElement       reqBody = reqEnv.getFirstBody();
  -            NoSuchMethodException exp2 = null ;
   
               doc = reqBody.getAsDOM().getOwnerDocument();
   
  @@ -121,92 +155,44 @@
                   newBodies.add( ((SOAPBodyElement)bodies.get(i)).getAsDOM() );
               bodies = newBodies ;
   
  -            /* If no methodName was specified during deployment then get it */
  -            /* from the root of the Body element                            */
  -            /* Hmmm, should we do this????                                  */
  -            /****************************************************************/
  -            if ( methodName == null || methodName.equals("") ) {
  -                Element root = doc.getDocumentElement();
  -                if ( root != null ) methodName = root.getLocalName();
  -            }
  -
  -            // Try the "right" one first, if this fails then default back
  -            // to the old ones - those should be removed eventually.
  -            /////////////////////////////////////////////////////////////////
  -            argClasses = new Class[1];
  -            argObjects = new Object[1];
  -            argClasses[0] = ClassUtils.forName("java.util.Vector", true, clsLoader);
  -            argObjects[0] = bodies ;
  -
  -            try {
  -                method = jc.getJavaClass().getMethod( methodName, argClasses );
  -                Element[] result = (Element[]) method.invoke( obj, argObjects );        
  +            // We know we have one param.  OK, is it a Vector?
  +            if (params[0] == Vector.class) {
  +                // Yes, invoke away!
  +                argObjects[0] = bodies ;
  +                Element[] result = (Element[]) method.invoke( obj, argObjects );
                   if ( result != null ) {
                       for ( int i = 0 ; i < result.length ; i++ )
                           resEnv.addBodyElement( new SOAPBodyElement(result[i]));
                   }
                   return ;
  -            } catch( NoSuchMethodException exp ) {
  -                exp2 = exp;
  -            }
  -
  -            if ( method == null ) {
  -              // Try the the simplest case first - just Document as the param 
  -              /////////////////////////////////////////////////////////////////
  -                argClasses = new Class[1];
  -                argObjects = new Object[1];
  -                argClasses[0] = ClassUtils.forName("org.w3c.dom.Document", true, clsLoader);
  -                argObjects[0] = doc ;
  -
  -                try {
  -                    method = jc.getJavaClass().getMethod( methodName, argClasses );
  -                } catch( NoSuchMethodException exp ) {
  -                    exp2 = exp;
  +            } else if (params[0] == Document.class) {
  +                // Not a Vector, but a Document!  Invoke away!
  +                argObjects[0] = doc;
  +
  +                // !!! WANT TO MAKE THIS SAX-CAPABLE AS WELL?
  +                Document retDoc = (Document) method.invoke( obj, argObjects );
  +                if ( retDoc != null ) {
  +                    SOAPBodyElement el = new SOAPBodyElement(retDoc.getDocumentElement());
  +                    resEnv.addBodyElement(el);
                   }
  -            }
  -
  -            if ( method == null ) {
  -                String oldmsg = exp2.getMessage(); 
  -                oldmsg = oldmsg == null ? "" : oldmsg;
  -                String msg = oldmsg + JavaUtils.getMessage("triedClass00",
  -                        jc.getJavaClass().getName(), methodName);
  -                throw new NoSuchMethodException(msg);
  +            } else {
  +                // Neither - must be a bad method.
  +                throw new AxisFault(
  +                        JavaUtils.getMessage("badMsgMethodParam",
  +                                             method.getName(),
  +                                             params[0].getName()));
               }
           } else {
               // pass *just* the MessageContext (maybe don't even parse!!!)
  -            argClasses = new Class[1];
  -            argObjects = new Object[1];
  -            argClasses[0] = ClassUtils.forName("org.apache.axis.MessageContext", true, clsLoader);
  -            argObjects[0] = msgContext ;
  -            try {
  -                method = jc.getJavaClass().getMethod( methodName, argClasses );
  -            }    
  -            catch( NoSuchMethodException exp2 ) {
  -                // No match - just throw an error
  -                //
  -                // We do not log the error here, this is
  -                // treated as a catch-rethrow as:
  -                // 1) it's clear where the exception is generated (try-block above)
  -                // 2) we are adding detail to the exception's message.
  -                ////////////////////////////////////////////
  -
  -                String oldmsg = exp2.getMessage(); 
  -                oldmsg = oldmsg == null ? "" : oldmsg;
  -                String msg = oldmsg + JavaUtils.getMessage("triedClass00",
  -                        jc.getJavaClass().getName(), methodName);
  -                throw new NoSuchMethodException(msg);
  +            if (params[0] != MessageContext.class) {
  +                throw new AxisFault(
  +                        JavaUtils.getMessage("needMessageContextArg",
  +                                             method.getName(),
  +                                             params[0].getName()));
               }
  -        }
  -        
  -        
  -        // !!! WANT TO MAKE THIS SAX-CAPABLE AS WELL.  Some people will
  -        //     want DOM, but our examples should mostly lean towards the
  -        //     SAX side of things....
  -
  -        Document retDoc = (Document) method.invoke( obj, argObjects );        
  -        if ( retDoc != null ) {
  -            SOAPBodyElement el = new SOAPBodyElement(retDoc.getDocumentElement());
  -            resEnv.addBodyElement(el);
  +
  +            argObjects[0] = msgContext ;
  +            method.invoke(obj, argObjects);
           }
       }
   };
  
  
  
  1.82      +6 -54     xml-axis/java/src/org/apache/axis/providers/java/RPCProvider.java
  
  Index: RPCProvider.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/providers/java/RPCProvider.java,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- RPCProvider.java	2 Aug 2002 12:55:33 -0000	1.81
  +++ RPCProvider.java	5 Aug 2002 05:10:47 -0000	1.82
  @@ -58,7 +58,6 @@
   import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
   import org.apache.axis.MessageContext;
  -import org.apache.axis.attachments.AttachmentPart;
   import org.apache.axis.attachments.MimeMultipartDataSource;
   import org.apache.axis.attachments.PlainTextDataSource;
   import org.apache.axis.enum.Style;
  @@ -72,7 +71,6 @@
   import org.apache.axis.message.SOAPBodyElement;
   import org.apache.axis.soap.SOAPConstants;
   import org.apache.axis.utils.JavaUtils;
  -import org.apache.axis.utils.cache.JavaClass;
   
   import org.apache.axis.components.logger.LogFactory;
   import org.apache.commons.logging.Log;
  @@ -82,7 +80,6 @@
   import javax.xml.namespace.QName;
   import javax.xml.rpc.holders.Holder;
   import java.lang.reflect.Method;
  -import java.util.StringTokenizer;
   import java.util.Vector;
   import java.util.Iterator;
   import java.util.ArrayList;
  @@ -103,19 +100,13 @@
        * Result in resEnv.
        *
        * @param msgContext self-explanatory
  -     * @param serviceName the class name of the ServiceHandler
  -     * @param allowedMethods the 'method name' of ditto
        * @param reqEnv the request envelope
        * @param resEnv the response envelope
  -     * @param jc the JavaClass of the service object
        * @param obj the service object itself
        */
       public void processMessage (MessageContext msgContext,
  -                                String serviceName,
  -                                String allowedMethods,
                                   SOAPEnvelope reqEnv,
                                   SOAPEnvelope resEnv,
  -                                JavaClass jc,
                                   Object obj)
           throws Exception
       {
  @@ -251,11 +242,12 @@
               }
           }
   
  -        // Check if we can find a Method by this name
  -        // FIXME : Shouldn't this type of thing have already occurred?
  +        // See if any subclasses want a crack at faulting on a bad operation
  +        // FIXME : Does this make sense here???
  +        String allowedMethods = (String)service.getOption("allowedMethods");
           checkMethodName(msgContext, allowedMethods, operation.getName());
   
  -        // Now create any out holders we need to pass in
  +       // Now create any out holders we need to pass in
           if (numArgs < argValues.length) {
               ArrayList outParams = operation.getOutParams();
               for (int i = 0; i < outParams.size(); i++) {
  @@ -397,47 +389,7 @@
                                      String methodName)
           throws Exception
       {
  -        String methodNameMatch = allowedMethods;
  -
  -        // allowedMethods may be a comma-delimited string of method names.
  -        // If so, look for the one matching methodName.
  -        if (allowedMethods != null) {
  -            StringTokenizer tok = new StringTokenizer(allowedMethods, ", ");
  -            String nextMethodName = null;
  -            while (tok.hasMoreElements()) {
  -                String token = tok.nextToken();
  -                if (token.equals(methodName)) {
  -                    nextMethodName = token;
  -                    break;
  -                }
  -            }
  -            // didn't find a matching one...
  -            if (nextMethodName == null) {
  -                throw new AxisFault( "AxisServer.error",
  -                        JavaUtils.getMessage("namesDontMatch00", methodName,
  -                                             allowedMethods),
  -                        null, null );  // should they??
  -            }
  -            methodNameMatch = nextMethodName;
  -        }
  -
  -        if ( methodNameMatch != null && !methodNameMatch.equals(methodName) )
  -            throw new AxisFault( "AxisServer.error",
  -                    JavaUtils.getMessage("namesDontMatch01",
  -                        new String[] {methodName, methodNameMatch,
  -                                      allowedMethods}),
  -                    null, null );  // should they??
  -
  -        if (log.isDebugEnabled()) {
  -            log.debug( "methodName: " + methodName );
  -            log.debug( "MethodNameMatch: " + methodNameMatch );
  -            log.debug( "MethodName List: " + allowedMethods );
  -        }
  -
  -        ///////////////////////////////////////////////////////////////
  -        // If allowedMethods (i.e. methodNameMatch) is null,
  -        //  then treat it as a wildcard automatically matching methodName
  -        ///////////////////////////////////////////////////////////////
  -        return;
  +        // Our version doesn't need to do anything, though inherited
  +        // ones might.
       }
   }
  
  
  
  1.34      +3 -0      xml-axis/java/src/org/apache/axis/utils/axisNLS.properties
  
  Index: axisNLS.properties
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/axisNLS.properties,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- axisNLS.properties	2 Aug 2002 16:05:57 -0000	1.33
  +++ axisNLS.properties	5 Aug 2002 05:10:48 -0000	1.34
  @@ -955,3 +955,6 @@
   onlyOneBodyFor12=Only one body allowed for SOAP 1.2 RPC
   differentTypes00=Error: The input and output parameter have the same name, ''{0}'', but are defined with type ''{1}'' and also with type ''{2}''.
   
  +badMsgMethodParam=Message service must take either a single Vector or a Document - method {0} takes a single {1}
  +msgMethodMustHaveOneParam=Message service methods must take a single parameter.  Method {0} takes {1}
  +needMessageContextArg=Full-message message service must take a single MessageContext argument.  Method {0} takes a single {1}
  
  
  
  1.57      +44 -61    xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/fromJava/Emitter.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- Emitter.java	4 Aug 2002 16:01:05 -0000	1.56
  +++ Emitter.java	5 Aug 2002 05:10:48 -0000	1.57
  @@ -398,38 +398,32 @@
               } else {
                   serviceDesc.setTypeMapping(defaultTM);
               }
  -        }
  -        
  -        // If the provided service description does NOT have the implementaion
  -        // class and we do, make sure to fill it in.
  -        if (serviceDesc.getImplClass() == null && cls != null) {
  -            serviceDesc.setImplClass(cls);
  -        }
  -
  -        serviceDesc.setStopClasses(stopClasses);
  -        serviceDesc.setAllowedMethods(allowedMethods);
  -        serviceDesc.setDisallowedMethods(disallowedMethods);
  -
  -        // If the class passed in is a portType, 
  -        // there may be an implClass that is used to 
  -        // obtain the method parameter names.  In this case,
  -        // a serviceDesc2 is built to get the method parameter names. 
  -        if (implCls != null &&
  -            implCls != cls &&
  -            serviceDesc2 == null) {
  -            serviceDesc2 = new ServiceDesc();
  -            serviceDesc2.setImplClass(implCls);
  -
  -            // Set the typeMapping to the one provided.
  -            // If not available use the default TM
  -            if (tm != null) {
  -                serviceDesc2.setTypeMapping(tm);
  -            } else {
  -                serviceDesc2.setTypeMapping(defaultTM);
  -            }
  -            serviceDesc2.setStopClasses(stopClasses);
  -            serviceDesc2.setAllowedMethods(allowedMethods);
  -            serviceDesc2.setDisallowedMethods(disallowedMethods);
  +
  +            serviceDesc.setStopClasses(stopClasses);
  +            serviceDesc.setAllowedMethods(allowedMethods);
  +            serviceDesc.setDisallowedMethods(disallowedMethods);
  +
  +            // If the class passed in is a portType,
  +            // there may be an implClass that is used to
  +            // obtain the method parameter names.  In this case,
  +            // a serviceDesc2 is built to get the method parameter names.
  +            if (implCls != null &&
  +                    implCls != cls &&
  +                    serviceDesc2 == null) {
  +                serviceDesc2 = new ServiceDesc();
  +                serviceDesc2.setImplClass(implCls);
  +
  +                // Set the typeMapping to the one provided.
  +                // If not available use the default TM
  +                if (tm != null) {
  +                    serviceDesc2.setTypeMapping(tm);
  +                } else {
  +                    serviceDesc2.setTypeMapping(defaultTM);
  +                }
  +                serviceDesc2.setStopClasses(stopClasses);
  +                serviceDesc2.setAllowedMethods(allowedMethods);
  +                serviceDesc2.setDisallowedMethods(disallowedMethods);
  +            }
           }
   
           if (encodingList == null) {
  @@ -473,10 +467,10 @@
               if (getBindingName() == null) {
                   setBindingName(getServicePortName() + "SoapBinding");
               }
  -            
  +
               encodingList = new ArrayList();
               encodingList.add(Constants.URI_DEFAULT_SOAP_ENC);
  -            
  +
               if (intfNS == null) {
                   Package pkg = cls.getPackage();
                   intfNS = namespaces.getCreate(
  @@ -491,7 +485,7 @@
                       implNS = intfNS + "-impl";
                   }
               }
  -                
  +
               namespaces.put(cls.getName(), intfNS, "intf");
               namespaces.putPrefix(implNS, "impl");
           }
  @@ -516,7 +510,7 @@
               def = reader.readWSDL(null, doc);
               // The input wsdl types section is deleted.  The
               // types will be added back in at the end of processing.
  -            def.setTypes(null); 
  +            def.setTypes(null);
           }
           return def;
       }
  @@ -598,14 +592,14 @@
        * @param add  true if binding should be added to the def
        */
       private Binding writeBinding(Definition def, boolean add) {
  -        QName bindingQName = 
  +        QName bindingQName =
               new QName(intfNS, getBindingName());
   
           // If a binding already exists, don't replace it.
           Binding binding = def.getBinding(bindingQName);
           if (binding != null) {
               return binding;
  -        } 
  +        }
   
           // Create a binding
           binding = def.createBinding();
  @@ -633,10 +627,10 @@
        */
       private void writeService(Definition def, Binding binding) {
   
  -        QName serviceElementQName = 
  +        QName serviceElementQName =
               new QName(implNS,
                         getServiceElementName());
  -        
  +
           // Locate an existing service, or get a new service
           Service service = def.getService(serviceElementQName);
           if (service == null) {
  @@ -680,7 +674,7 @@
               portType.setQName(portTypeQName);
               newPortType = true;
           } else if (binding.getBindingOperations().size() > 0) {
  -            // If both portType and binding already exist, 
  +            // If both portType and binding already exist,
               // no additional processing is needed.
               return;
           }
  @@ -689,8 +683,6 @@
           ArrayList operations = serviceDesc.getOperations();
           for (Iterator i = operations.iterator(); i.hasNext();) {
               OperationDesc thisOper = (OperationDesc)i.next();
  -            if (!allowedMethod(thisOper.getName())) 
  -                continue;
   
               BindingOperation bindingOper = writeOperation(def,
                                                             binding,
  @@ -705,18 +697,18 @@
                   // corresponding operation is found, it is sent
                   // to the writeMessages method so that its parameter
                   // names will be used in the wsdl file.
  -                OperationDesc[] operArray = 
  +                OperationDesc[] operArray =
                       serviceDesc2.getOperationsByName(thisOper.getName());
                   boolean found = false;
                   if (operArray != null) {
  -                    for (int j=0; 
  +                    for (int j=0;
                            j < operArray.length && !found;
                            j++) {
                           OperationDesc tryOper = operArray[j];
                           if (tryOper.getParameters().size() ==
                               thisOper.getParameters().size()) {
                               boolean parmsMatch = true;
  -                            for (int k=0; 
  +                            for (int k=0;
                                    k<thisOper.getParameters().size() && parmsMatch;
                                    k++) {
                                   if (tryOper.getParameter(k).getMode() !=
  @@ -735,7 +727,7 @@
                   }
               }
   
  -            writeMessages(def, oper, messageOper, 
  +            writeMessages(def, oper, messageOper,
                             bindingOper);
               if (newPortType) {
                   portType.addOperation(oper);
  @@ -851,7 +843,7 @@
   
           SOAPOperation soapOper = new SOAPOperationImpl();
   
  -        
  +
           // If the soapAction option is OPERATION, force
           // soapAction to the name of the operation. If NONE,
           // force soapAction to "".
  @@ -909,7 +901,7 @@
           else
               soapBodyOut.setNamespaceURI(targetService);
           QName retQName = desc.getReturnQName();
  -        if (retQName != null && 
  +        if (retQName != null &&
               !retQName.getNamespaceURI().equals("")) {
               soapBodyOut.setNamespaceURI(retQName.getNamespaceURI());
           }
  @@ -995,7 +987,7 @@
        * @throws AxisFault
        */
       private Message writeFaultMessage(Definition def,
  -                                      FaultDesc exception) 
  +                                      FaultDesc exception)
           throws WSDLException, AxisFault
       {
   
  @@ -1087,7 +1079,7 @@
               elemQName = param.getQName();
           if (mode == MODE_RPC) {
               QName typeQName = types.writePartType(javaType,
  -                                                  param.getTypeQName()); 
  +                                                  param.getTypeQName());
               if (typeQName != null) {
                   part.setTypeName(typeQName);
                   part.setName(param.getName());
  @@ -1416,7 +1408,7 @@
       }
   
       /**
  -     * Get the name of the input WSDL                              
  +     * Get the name of the input WSDL
        * @return name of the input wsdl or null
        */
       public String getInputWSDL() {
  @@ -1623,14 +1615,5 @@
   
       public void setServiceDesc(ServiceDesc serviceDesc) {
           this.serviceDesc = serviceDesc;
  -    }
  -
  -    private boolean allowedMethod(String name) {
  -        boolean allowed = false;
  -        if (allowedMethods == null || allowedMethods.contains(name))
  -            allowed = true;
  -        if (allowed && disallowedMethods != null && disallowedMethods.contains(name)) 
  -            allowed = false;
  -        return allowed;
       }
   }
  
  
  
  1.42      +5 -37     xml-axis/java/test/RPCDispatch/TestRPC.java
  
  Index: TestRPC.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/RPCDispatch/TestRPC.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- TestRPC.java	26 Jun 2002 20:08:39 -0000	1.41
  +++ TestRPC.java	5 Aug 2002 05:10:48 -0000	1.42
  @@ -3,11 +3,8 @@
   import junit.framework.TestCase;
   import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
  -import org.apache.axis.Handler;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  -import org.apache.axis.encoding.TypeMapping;
  -import org.apache.axis.description.ServiceDesc;
   import org.apache.axis.providers.java.RPCProvider;
   import org.apache.axis.configuration.SimpleProvider;
   import org.apache.axis.handlers.soap.SOAPService;
  @@ -18,9 +15,6 @@
   
   import org.xml.sax.SAXException;
   
  -import org.w3c.dom.Element;
  -import org.w3c.dom.Text;
  -
   import javax.xml.namespace.QName;
   import java.util.Vector;
   
  @@ -56,8 +50,6 @@
   
       /**
        * Invoke a given RPC method, and return the result
  -     * @param soapAction action to be performed
  -     * @param request XML body of the request
        * @return Deserialized result
        */
       private final Object rpc(String method, Object[] parms)
  @@ -108,12 +100,10 @@
           reverse.setOption("className", "test.RPCDispatch.Service");
           reverse.setOption("allowedMethods", "reverseString");
           provider.deployService(new QName(null,SOAPAction), reverse);
  -        ServiceDesc serviceDesc = reverse.getServiceDescription();
  -        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                   (TypeMapping)reverse.getTypeMappingRegistry().getDefaultTypeMapping());
   
           // invoke the service and verify the result
  -        assertEquals("Did not reverse the string correctly.", "cba", rpc("reverseString", new Object[] {"abc"}));
  +        assertEquals("Did not reverse the string correctly.", "cba",
  +                     rpc("reverseString", new Object[] {"abc"}));
       }
   
       /**
  @@ -126,9 +116,7 @@
               reverse.setOption("className", "test.RPCDispatch.Service");
               reverse.setOption("allowedMethods", "reverseString2");
               provider.deployService(new QName(null,SOAPAction), reverse);
  -            ServiceDesc serviceDesc = reverse.getServiceDescription();
  -            serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                       (TypeMapping)reverse.getTypeMappingRegistry().getDefaultTypeMapping());
  +
               // invoke the service and verify the result
               rpc("reverseString", new Object[] {"abc"});
               throw new junit.framework.AssertionFailedError("Should not reach here");
  @@ -147,9 +135,6 @@
           reverse.setOption("className", "test.RPCDispatch.Service");
           reverse.setOption("allowedMethods", "reverseString2,reverseString");
           provider.deployService(new QName(null,SOAPAction), reverse);
  -        ServiceDesc serviceDesc = reverse.getServiceDescription();
  -        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                   (TypeMapping)reverse.getTypeMappingRegistry().getDefaultTypeMapping());
   
           // invoke the service and verify the result
           assertEquals("Did not reverse the string correctly.", "cba", rpc("reverseString", new Object[] {"abc"}));
  @@ -164,9 +149,6 @@
           reverse.setOption("className", "test.RPCDispatch.Service");
           reverse.setOption("allowedMethods", "reverseString2 reverseString");
           provider.deployService(new QName(null,SOAPAction), reverse);
  -        ServiceDesc serviceDesc = reverse.getServiceDescription();
  -        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                   (TypeMapping)reverse.getTypeMappingRegistry().getDefaultTypeMapping());
   
           // invoke the service and verify the result
           assertEquals("Did not reverse the string correctly.", "cba", rpc("reverseString", new Object[] {"abc"}));
  @@ -181,12 +163,10 @@
           reverse.setOption("className", "test.RPCDispatch.Service");
           reverse.setOption("allowedMethods", "*");
           provider.deployService(new QName(null,SOAPAction), reverse);
  -        ServiceDesc serviceDesc = reverse.getServiceDescription();
  -        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                   (TypeMapping)reverse.getTypeMappingRegistry().getDefaultTypeMapping());
   
           // invoke the service and verify the result
  -        assertEquals("Did not reverse the string correctly.", "cba", rpc("reverseString", new Object[] {"abc"}));
  +        assertEquals("Did not reverse the string correctly.", "cba",
  +                     rpc("reverseString", new Object[] {"abc"}));
       }
       
       /**
  @@ -198,9 +178,6 @@
           reverse.setOption("className", "test.RPCDispatch.Service");
           reverse.setOption("allowedMethods", "reverseData");
           provider.deployService(new QName(null, SOAPAction), reverse);
  -        ServiceDesc serviceDesc = reverse.getServiceDescription();
  -        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                   (TypeMapping)reverse.getTypeMappingRegistry().getDefaultTypeMapping());
   
           // invoke the service and verify the result
           Data input    = new Data(5, "abc", 3);
  @@ -217,9 +194,6 @@
           tgtSvc.setOption("className", "test.RPCDispatch.Service");
           tgtSvc.setOption("allowedMethods", "targetServiceImplicit");
           provider.deployService(new QName(null, SOAPAction), tgtSvc);
  -        ServiceDesc serviceDesc = tgtSvc.getServiceDescription();
  -        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                   (TypeMapping)tgtSvc.getTypeMappingRegistry().getDefaultTypeMapping());
   
           // invoke the service and verify the result
           assertEquals("SOAP Action did not equal the targetService.", 
  @@ -235,9 +209,6 @@
           echoInt.setOption("className", "test.RPCDispatch.Service");
           echoInt.setOption("allowedMethods", "echoInt");
           provider.deployService(new QName(null, SOAPAction), echoInt);
  -        ServiceDesc serviceDesc = echoInt.getServiceDescription();
  -        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                   (TypeMapping)echoInt.getTypeMappingRegistry().getDefaultTypeMapping());
   
           // invoke the service and verify the result
           assertNull("The result was not null as expected.", rpc("echoInt", new Object[] {null}));
  @@ -252,9 +223,6 @@
           simpleFault.setOption("className", "test.RPCDispatch.Service");
           simpleFault.setOption("allowedMethods", "simpleFault");
           provider.deployService(new QName(null, SOAPAction), simpleFault);
  -        ServiceDesc serviceDesc = simpleFault.getServiceDescription();
  -        serviceDesc.loadServiceDescByIntrospection(test.RPCDispatch.Service.class,
  -                                                   (TypeMapping)simpleFault.getTypeMappingRegistry().getDefaultTypeMapping());
   
           try {
               rpc("simpleFault", new Object[] {"foobar"});
  
  
  
  1.20      +3 -2      xml-axis/java/test/encoding/TestArrayListConversions.java
  
  Index: TestArrayListConversions.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestArrayListConversions.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- TestArrayListConversions.java	11 Jun 2002 14:54:02 -0000	1.19
  +++ TestArrayListConversions.java	5 Aug 2002 05:10:48 -0000	1.20
  @@ -56,11 +56,12 @@
               transport = new LocalTransport(server);
   
               SOAPService service = new SOAPService(new RPCProvider());
  -            ServiceDesc desc = service.getInitializedServiceDesc(null);
  -            desc.setDefaultNamespace(SERVICE_NAME);
   
               service.setOption("className", "test.encoding.TestArrayListConversions");
               service.setOption("allowedMethods", "*");
  +
  +            ServiceDesc desc = service.getInitializedServiceDesc();
  +            desc.setDefaultNamespace(SERVICE_NAME);
   
               provider.deployService(SERVICE_NAME, service);
           } catch (Exception exp) {
  
  
  
  1.120     +8 -0      xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml
  
  Index: Wsdl2javaTestSuite.xml
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/Wsdl2javaTestSuite.xml,v
  retrieving revision 1.119
  retrieving revision 1.120
  diff -u -r1.119 -r1.120
  --- Wsdl2javaTestSuite.xml	30 Jul 2002 06:16:04 -0000	1.119
  +++ Wsdl2javaTestSuite.xml	5 Aug 2002 05:10:48 -0000	1.120
  @@ -683,6 +683,10 @@
           <mapping namespace="http://soapinterop.org/definitions/" package="test.wsdl.interop3.import2.step6.definitions"/>
           <mapping namespace="http://soapinterop.org/xsd" package="test.wsdl.interop3.import2.step6.xsd"/>
       </wsdl2java>
  +      <javac srcdir="${build.dir}/work" destdir="${build.dest}" debug="on">
  +        <classpath refid="test-classpath" />
  +        <include name="test/wsdl/interop3/import2/step6/**/*.java" />
  +      </javac>
   
       <!-- Step 7:  see test/wsdl/interop3/Import2TestCase.java -->
       <!-- Step 8:  see test/wsdl/interop3/Import2TestCase.java -->
  @@ -768,6 +772,10 @@
           <mapping namespace="http://soapinterop.org/xsd" package="test.wsdl.interop3.import3.step6.xsd"/>
           <mapping namespace="http://soapinterop.org/xsd2" package="test.wsdl.interop3.import3.step6.xsd2"/>
       </wsdl2java>
  +      <javac srcdir="${build.dir}/work" destdir="${build.dest}" debug="on">
  +        <classpath refid="test-classpath" />
  +        <include name="test/wsdl/interop3/import3/step6/**/*.java" />
  +      </javac>
   
       <!-- Step 7:  see test/wsdl/interop3/Import2TestCase.java -->
       <!-- Step 8:  see test/wsdl/interop3/Import2TestCase.java -->
  
  
  

Mime
View raw message