axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Russell Butek" <bu...@us.ibm.com>
Subject Re: cvs commit: xml-axis/java/test/wsdl Java2WsdlAntTask.java
Date Mon, 15 Apr 2002 13:19:50 GMT
Glen, I hate to be a whiner, but your IDE did a lot of this sort of thing
again...

-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
+import java.util.*;

On the plus side, in my sandbox I turned on skeletons for ALL serverSide
tests and the build still succeeds!  Thanks for putting back the old
functionality!

This brings up another point which I'm not sure how to solve.  When you
changed the default of WSDL2Java to NOT generate skeletons, you essentially
changed ALL the WSDL2Java tests to test the NEW generation.  So now there
are NO tests to test the old generation.  That's a problem.  The tests
don't test the same thing, anymore.  I could whine and complain and say
they should all have a skeletonDeploy="yes" clause, but that's just as bad
in the other direction - none of the NEW generation would be tested.  I've
got some ideas, but none of them satisfy me completely:

1.  Add a flag to the build to turn on skeletonDeploy.  I don't like this
because skels would no longer be part of the build and someone (Rich or I)
would have to periodically run with skels turned on to make sure we haven't
regressed.  And if we HAVE broken, good luck trying to figure out when!
(And whose responsibility IS it to figure out when?)
2.  Pick and choose, make half the tests test skels and the other
non-skels.  I don't like this because it's only a half-solution for both.
3.  Duplicate all serverSide="yes" tests, one set having skeletonDeploy
="yes", the other set ="no".  This is the most complete solution, but it
adds 50 tests to our suite in one fell swoop, and folks are already
grumbling about how long the build takes.

Russell Butek
butek@us.ibm.com


gdaniels@apache.org on 04/14/2002 09:35:58 PM

Please respond to axis-dev@xml.apache.org

To:    xml-axis-cvs@apache.org
cc:
Subject:    cvs commit: xml-axis/java/test/wsdl Java2WsdlAntTask.java



gdaniels    02/04/14 19:35:58

  Modified:    java/samples/bidbuy deploy.wsdd
               java/src/org/apache/axis MessageContext.java
               java/src/org/apache/axis/configuration SimpleProvider.java
               java/src/org/apache/axis/deployment/wsdd WSDDDeployment.java
                        WSDDService.java
               java/src/org/apache/axis/description OperationDesc.java
                        ServiceDesc.java
               java/src/org/apache/axis/encoding
                        DefaultSOAP12TypeMappingImpl.java
                        DefaultTypeMappingImpl.java
                        DeserializationContextImpl.java
                        SerializationContextImpl.java
                        TypeMappingRegistryImpl.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
               java/src/org/apache/axis/message BodyBuilder.java
                        RPCElement.java RPCHandler.java
               java/src/org/apache/axis/utils JavaUtils.java
                        resources.properties
               java/src/org/apache/axis/wsdl Java2WSDL.java WSDL2Java.java
               java/src/org/apache/axis/wsdl/fromJava Emitter.java
               java/src/org/apache/axis/wsdl/toJava JavaDeployWriter.java
                        JavaSkelWriter.java
               java/test/encoding TestArrayListConversions.java
                        TestXsiType.java
               java/test/wsdl Java2WsdlAntTask.java
  Log:
  The main point of this checkin is:

  * Enable Skeletons for real, fill in ServiceDesc implementation to get
    metadata from there if appropriate

  Along the way:

  * Change "create()" to "getSingleton()" on DefaultTypeMappingImpl, since
    it
    isn't really creating one.  Synchronize the method to make thread-safe.

  * Give Bidbuy service an explicit namespace mapping

  * Default to allowedMethods="*" in JavaDeployWriter if nothing specified

  * Add new Skeleton static method to get all operationDescs

  * Correctly process input namespace and XML<->Java mappings when writing
    Skeletons

  * Use addParameter() method to add parameters specified in the
    constructor
    of an OperationDesc - this ensures they get counted correctly

  * Introduce SOAPService.getInitializedServiceDesc(), which will attempt
    to
    load the impl class and get a typemapping if these things are not
    already
    set up

  * Code cleanup in various places - remove dead code/unused imports, fix
    JavaDoc, etc.

  Revision  Changes    Path
  1.4       +1 -0      xml-axis/java/samples/bidbuy/deploy.wsdd

  Index: deploy.wsdd
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/samples/bidbuy/deploy.wsdd,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- deploy.wsdd 9 Apr 2002 16:58:17 -0000     1.3
  +++ deploy.wsdd 15 Apr 2002 02:35:57 -0000    1.4
  @@ -12,6 +12,7 @@
               xmlns:reg="http://www.soapinterop.org/Registry">

     <service name="http://www.soapinterop.org/Bid" provider="java:RPC" >
  +    <namespace>http://www.soapinterop.org/Bid</namespace>
       <parameter name="className" value="samples.bidbuy.BidService" />
       <parameter name="allowedMethods" value="RequestForQuote SimpleBuy
       Buy Ping" />
     </service>



  1.88      +2 -8
  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.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- MessageContext.java     11 Apr 2002 16:07:35 -0000    1.87
  +++ MessageContext.java     15 Apr 2002 02:35:57 -0000    1.88
  @@ -183,12 +183,6 @@
       /** Our SOAP namespaces and such - defaults to SOAP 1.1 */
       private SOAPConstants soapConstants = new SOAP11Constants();

  -    /**
  -     * Are we using SOAP encoding?  Default is true for RPC services,
  -     * should be set to false for document/literal.
  -     */
  -    private boolean isEncoded = true;
  -
       private OperationDesc currentOperation = null;
       public OperationDesc getOperation()
       {
  @@ -221,7 +215,7 @@
                   return null;
           }

  -        ServiceDesc desc = serviceHandler.getServiceDescription();
  +        ServiceDesc desc =
  serviceHandler.getInitializedServiceDesc(this);

           if (desc != null) {
               currentOperation = desc.getOperationByElementQName(qname);
  @@ -393,7 +387,7 @@
        * Set the response message, and make sure that message is
        associated
        * with this MessageContext.
        *
  -     * @param reqMsg the new response Message.
  +     * @param respMsg the new response Message.
        */
       public void setResponseMessage(Message respMsg) {
           responseMessage = respMsg ;



  1.6       +9 -0
  xml-axis/java/src/org/apache/axis/configuration/SimpleProvider.java

  Index: SimpleProvider.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/configuration/SimpleProvider.java,v

  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SimpleProvider.java     29 Mar 2002 00:01:26 -0000    1.5
  +++ SimpleProvider.java     15 Apr 2002 02:35:57 -0000    1.6
  @@ -69,6 +69,7 @@
   import java.util.HashMap;
   import java.util.Iterator;
   import java.util.ArrayList;
  +import java.util.Set;

   /**
    * A SimpleProvider is an EngineConfiguration which contains a simple
  @@ -102,6 +103,7 @@

       /** An optional "default" EngineConfiguration */
       EngineConfiguration defaultConfiguration = null;
  +    private AxisEngine engine;

       /**
        * Default constructor.
  @@ -123,8 +125,14 @@
        */
       public void configureEngine(AxisEngine engine) throws
       ConfigurationException
       {
  +        this.engine = engine;
  +
           if (defaultConfiguration != null)
               defaultConfiguration.configureEngine(engine);
  +
  +        for (Iterator i = services.values().iterator(); i.hasNext(); ) {
  +            ((SOAPService)i.next()).setEngine(engine);
  +        }
       }

       /**
  @@ -234,6 +242,7 @@
       public void deployService(QName qname, SOAPService service)
       {
           services.put(qname, service);
  +        service.setEngine(engine);
       }

       public void deployService(String name, SOAPService service)



  1.31      +28 -17
  xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java

  Index: WSDDDeployment.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDeployment.java,v

  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- WSDDDeployment.java     29 Mar 2002 00:01:26 -0000    1.30
  +++ WSDDDeployment.java     15 Apr 2002 02:35:57 -0000    1.31
  @@ -54,27 +54,32 @@
    */
   package org.apache.axis.deployment.wsdd;

  -import org.w3c.dom.Document;
  -import org.w3c.dom.Element;
  -import org.w3c.dom.NodeList;
  -import org.apache.axis.*;
  -import org.apache.axis.handlers.soap.SOAPService;
  -import org.apache.axis.deployment.DeploymentRegistry;
  +import org.apache.axis.AxisEngine;
  +import org.apache.axis.ConfigurationException;
  +import org.apache.axis.Constants;
  +import org.apache.axis.EngineConfiguration;
  +import org.apache.axis.Handler;
   import org.apache.axis.deployment.DeploymentException;
  -import org.apache.axis.encoding.ser.BaseSerializerFactory;
  +import org.apache.axis.encoding.DeserializerFactory;
  +import org.apache.axis.encoding.SerializationContext;
  +import org.apache.axis.encoding.SerializerFactory;
  +import org.apache.axis.encoding.TypeMapping;
  +import org.apache.axis.encoding.TypeMappingRegistry;
  +import org.apache.axis.encoding.TypeMappingRegistryImpl;
   import org.apache.axis.encoding.ser.BaseDeserializerFactory;
  -import org.apache.axis.encoding.*;
  -
  +import org.apache.axis.encoding.ser.BaseSerializerFactory;
  +import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  +import org.w3c.dom.Element;

   import javax.xml.rpc.namespace.QName;
  +import java.io.IOException;
  +import java.util.ArrayList;
   import java.util.HashMap;
  -import java.util.Iterator;
   import java.util.Hashtable;
  +import java.util.Iterator;
   import java.util.Vector;
  -import java.util.ArrayList;
  -import java.io.IOException;


   /**
  @@ -98,7 +103,8 @@

       /** Mapping of namespaces -> services */
       private HashMap namespaceToServices = new HashMap();
  -
  +    private AxisEngine engine;
  +
       void addHandler(WSDDHandler handler)
       {
           handlers.put(handler.getQName(), handler);
  @@ -142,10 +148,10 @@
       }

       /**
  -     * Put a WSDDHandler into this deployment, replacing any other
  -     * WSDDHandler which might already be present with the same QName.
  +     * Put a WSDDService into this deployment, replacing any other
  +     * WSDDService which might already be present with the same QName.
        *
  -     * @param handler a WSDDHandler to insert in this deployment
  +     * @param service a WSDDHandler to insert in this deployment
        */
       public void deployService(WSDDService service)
       {
  @@ -480,9 +486,10 @@

           return null;
       }
  +
       public void configureEngine(AxisEngine engine)
               throws ConfigurationException {
  -
  +        this.engine = engine;
       }

       public void writeEngineConfig(AxisEngine engine) throws
  ConfigurationException {
  @@ -562,5 +569,9 @@
       public void removeNamespaceMapping(String namespace)
       {
           namespaceToServices.remove(namespace);
  +    }
  +
  +    public AxisEngine getEngine() {
  +        return engine;
       }
   }



  1.57      +6 -12
  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.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- WSDDService.java  12 Apr 2002 22:24:47 -0000    1.56
  +++ WSDDService.java  15 Apr 2002 02:35:57 -0000    1.57
  @@ -167,6 +167,8 @@
               String ns =
               XMLUtils.getChildCharacterData(namespaceElements[i]);
               namespaces.add(ns);
           }
  +        if (!namespaces.isEmpty())
  +            desc.setNamespaceMappings(namespaces);

           Element wsdlElem = getChildElement(e, "wsdlFile");
           if (wsdlElem != null) {
  @@ -183,11 +185,10 @@
       }

       /**
  -     * This method should b used for dynamic deployment using new
  WSDDService()
  -     * etc. It validates some standard parameters for some standard
  providers
  -     * (if any). This is part of Axis. Do this before
  deployment.desployService().
  -     *
  -     **/
  +     * This method can be used for dynamic deployment using new
  WSDDService()
  +     * etc.  It validates some standard parameters for some standard
  providers
  +     * (if present).  Do this before deployment.deployService().
  +     */
       public void validateDescriptors()
       {
           String className = this.getParameter("className");
  @@ -224,13 +225,6 @@
           typeMappings.add(mapping);
       }

  -    /**
  -     * Add an WSDDOperation to the Service.
  -     * @param mapping
  -     **/
  -    public void addOperation(WSDDOperation operation) {
  -        operations.add(operation);
  -    }

       protected QName getElementName()
       {



  1.8       +1 -1
  xml-axis/java/src/org/apache/axis/description/OperationDesc.java

  Index: OperationDesc.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/description/OperationDesc.java,v

  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- OperationDesc.java      1 Apr 2002 20:12:16 -0000     1.7
  +++ OperationDesc.java      15 Apr 2002 02:35:57 -0000    1.8
  @@ -119,7 +119,7 @@
           this.name = name;
           this.returnQName = returnQName;
           for (int i = 0; i < parameters.length; i++) {
  -            this.parameters.add(parameters[i]);
  +            addParameter(parameters[i]);
           }
       }




  1.17      +80 -56
  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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- ServiceDesc.java  11 Apr 2002 17:08:37 -0000    1.16
  +++ ServiceDesc.java  15 Apr 2002 02:35:57 -0000    1.17
  @@ -60,10 +60,7 @@
   import org.apache.axis.wsdl.Skeleton;

   import javax.xml.rpc.namespace.QName;
  -import java.util.ArrayList;
  -import java.util.HashMap;
  -import java.util.Iterator;
  -import java.util.List;
  +import java.util.*;
   import java.lang.reflect.Method;
   import java.lang.reflect.InvocationTargetException;
   import java.lang.reflect.Field;
  @@ -83,9 +80,6 @@
       public static final int STYLE_WRAPPED = 2;
       public static final int STYLE_MESSAGE = 3;

  -    /** This becomes true once we've added some operations */
  -    private boolean hasOperationData = false;
  -
       /** The name of this service */
       private String name = null;

  @@ -99,9 +93,6 @@
       /** Style */
       private int style = STYLE_RPC;

  -    /** Implementation class name */
  -    private String className = null;
  -
       /** Implementation class */
       private Class implClass = null;

  @@ -109,7 +100,7 @@
       private ArrayList operations = new ArrayList();

       /** A collection of namespaces which will map to this service */
  -    private ArrayList namespaceMappings = null;
  +    private List namespaceMappings = null;

       /**
        * Where does our WSDL document live?  If this is non-null, the
        "?WSDL"
  @@ -127,19 +118,26 @@
        * a Fault to provide OperationDescs via WSDD.
        */
       private boolean isSkeletonClass = false;
  -    /** Cached copy of the skeleton "getParameterDescStatic" method */
  +
  +    /** Cached copy of the skeleton "getOperationDescByName" method */
       private Method skelMethod = null;

  -    /** Classes at which we should stop looking up the inheritance chain
  */
  +    /** Classes at which we should stop looking up the inheritance chain
  +     *  when introspecting
  +     */
       private ArrayList stopClasses = null;

       /** Lookup caches */
       private HashMap name2OperationsMap = null;
       private HashMap qname2OperationMap = null;
       private HashMap method2OperationMap = new HashMap();
  +
  +    /** Method names for which we have completed any introspection
  necessary */
       private ArrayList completedNames = new ArrayList();

  +    /** Our typemapping for resolving Java<->XML type issues */
       private TypeMapping tm = null;
  +    private boolean haveAllSkeletonMethods = false;

       /**
        * Default constructor
  @@ -190,6 +188,10 @@
       }

       public void setImplClass(Class implClass) {
  +        if (this.implClass != null)
  +            throw new IllegalArgumentException(
  +                    JavaUtils.getMessage("implAlreadySet"));
  +
           this.implClass = implClass;
           if (Skeleton.class.isAssignableFrom(implClass)) {
               isSkeletonClass = true;
  @@ -198,7 +200,32 @@
       }

       private void loadSkeletonOperations() {
  +        Method method = null;
  +        try {
  +            method = implClass.getDeclaredMethod("getOperationDescs",
  +                                                 new Class [] {});
  +        } catch (NoSuchMethodException e) {
  +        } catch (SecurityException e) {
  +        }
  +        if (method == null) {
  +            // FIXME : Throw an error?
  +            return;
  +        }

  +        try {
  +            Collection opers = (Collection)method.invoke(implClass,
  null);
  +            for (Iterator i = opers.iterator(); i.hasNext();) {
  +                OperationDesc skelDesc = (OperationDesc)i.next();
  +                addOperationDesc(skelDesc);
  +            }
  +        } catch (IllegalAccessException e) {
  +            return;
  +        } catch (IllegalArgumentException e) {
  +            return;
  +        } catch (InvocationTargetException e) {
  +            return;
  +        }
  +        haveAllSkeletonMethods = true;
       }

       public TypeMapping getTypeMapping() {
  @@ -302,32 +329,13 @@
        */
       public OperationDesc getOperationByElementQName(QName qname)
       {
  -        // If we're an RPC service, we ignore the namespace... should
  fix
  -        // this later!
  -        if (style == STYLE_RPC) {
  -            return getOperationByName(qname.getLocalPart());
  -        }
  -
  -        // If we're MESSAGE style, we should only have a single
  operation,
  -        // to which we'll pass any XML we receive.
  -        if (style == STYLE_MESSAGE) {
  -            return (OperationDesc)operations.get(0);
  -        }
  -
  -        // If we're DOCUMENT style, we look in our mapping of QNames ->
  -        // operations instead.  But first, let's make sure we've
  initialized
  -        // said mapping....
  -        initQNameMap();
  -
  -        ArrayList overloads = (ArrayList)qname2OperationMap.get(qname);
  -        if (overloads == null)
  -            return null;
  -
  -        OperationDesc oper = (OperationDesc)overloads.get(0);
  -        getSyncedOperationsForName(implClass, oper.getName());
  +        OperationDesc [] overloads = getOperationsByQName(qname);

           // Return the first one....
  -        return oper;
  +        if ((overloads != null) && overloads.length > 0)
  +            return overloads[0];
  +
  +        return null;
       }

       /**
  @@ -336,12 +344,6 @@
        */
       public OperationDesc [] getOperationsByQName(QName qname)
       {
  -        // If we're an RPC service, we ignore the namespace... should
  fix
  -        // this later!
  -        if (style == STYLE_RPC) {
  -            return getOperationsByName(qname.getLocalPart());
  -        }
  -
           // If we're MESSAGE style, we should only have a single
           operation,
           // to which we'll pass any XML we receive.
           if (style == STYLE_MESSAGE) {
  @@ -355,9 +357,15 @@

           ArrayList overloads = (ArrayList)qname2OperationMap.get(qname);

  -        if (overloads == null)
  -            return null;
  -
  +        if (overloads == null) {
  +            if ((style == STYLE_RPC) && (name2OperationsMap != null)) {
  +                // Try ignoring the namespace....?
  +                overloads
  = (ArrayList)name2OperationsMap.get(qname.getLocalPart());
  +            }
  +            if (overloads == null)
  +                return null;
  +        }
  +
           getSyncedOperationsForName(implClass,
                                      ((OperationDesc)overloads.get(0)).getName

                                      ));

  @@ -367,6 +375,8 @@

       private synchronized void initQNameMap() {
           if (qname2OperationMap == null) {
  +            loadServiceDescByIntrospection();
  +
               qname2OperationMap = new HashMap();
               for (Iterator i = operations.iterator(); i.hasNext();) {
                   OperationDesc operationDesc = (OperationDesc) i.next();
  @@ -549,15 +559,15 @@
           // If we're a skeleton class, make sure we don't already have
           any
           // OperationDescs for this name (as that might cause conflicts),
           // then load them up from the Skeleton class.
  -        if (isSkeletonClass) {
  +        if (isSkeletonClass && !haveAllSkeletonMethods) {
               // FIXME : Check for existing ones and fault if found

               if (skelMethod == null) {
                   // Grab metadata from the Skeleton for parameter info
                   try {
                       skelMethod = implClass.getDeclaredMethod(
  -                                            "getOperationDescsByName",
  -                                            new Class [] { int.class });
  +                                            "getOperationDescByName",
  +                                            new Class [] { String.class
  });
                   } catch (NoSuchMethodException e) {
                   } catch (SecurityException e) {
                   }
  @@ -567,13 +577,11 @@
                   }
               }
               try {
  -                OperationDesc [] skelDescs =
  -                        (OperationDesc [])skelMethod.invoke(implClass,
  -                                            new Object [] { methodName
  });
  -                for (int i = 0; i < skelDescs.length; i++) {
  -                    OperationDesc operationDesc = skelDescs[i];
  -                    addOperationDesc(operationDesc);
  -                }
  +                OperationDesc skelDesc =
  +                        (OperationDesc)skelMethod.invoke(implClass,
  +                                new Object [] { methodName });
  +                if (skelDesc != null)
  +                    addOperationDesc(skelDesc);
               } catch (IllegalAccessException e) {
                   return;
               } catch (IllegalArgumentException e) {
  @@ -658,6 +666,12 @@
           // Make an OperationDesc, fill in common stuff
           OperationDesc operation = new OperationDesc();
           operation.setName(method.getName());
  +        if (namespaceMappings != null && !namespaceMappings.isEmpty()) {
  +            // If we have a default namespace mapping, require callers
  to
  +            // use that namespace.
  +            String defaultNS = (String)namespaceMappings.get(0);
  +            operation.setElementQName(new QName(defaultNS,
  method.getName()));
  +        }
           operation.setMethod(method);
           Class retClass = method.getReturnType();
           operation.setReturnClass(retClass);
  @@ -721,5 +735,15 @@

           addOperationDesc(operation);
           method2OperationMap.put(method, operation);
  +    }
  +
  +    public void setNamespaceMappings(List namespaces) {
  +        namespaceMappings = namespaces;
  +    }
  +
  +    public void setDefaultNamespace(String namespace) {
  +        if (namespaceMappings == null)
  +            namespaceMappings = new ArrayList();
  +        namespaceMappings.add(0, namespace);
       }
   }



  1.2       +1 -1
  xml-axis/java/src/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java


  Index: DefaultSOAP12TypeMappingImpl.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DefaultSOAP12TypeMappingImpl.java,v

  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultSOAP12TypeMappingImpl.java   1 Feb 2002 22:08:25 -0000     1.1
  +++ DefaultSOAP12TypeMappingImpl.java   15 Apr 2002 02:35:57 -0000    1.2
  @@ -109,7 +109,7 @@
           super();
           // This default type mapping only contains the SOAP 1.2
           differences.
           // delegate to the DefaultTypeMapping as necessary.
  -        delegate = DefaultTypeMappingImpl.create();
  +        delegate = DefaultTypeMappingImpl.getSingleton();

           // Notes:
           // 1) The registration statements are order dependent.  The last
           one



  1.20      +16 -33
  xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java

  Index: DefaultTypeMappingImpl.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DefaultTypeMappingImpl.java,v

  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DefaultTypeMappingImpl.java   11 Apr 2002 16:17:55 -0000    1.19
  +++ DefaultTypeMappingImpl.java   15 Apr 2002 02:35:57 -0000    1.20
  @@ -56,38 +56,10 @@
   package org.apache.axis.encoding;

   import org.apache.axis.Constants;
  +import org.apache.axis.encoding.ser.*;

  -import javax.xml.rpc.namespace.QName;
   import javax.xml.rpc.JAXRPCException;
  -
  -import java.util.ArrayList;
  -import java.util.HashMap;
  -
  -import org.apache.axis.encoding.ser.ArraySerializerFactory;
  -import org.apache.axis.encoding.ser.ArrayDeserializerFactory;
  -import org.apache.axis.encoding.ser.BeanSerializerFactory;
  -import org.apache.axis.encoding.ser.BeanDeserializerFactory;
  -import org.apache.axis.encoding.ser.CalendarSerializerFactory;
  -import org.apache.axis.encoding.ser.CalendarDeserializerFactory;
  -import org.apache.axis.encoding.ser.DateSerializerFactory;
  -import org.apache.axis.encoding.ser.DateDeserializerFactory;
  -import org.apache.axis.encoding.ser.Base64SerializerFactory;
  -import org.apache.axis.encoding.ser.Base64DeserializerFactory;
  -import org.apache.axis.encoding.ser.MapSerializerFactory;
  -import org.apache.axis.encoding.ser.MapDeserializerFactory;
  -import org.apache.axis.encoding.ser.HexSerializerFactory;
  -import org.apache.axis.encoding.ser.HexDeserializerFactory;
  -import org.apache.axis.encoding.ser.ElementSerializerFactory;
  -import org.apache.axis.encoding.ser.ElementDeserializerFactory;
  -import org.apache.axis.encoding.ser.QNameSerializerFactory;
  -import org.apache.axis.encoding.ser.QNameDeserializerFactory;
  -import org.apache.axis.encoding.ser.VectorDeserializerFactory;
  -import org.apache.axis.encoding.ser.VectorSerializerFactory;
  -import org.apache.axis.encoding.ser.SimpleDeserializerFactory;
  -import org.apache.axis.encoding.ser.SimplePrimitiveSerializerFactory;
  -import org.apache.axis.encoding.ser.SimpleNonPrimitiveSerializerFactory;
  -import java.util.Vector;
  -import java.util.Hashtable;
  +import javax.xml.rpc.namespace.QName;
   import java.util.List;

   /**
  @@ -116,10 +88,11 @@
   public class DefaultTypeMappingImpl extends TypeMappingImpl {

       private static DefaultTypeMappingImpl tm = null;
  +
       /**
  -     * Construct TypeMapping
  +     * Obtain the singleton default typemapping.
        */
  -    public static TypeMapping create() {
  +    public static synchronized TypeMapping getSingleton() {
           if (tm == null) {
               tm = new DefaultTypeMappingImpl();
           }
  @@ -336,13 +309,23 @@
        * @param sf is the ser factory (if null, the simple factory is
        used)
        * @param df is the deser factory (if null, the simple factory is
        used)
        * @param primitive indicates whether serializers can be shared
  -     * @param onlyDeserFactory indicates if only deserialization is
        desired.
        */
       protected void myRegister(QName xmlType, Class javaType,
                                 SerializerFactory sf, DeserializerFactory
                                 df,
                                 boolean primitive) {
           myRegister(xmlType, javaType, sf, df, primitive, false);
       }
  +
  +    /**
  +     * Construct TypeMapping for all the [xmlType, javaType] for all of
  the
  +     * known xmlType namespaces
  +     * @param xmlType is the QName type
  +     * @param javaType is the java type
  +     * @param sf is the ser factory (if null, the simple factory is
  used)
  +     * @param df is the deser factory (if null, the simple factory is
  used)
  +     * @param primitive indicates whether serializers can be shared
  +     * @param onlyDeserFactory indicates if only deserialization is
  desired.
  +     */
       protected void myRegister(QName xmlType, Class javaType,
                                 SerializerFactory sf, DeserializerFactory
                                 df,
                                 boolean primitive, boolean
                                 onlyDeserFactory) {



  1.24      +13 -10
  xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java


  Index: DeserializationContextImpl.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/encoding/DeserializationContextImpl.java,v

  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- DeserializationContextImpl.java     12 Apr 2002 09:46:36 -0000
  1.23
  +++ DeserializationContextImpl.java     15 Apr 2002 02:35:57 -0000
  1.24
  @@ -111,7 +111,7 @@

       private SAX2EventRecorder recorder = new SAX2EventRecorder();
       private SOAPEnvelope envelope;
  -
  +

       /* A map of IDs -> IDResolvers */
       private HashMap idMap;
  @@ -225,6 +225,9 @@
       public void setCurElement(MessageElement el)
       {
           curElement = el;
  +        if (curElement.getRecorder() != recorder) {
  +            recorder = curElement.getRecorder();
  +        }
       }


  @@ -380,7 +383,7 @@
       /**
        * Convenenience method that returns true if the value is nil
        * (due to the xsi:nil) attribute.
  -     * @param attributes are the element attributes.
  +     * @param attrs are the element attributes.
        * @return true if xsi:nil is true
        */
       public boolean isNil(Attributes attrs) {
  @@ -472,7 +475,7 @@
        * not been processed.  If it is not a MessageElement, the Object is
        the
        * actual deserialized value.
        * In addition, this method is invoked to get Object values via
        Attachments.
  -     * @param id is the value of an href attribute (or an Attachment id)
  +     * @param href is the value of an href attribute (or an Attachment
  id)
        * @return MessageElement other Object or null
        */
       public Object getObjectByRef(String href) {
  @@ -508,18 +511,18 @@
        * @param id (id name without the #)
        * @param obj is the deserialized object for this id.
        */
  -    public void addObjectById(String _id, Object obj)
  +    public void addObjectById(String id, Object obj)
       {
           // The resolver uses the href syntax as the key.
  -        String id = "#" + _id;
  +        String idStr = "#" + id;
           if ((idMap == null) || (id == null))
               return ;

  -        IDResolver resolver = (IDResolver)idMap.get(id);
  +        IDResolver resolver = (IDResolver)idMap.get(idStr);
           if (resolver == null)
               return ;

  -        resolver.addReferencedObject(id, obj);
  +        resolver.addReferencedObject(idStr, obj);
           return;
       }

  @@ -640,6 +643,9 @@
                */
           }
           curElement = elem;
  +
  +        if (elem.getRecorder() != recorder)
  +            recorder = elem.getRecorder();
       }

       /****************************************************************
  @@ -802,9 +808,6 @@
       /**
        * startElement is called when an element is read.  This is the big
        work-horse.
        *
  -     * This is a big workhorse.  Manage the state of the parser, check
  for
  -     * basic SOAP compliance (envelope, then optional header, then body,
  etc).
  -     *
        * This guy also handles monitoring the recording depth if we're
        recording
        * (so we know when to stop).
        */



  1.20      +1 -1
  xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java

  Index: SerializationContextImpl.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/encoding/SerializationContextImpl.java,v

  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- SerializationContextImpl.java 8 Apr 2002 15:43:14 -0000     1.19
  +++ SerializationContextImpl.java 15 Apr 2002 02:35:57 -0000    1.20
  @@ -280,7 +280,7 @@
       {
           // Always allow the default mappings
           if (msgContext == null)
  -            return DefaultTypeMappingImpl.create();
  +            return DefaultTypeMappingImpl.getSingleton();

           String encodingStyle = msgContext.getEncodingStyle();
           if (encodingStyle == null)



  1.8       +1 -1
  xml-axis/java/src/org/apache/axis/encoding/TypeMappingRegistryImpl.java

  Index: TypeMappingRegistryImpl.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/encoding/TypeMappingRegistryImpl.java,v

  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TypeMappingRegistryImpl.java  27 Mar 2002 20:24:06 -0000    1.7
  +++ TypeMappingRegistryImpl.java  15 Apr 2002 02:35:57 -0000    1.8
  @@ -175,7 +175,7 @@
           mapTM = new HashMap();
           if
           (Constants.URI_CURRENT_SOAP_ENC.equals(Constants.URI_SOAP_ENC))
           {
               defaultDelTM =
  -                new TypeMappingImpl(DefaultTypeMappingImpl.create());
  +                new TypeMappingImpl(DefaultTypeMappingImpl.getSingleton
  ());
           } else {
               defaultDelTM =
                   new TypeMappingImpl(DefaultSOAP12TypeMappingImpl.create
                   ());



  1.57      +53 -18
  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.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- SOAPService.java  12 Apr 2002 09:46:36 -0000    1.56
  +++ SOAPService.java  15 Apr 2002 02:35:57 -0000    1.57
  @@ -58,39 +58,33 @@
   import org.apache.axis.AxisFault;
   import org.apache.axis.Constants;
   import org.apache.axis.Handler;
  -import org.apache.axis.handlers.BasicHandler;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
   import org.apache.axis.SimpleTargetedChain;
  -import org.apache.axis.description.OperationDesc;
   import org.apache.axis.description.ServiceDesc;
  -import org.apache.axis.providers.java.MsgProvider;
  -import org.apache.axis.encoding.DeserializerFactory;
  -import org.apache.axis.encoding.Serializer;
   import org.apache.axis.encoding.TypeMappingRegistry;
  -import org.apache.axis.encoding.TypeMapping;
   import org.apache.axis.encoding.TypeMappingRegistryImpl;
  +import org.apache.axis.encoding.TypeMapping;
  +import org.apache.axis.encoding.DefaultTypeMappingImpl;
  +import org.apache.axis.handlers.BasicHandler;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeaderElement;
   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.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
   import org.w3c.dom.Document;
  -import org.w3c.dom.Element;
  +import org.xml.sax.SAXException;

   import javax.xml.rpc.namespace.QName;
  -import java.util.Enumeration;
  -import java.util.Vector;
  +import java.io.FileInputStream;
   import java.util.ArrayList;
  -import java.util.HashMap;
  +import java.util.Enumeration;
   import java.util.Hashtable;
  -import java.beans.IntrospectionException;
  -import java.io.File;
  -import java.io.FileInputStream;
  +import java.util.Vector;

   /** A <code>SOAPService</code> is a Handler which encapsulates a SOAP
    * invocation.  It has an request chain, an response chain, and a
    pivot-point,
  @@ -121,6 +115,7 @@
        * metadata about this service.
        */
       private ServiceDesc serviceDescription = new ServiceDesc();
  +    private AxisEngine engine;

       /**
        * SOAPRequestHandler is used to inject SOAP semantics just before
  @@ -211,8 +206,6 @@

       private void initTypeMappingRegistry() {
           tmr = new TypeMappingRegistryImpl();
  -        // The TMR has the SOAP/XSD in the default TypeMapping
  -        //tmr.setParent(SOAPTypeMappingRegistry.getSingleton());
       }

       public TypeMappingRegistry getTypeMappingRegistry()
  @@ -239,7 +232,9 @@
        */
       public void setEngine(AxisEngine engine)
       {
  -        tmr.delegate(engine.getTypeMappingRegistry());
  +        this.engine = engine;
  +        if (engine != null)
  +            tmr.delegate(engine.getTypeMappingRegistry());
       }

       public boolean availableFromTransport(String transportName)
  @@ -265,6 +260,46 @@
       }

       public ServiceDesc getServiceDescription() {
  +        return serviceDescription;
  +    }
  +
  +    public ServiceDesc getInitializedServiceDesc(MessageContext
  msgContext) {
  +        if (serviceDescription.getImplClass() == null) {
  +            String clsName = (String)getOption("className");
  +
  +            if (clsName != null) {
  +                ClassLoader cl = null;
  +                if (msgContext == null) {
  +                    cl = Thread.currentThread().getContextClassLoader();
  +                } else {
  +                    cl = msgContext.getClassLoader();
  +                }
  +                if (engine != null) {
  +                    ClassCache cache     = engine.getClassCache();
  +                    JavaClass       jc   = null;
  +                    try {
  +                        jc = cache.lookup(clsName, cl);
  +                        serviceDescription.setImplClass(jc.getJavaClass
  ());
  +                    } catch (ClassNotFoundException e) {
  +                        return null;
  +                    }
  +                } else {
  +                    try {
  +                        Class cls = cl.loadClass(clsName);
  +                        serviceDescription.setImplClass(cls);
  +                    } catch (ClassNotFoundException e) {
  +                        return null; // FIXME - throw?
  +                    }
  +                }
  +                TypeMapping tm;
  +                if (msgContext == null) {
  +                    tm = DefaultTypeMappingImpl.getSingleton();
  +                } else {
  +                    tm = msgContext.getTypeMapping();
  +                }
  +                serviceDescription.setTypeMapping(tm);
  +            }
  +        }
           return serviceDescription;
       }




  1.25      +3 -5
  xml-axis/java/src/org/apache/axis/message/BodyBuilder.java

  Index: BodyBuilder.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/message/BodyBuilder.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- BodyBuilder.java  25 Mar 2002 04:44:02 -0000    1.24
  +++ BodyBuilder.java  15 Apr 2002 02:35:57 -0000    1.25
  @@ -62,12 +62,8 @@

   import org.apache.axis.Constants;
   import org.apache.axis.MessageContext;
  -import org.apache.axis.AxisFault;
  -import org.apache.axis.Handler;
  -import org.apache.axis.ConfigurationException;
   import org.apache.axis.description.OperationDesc;
   import org.apache.axis.description.ServiceDesc;
  -import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.encoding.DeserializationContext;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.commons.logging.Log;
  @@ -154,7 +150,9 @@
               handler = new SOAPHandler();

           handler.myElement = element;
  -
  +
  +        //context.pushNewElement(element);
  +
           if (log.isDebugEnabled()) {
               log.debug(JavaUtils.getMessage("exit00",
               "BodyBuilder.onStartChild()"));
           }



  1.52      +2 -21
  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.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- RPCElement.java   11 Apr 2002 16:24:18 -0000    1.51
  +++ RPCElement.java   15 Apr 2002 02:35:57 -0000    1.52
  @@ -144,27 +144,8 @@

           // Obtain our possible operations
           if (service != null) {
  -            ServiceDesc serviceDesc = service.getServiceDescription();
  -
  -            if (serviceDesc.getImplClass() == null) {
  -                String clsName = (String)service.getOption("className");
  -
  -                if (clsName != null) {
  -                    ClassLoader cl       = msgContext.getClassLoader();
  -                    ClassCache cache     = msgContext.getAxisEngine().
  -                            getClassCache();
  -                    JavaClass       jc   = null;
  -                    try {
  -                        jc = cache.lookup(clsName, cl);
  -                    } catch (ClassNotFoundException e) {
  -                        throw new SAXException(e);
  -                    }
  -                    TypeMapping tm = msgContext.getTypeMapping();
  -                    serviceDesc.setTypeMapping(tm);
  -                    serviceDesc.setImplClass(jc.getJavaClass());
  -                }
  -            }
  -
  +            ServiceDesc serviceDesc =
  service.getInitializedServiceDesc(msgContext);
  +
               // If we've got a service description now, we want to use
               // the matching operations in there.
               QName qname = new QName(namespaceURI, name);



  1.33      +0 -8
  xml-axis/java/src/org/apache/axis/message/RPCHandler.java

  Index: RPCHandler.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/message/RPCHandler.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- RPCHandler.java   5 Apr 2002 21:24:33 -0000     1.32
  +++ RPCHandler.java   15 Apr 2002 02:35:57 -0000    1.33
  @@ -61,27 +61,19 @@
    */

   import org.apache.axis.Constants;
  -import org.apache.axis.Handler;
  -import org.apache.axis.Message;
  -import org.apache.axis.MessageContext;
   import org.apache.axis.description.OperationDesc;
   import org.apache.axis.description.ParameterDesc;
  -import org.apache.axis.client.Call;
   import org.apache.axis.encoding.DeserializationContext;
   import org.apache.axis.encoding.Deserializer;
   import org.apache.axis.encoding.DeserializerImpl;
  -import org.apache.axis.encoding.TypeMapping;
   import org.apache.axis.encoding.FieldTarget;
   import org.apache.axis.utils.JavaUtils;
  -import org.apache.axis.utils.cache.JavaClass;
  -import org.apache.axis.utils.cache.ClassCache;
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXException;

   import javax.xml.rpc.namespace.QName;
  -import java.lang.reflect.Method;
   import java.util.Vector;

   /**



  1.41      +2 -7
  xml-axis/java/src/org/apache/axis/utils/JavaUtils.java

  Index: JavaUtils.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/utils/JavaUtils.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- JavaUtils.java    2 Apr 2002 21:24:40 -0000     1.40
  +++ JavaUtils.java    15 Apr 2002 02:35:58 -0000    1.41
  @@ -389,11 +389,6 @@
                   return true;
           }

  -//        // FIXME : This is a horrible hack put in here to deal with a
  problem
  -//        // with our default typemappings.
  -//        if (destHeld != null && (getPrimitiveClass(destHeld) == src))
  -//            return true;
  -
           // If it's holder -> held or held -> holder, we're good
           Class srcHeld = JavaUtils.getHolderValueType(src);
           if (srcHeld != null) {
  @@ -717,8 +712,8 @@
        * Like String.replace except that the old new items are strings.
        *
        * @param name string
  -     * @param oldt old text to replace
  -     * @param newt new text to use
  +     * @param oldT old text to replace
  +     * @param newT new text to use
        * @return replacement string
        **/
       public static final String replace (String name,



  1.91      +2 -1
  xml-axis/java/src/org/apache/axis/utils/resources.properties

  Index: resources.properties
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/utils/resources.properties,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- resources.properties    11 Apr 2002 15:45:09 -0000    1.90
  +++ resources.properties    15 Apr 2002 02:35:58 -0000    1.91
  @@ -799,7 +799,8 @@
   attach.bounday.mns=Marking streams not supported.
   noSuchOperation=No such operation ''{0}''

  -optionUsername=username to access the WSDL-URI
  +optionUsername=username to access the WSDL-URI
   optionPassword=password to access the WSDL-URI
   cantGetDoc00=Unable to retrieve WSDL document: {0}
  +implAlreadySet=Attempt to set implementation class on a ServiceDesc
  which has already been configured




  1.13      +1 -1
  xml-axis/java/src/org/apache/axis/wsdl/Java2WSDL.java

  Index: Java2WSDL.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/Java2WSDL.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Java2WSDL.java    19 Mar 2002 15:42:02 -0000    1.12
  +++ Java2WSDL.java    15 Apr 2002 02:35:58 -0000    1.13
  @@ -318,7 +318,7 @@
                           String value = option.getArgument();
                           if (value.equals("1.1")) {
                               emitter.setDefaultTypeMapping(
  -                                DefaultTypeMappingImpl.create());
  +                                DefaultTypeMappingImpl.getSingleton());
                           } else if (value.equals("1.2")) {
                               emitter.setDefaultTypeMapping(
                                   DefaultSOAP12TypeMappingImpl.create());



  1.24      +1 -1
  xml-axis/java/src/org/apache/axis/wsdl/WSDL2Java.java

  Index: WSDL2Java.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/WSDL2Java.java,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- WSDL2Java.java    12 Apr 2002 14:17:49 -0000    1.23
  +++ WSDL2Java.java    15 Apr 2002 02:35:58 -0000    1.24
  @@ -742,7 +742,7 @@
           if (typeMappingVersion.equals("1.1")) {
               writerFactory.setBaseTypeMapping(
                       new BaseTypeMapping() {
  -                        final TypeMapping defaultTM =
  DefaultTypeMappingImpl.create();
  +                        final TypeMapping defaultTM =
  DefaultTypeMappingImpl.getSingleton();
                           public String getBaseName(QName qNameIn) {
                               javax.xml.rpc.namespace.QName qName =
                                   new javax.xml.rpc.namespace.QName(



  1.29      +0 -1
  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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- Emitter.java      3 Apr 2002 06:09:55 -0000     1.28
  +++ Emitter.java      15 Apr 2002 02:35:58 -0000    1.29
  @@ -786,7 +786,6 @@
           retParam.setTypeQName(desc.getReturnType());
           retParam.setJavaType(desc.getReturnClass());
           retParam.setMode(ParameterDesc.OUT);
  -        // FIXME : Set Java type??
           writePartToMessage(def, msg, false, retParam);

           ArrayList parameters = desc.getParameters();



  1.36      +5 -5
  xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java

  Index: JavaDeployWriter.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaDeployWriter.java,v

  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- JavaDeployWriter.java   12 Apr 2002 21:25:52 -0000    1.35
  +++ JavaDeployWriter.java   15 Apr 2002 02:35:58 -0000    1.36
  @@ -203,7 +203,7 @@
                   }
                   writeTypeMapping(namespaceURI, localPart, javaType,
                   serializerFactory,
                                    deserializerFactory, encodingStyle);
  -            }
  +                }
           }
       } //writeDeployTypes

  @@ -220,8 +220,8 @@
           pw.println("        serializer=\"" + serializerFactory + "\"");
           pw.println("        deserializer=\"" + deserializerFactory + "
           \"");
           pw.println("        encodingStyle=\"" + encodingStyle + "\"");
  -        pw.println("      />");
  -    }
  +                pw.println("      />");
  +            }

       /**
        * Write out deployment and undeployment instructions for given WSDL
        port
  @@ -339,7 +339,7 @@
                           paramQName = param.getQName();
                           if (paramQName == null ||
                           "".equals(paramQName.getNamespaceURI())) {
                               paramQName = new QName("", param.getName());
  -                        }
  +                        }

                           // Get the parameter mode
                           if (param.getMode() != Parameter.IN) {
  @@ -357,7 +357,7 @@

           pw.print("      <parameter name=\"allowedMethods\" value=\"");
           if (methodList.length() == 0) {
  -            pw.println("\"/>");
  +            pw.println("*\"/>");
           }
           else {
               pw.println(methodList.substring(1) + "\"/>");



  1.21      +34 -65
  xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java

  Index: JavaSkelWriter.java
  ===================================================================
  RCS file:
  /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/JavaSkelWriter.java,v

  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- JavaSkelWriter.java     1 Apr 2002 20:12:17 -0000     1.20
  +++ JavaSkelWriter.java     15 Apr 2002 02:35:58 -0000    1.21
  @@ -56,7 +56,6 @@

   import java.io.IOException;

  -import java.util.HashMap;
   import java.util.Iterator;
   import java.util.List;

  @@ -67,7 +66,6 @@
   import javax.wsdl.Operation;
   import javax.wsdl.OperationType;
   import javax.wsdl.PortType;
  -import javax.wsdl.QName;

   import javax.wsdl.extensions.ExtensibilityElement;

  @@ -129,6 +127,10 @@
           pw.println("        return
           (org.apache.axis.description.OperationDesc)
           _myOperations.get(methodName);");
           pw.println("    }");
           pw.println();
  +        pw.println("    public static java.util.Collection
  getOperationDescs() {");
  +        pw.println("        return _myOperations.values();");
  +        pw.println("    }");
  +        pw.println();

           // Initialize operation parameter names
           pw.println("    static {");
  @@ -142,7 +144,8 @@

               if (parameters != null) {
                   // The invoked java name of the operation is stored.
  -                String opName =
  Utils.xmlNameToJava(operation.getOperation().getName());
  +                String opName = operation.getOperation().getName();
  +                String javaOpName = Utils.xmlNameToJava(opName);
                   pw.println("        _params = new
                   org.apache.axis.description.ParameterDesc [] {");

                   for (int j=0; j < parameters.list.size(); j++) {
  @@ -167,66 +170,7 @@
                   }

                   pw.println("        };");
  -//                if (parameters.returnType != null) {
  -//                    pw.println("                   " +
  -//
  Utils.getNewQName(parameters.returnName) + ",");
  -//                } else {
  -//                    pw.println("                   null,");
  -//                }
  -
  -//                // Find the input clause's namespace
  -//                BindingInput input = operation.getBindingInput();
  -//                if (input == null) {
  -//                    pw.println("                 null,");
  -//                }
  -//                else {
  -//                    List elems = input.getExtensibilityElements();
  -//                    boolean found = false;
  -//                    Iterator it = elems.iterator();
  -//                    while (!found && it.hasNext()) {
  -//                        ExtensibilityElement elem
  = (ExtensibilityElement) it.next();
  -//                        if (elem instanceof SOAPBody) {
  -//                            SOAPBody body = (SOAPBody) elem;
  -//                            String ns = body.getNamespaceURI();
  -//                            if (ns != null) {
  -//                                pw.println("                 \"" + ns
  + "\",");
  -//                                found = true;
  -//                            }
  -//                        }
  -//                    }
  -//                    if (!found) {
  -//                        pw.println("                 null,");
  -//                    }
  -//                }
  -//
  -//                // Find the output clause's namespace
  -//                BindingOutput output = operation.getBindingOutput();
  -//                if (output == null) {
  -//                    pw.println("                 null,");
  -//                }
  -//                else {
  -//                    List elems = output.getExtensibilityElements();
  -//                    Iterator it = elems.iterator();
  -//                    boolean found = false;
  -//                    while (!found && it.hasNext()) {
  -//                        ExtensibilityElement elem
  = (ExtensibilityElement) it.next();
  -//                        if (elem instanceof SOAPBody) {
  -//                            SOAPBody body = (SOAPBody) elem;
  -//                            String ns = body.getNamespaceURI();
  -//                            if (ns != null) {
  -//                                pw.println("                 \"" + ns
  + "\",");
  -//                                found = true;
  -//                            }
  -//                        }
  -//                    }
  -//                    if (!found) {
  -//                        pw.println("                 null,");
  -//                    }
  -//                }
  -//
  -//                if (!found) {
  -//                    pw.println("                 null);");
  -//                }
  +
                   String returnStr;
                   if (parameters.returnType != null) {
                       returnStr =
  Utils.getNewQName(parameters.returnName);
  @@ -234,7 +178,32 @@
                       returnStr = "null";
                   }
                   pw.println("        _oper = new
                   org.apache.axis.description.OperationDesc(\"" +
  -                            opName + "\", _params, " + returnStr +
  ");");
  +                            javaOpName + "\", _params, " + returnStr +
  ");");
  +
  +                String ns = "";
  +                BindingInput input = operation.getBindingInput();
  +                if (input != null) {
  +                    List elems = input.getExtensibilityElements();
  +                    Iterator it = elems.iterator();
  +                    while (it.hasNext()) {
  +                        ExtensibilityElement elem
  = (ExtensibilityElement) it.next();
  +                        if (elem instanceof SOAPBody) {
  +                            SOAPBody body = (SOAPBody) elem;
  +                            ns = body.getNamespaceURI();
  +                            break;
  +                        }
  +                    }
  +                }
  +
  +                // If we need to know the QName (if we have a namespace
  or
  +                // the actual method name doesn't match the XML we
  expect),
  +                // record it in the OperationDesc
  +                if (!"".equals(ns) || !javaOpName.equals(opName)) {
  +                    javax.xml.rpc.namespace.QName qn =
  +                            new javax.xml.rpc.namespace.QName(ns,
  opName);
  +                    pw.println("        _oper.setElementQName(" +
  +                            Utils.getNewQName(qn) + ");");
  +                }

                   // Find the SOAPAction.
                   List elems = operation.getExtensibilityElements();
  @@ -252,7 +221,7 @@
                       }
                   }

  -                pw.println("        _myOperations.put(\"" + opName + "
  \", _oper);");
  +                pw.println("        _myOperations.put(\"" + javaOpName +
  "\", _oper);");
               }
           }
           pw.println("    }");



  1.17      +13 -6
  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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- TestArrayListConversions.java 22 Mar 2002 16:08:32 -0000    1.16
  +++ TestArrayListConversions.java 15 Apr 2002 02:35:58 -0000    1.17
  @@ -8,6 +8,8 @@
   import org.apache.axis.server.AxisServer;
   import org.apache.axis.transport.local.LocalTransport;
   import org.apache.axis.configuration.SimpleProvider;
  +import org.apache.axis.encoding.DefaultTypeMappingImpl;
  +import org.apache.axis.description.ServiceDesc;

   import javax.xml.rpc.namespace.QName;
   import java.util.Iterator;
  @@ -19,6 +21,7 @@
       private static final String SERVICE_NAME = "TestArrayConversions";

       private AxisServer server;
  +    private LocalTransport transport;

       public TestArrayListConversions() {
           super("service");
  @@ -26,7 +29,6 @@

       public TestArrayListConversions(String name) {
           super(name);
  -        init();
       }

       private static boolean equals(List list, Object obj) {
  @@ -47,11 +49,16 @@
           return true;
       }

  -    public void init() {
  +    protected void setUp() throws Exception {
           try {
               SimpleProvider provider = new SimpleProvider();
               server = new AxisServer(provider);
  +            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", "*");

  @@ -64,7 +71,7 @@

       public void testVectorConversion() throws Exception {
           Call call = new Call(new Service());
  -        call.setTransport(new LocalTransport(server));
  +        call.setTransport(transport);

           Vector v = new Vector();
           v.addElement("Hi there!");
  @@ -76,7 +83,7 @@

       public void testLinkedListConversion() throws Exception {
           Call call = new Call(new Service());
  -        call.setTransport(new LocalTransport(server));
  +        call.setTransport(transport);

           LinkedList l = new LinkedList();
           l.add("Linked list item #1");
  @@ -90,7 +97,7 @@

       public void testArrayConversion() throws Exception {
           Call call = new Call(new Service());
  -        call.setTransport(new LocalTransport(server));
  +        call.setTransport(transport);

           Vector v = new Vector();
           v.addElement("Hi there!");
  @@ -108,7 +115,7 @@
        */
       public void testReturnAsVector() throws Exception {
           Call call = new Call(new Service());
  -        call.setTransport(new LocalTransport(server));
  +        call.setTransport(transport);

           LinkedList l = new LinkedList();
           l.add("Linked list item #1");



  1.12      +0 -3      xml-axis/java/test/encoding/TestXsiType.java

  Index: TestXsiType.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/encoding/TestXsiType.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TestXsiType.java  28 Jan 2002 18:23:03 -0000    1.11
  +++ TestXsiType.java  15 Apr 2002 02:35:58 -0000    1.12
  @@ -25,9 +25,6 @@
    * as expected.
    */
   public class TestXsiType extends TestCase {
  -
  -    private String header;
  -    private String footer;
       private SimpleProvider provider = new SimpleProvider();
       private AxisServer server = new AxisServer(provider);




  1.10      +1 -1      xml-axis/java/test/wsdl/Java2WsdlAntTask.java

  Index: Java2WsdlAntTask.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/Java2WsdlAntTask.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Java2WsdlAntTask.java   20 Feb 2002 17:17:36 -0000    1.9
  +++ Java2WsdlAntTask.java   15 Apr 2002 02:35:58 -0000    1.10
  @@ -122,7 +122,7 @@
                   emitter.setStopClasses(stopClasses);

               if (tm.equals("1.1")) {
  -
  emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.create());
  +
  emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.getSingleton());
               } else {
                   emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create

                   ));
               }






Mime
View raw message