axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sc...@apache.org
Subject cvs commit: xml-axis/java/src/org/apache/axis/utils Admin.java JavaUtils.java
Date Sat, 26 Jan 2002 02:50:52 GMT
scheu       02/01/25 18:50:52

  Modified:    java/src/javax/xml/rpc/encoding TypeMappingRegistry.java
               java/src/org/apache/axis AxisEngine.java Constants.java
                        SOAPPart.java
               java/src/org/apache/axis/client Call.java ServiceClient.java
               java/src/org/apache/axis/deployment DeploymentRegistry.java
                        SimpleDeploymentManager.java
               java/src/org/apache/axis/deployment/wsdd
                        WSDDBeanMapping.java WSDDDeployment.java
                        WSDDDocument.java WSDDService.java
                        WSDDTypeMapping.java WSDDUndeployment.java
               java/src/org/apache/axis/handlers DebugHandler.java
                        SimpleSessionHandler.java
               java/src/org/apache/axis/handlers/soap SOAPService.java
               java/src/org/apache/axis/providers/java RPCProvider.java
               java/src/org/apache/axis/utils Admin.java JavaUtils.java
  Log:
  (See prior commits...more still coming)
  
  Revision  Changes    Path
  1.8       +5 -5      xml-axis/java/src/javax/xml/rpc/encoding/TypeMappingRegistry.java
  
  Index: TypeMappingRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/javax/xml/rpc/encoding/TypeMappingRegistry.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TypeMappingRegistry.java	16 Jan 2002 16:41:36 -0000	1.7
  +++ TypeMappingRegistry.java	26 Jan 2002 02:50:51 -0000	1.8
  @@ -69,10 +69,10 @@
   
       /**
        * The method register adds a TypeMapping instance for a specific 
  -     * web service namespace.                        
  +     * namespace                        
        *
        * @param mapping - TypeMapping for specific type namespaces
  -     * @param namespaceURIs - Web service namespace
  +     * @param namespaceURIs
        *
        * @throws JAXRPCException - If there is any error in the registration
        * of the TypeMapping for the specified namespace URI
  @@ -95,10 +95,10 @@
           throws JAXRPCException;
   
       /**
  -     * Gets the TypeMapping for the Web Service namespace.  If not found, the default TypeMapping 
  +     * Gets the TypeMapping namespace.  If not found, the default TypeMapping 
        * is returned.
        *
  -     * @param namespaceURI - The namespace URI of a Web Service
  +     * @param namespaceURI - The namespace URI
        * @return The registered TypeMapping (which may be the default TypeMapping) or null.
        */
       public TypeMapping getTypeMapping(String namespaceURI);
  @@ -106,7 +106,7 @@
       /**
        * Removes the TypeMapping for the namespace.
        *
  -     * @param namespaceURI - The namespace URI of a type
  +     * @param namespaceURI - The namespace URI
        * @return The registered TypeMapping or null.
        */
       public TypeMapping removeTypeMapping(String namespaceURI);
  
  
  
  1.64      +5 -39     xml-axis/java/src/org/apache/axis/AxisEngine.java
  
  Index: AxisEngine.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisEngine.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- AxisEngine.java	3 Jan 2002 17:12:36 -0000	1.63
  +++ AxisEngine.java	26 Jan 2002 02:50:51 -0000	1.64
  @@ -59,9 +59,10 @@
   import org.apache.axis.deployment.DeploymentException;
   import org.apache.axis.deployment.wsdd.*;
   import org.apache.axis.encoding.DeserializerFactory;
  -import org.apache.axis.encoding.SOAPTypeMappingRegistry;
  +import org.apache.axis.encoding.TypeMapping;
   import org.apache.axis.encoding.Serializer;
   import org.apache.axis.encoding.TypeMappingRegistry;
  +import org.apache.axis.encoding.TypeMappingRegistryImpl;
   import org.apache.axis.handlers.BasicHandler;
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.InternalException;
  @@ -178,7 +179,8 @@
               category.debug(JavaUtils.getMessage("enter00", "AxisEngine::init"));
           }
   
  -        getTypeMappingRegistry().setParent(SOAPTypeMappingRegistry.getSingleton());
  +        // The SOAP/XSD stuff is in the default TypeMapping of the TypeMappingRegistry.
  +        //getTypeMappingRegistry().setParent(SOAPTypeMappingRegistry.getSingleton());
   
           try {
               configProvider.configureEngine(this);
  @@ -252,15 +254,7 @@
       public TypeMappingRegistry getTypeMappingRegistry()
       {
           TypeMappingRegistry tmr = null;
  -        try {
  -            tmr = myRegistry.getTypeMappingRegistry("");
  -            if (tmr == null) {
  -                tmr = new TypeMappingRegistry();
  -                myRegistry.addTypeMappingRegistry("", tmr);
  -            }
  -        } catch (DeploymentException e) {
  -            category.error(e);
  -        }
  +        tmr = myRegistry.getTypeMappingRegistry();
           
           return tmr;
       }
  @@ -325,34 +319,6 @@
       *
       *********************************************************************
       */
  -
  -    /**
  -     * Register a new global type mapping
  -     */
  -    public void registerTypeMapping(QName qName,
  -                                    Class cls,
  -                                    DeserializerFactory deserFactory,
  -                                    Serializer serializer)
  -        throws IntrospectionException
  -    {
  -        category.info(JavaUtils.getMessage("registerTypeMap00",
  -                qName.toString(), cls.getName()));
  -        if (deserFactory != null)
  -            getTypeMappingRegistry().addDeserializerFactory(qName,
  -                                                        cls,
  -                                                        deserFactory);
  -        if (serializer != null)
  -            getTypeMappingRegistry().addSerializer(cls, qName, serializer);
  -    }
  -
  -    /**
  -     * Unregister a global type mapping
  -     */
  -    public void unregisterTypeMapping(QName qName, Class cls)
  -    {
  -        getTypeMappingRegistry().removeDeserializer(qName);
  -        getTypeMappingRegistry().removeSerializer(cls);
  -    }
   
       /**
        * List of options which should be converted from Strings to Booleans
  
  
  
  1.46      +75 -1     xml-axis/java/src/org/apache/axis/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Constants.java,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- Constants.java	3 Jan 2002 17:12:36 -0000	1.45
  +++ Constants.java	26 Jan 2002 02:50:51 -0000	1.46
  @@ -56,7 +56,7 @@
   package org.apache.axis;
   
   import org.apache.axis.utils.QFault;
  -
  +import org.xml.sax.Attributes;
   import javax.xml.rpc.namespace.QName;
   
   public class Constants {
  @@ -138,6 +138,40 @@
           return false;
       }
   
  +    /**
  +     * getValue
  +     * This utility routine returns the value of the attribute represented by the qname
  +     * namespaceURI:localPart.  If the namespaceURI is one of the current known namespaces
  +     * (like URI_CURRENT_SCHEMA_XSD), then all of the known qnames for this item are 
  +     * searched.
  +     * @param attributes are the attributes to search
  +     * @param namespaceURI is the current known namespace for the attribute name
  +     * @param localPart is the local part of the attribute name
  +     * @return the value of the attribute or null
  +     */
  +    public static String getValue(Attributes attributes, String namespaceURI, String localPart) {
  +        if (attributes == null || namespaceURI == null || localPart == null)
  +            return null;
  +        String[] search = null;
  +        if (namespaceURI.equals(URI_CURRENT_SOAP_ENC)) 
  +            search = URIS_SOAP_ENC;
  +        else if (namespaceURI.equals(URI_CURRENT_SOAP_ENV))
  +            search = URIS_SOAP_ENV;
  +        else if (namespaceURI.equals(URI_CURRENT_SCHEMA_XSD))
  +            search = URIS_SCHEMA_XSD;
  +        else if (namespaceURI.equals(URI_CURRENT_SCHEMA_XSI))
  +            search = URIS_SCHEMA_XSI;
  +        else
  +            search = new String[] {namespaceURI};
  +        // Now look for an attribute value
  +        for (int i=0; i < search.length; i++) {
  +            String value = attributes.getValue(search[i], localPart);
  +            if (value != null) {
  +                return value;
  +            }
  +        }
  +        return null;
  +    }
   
       // Misc SOAP Namespaces
       public static final String URI_NEXT_ACTOR = 
  @@ -278,6 +312,8 @@
           return false;
       }
   
  +    // Axis Mechanism Type
  +    public static final String AXIS_SAX = "Axis SAX Mechanism";
   
       public static final String ELEM_ENVELOPE = "Envelope" ;
       public static final String ELEM_HEADER   = "Header" ;
  @@ -327,6 +363,44 @@
                                           new QName(URI_SOAP_ENV, ELEM_FAULT_ACTOR);
       public static final QName QNAME_FAULTDETAILS =
                                            new QName(URI_SOAP_ENV, ELEM_FAULT_DETAIL);
  +
  +
  +    // Define qnames for the all of the XSD and SOAP-ENC encodings
  +    public static final QName XSD_STRING = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "string");
  +    public static final QName XSD_BOOLEAN = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "boolean");
  +    public static final QName XSD_DOUBLE = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "double");
  +    public static final QName XSD_FLOAT = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "float");
  +    public static final QName XSD_INT = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "int");
  +    public static final QName XSD_INTEGER = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "integer");
  +    public static final QName XSD_LONG = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "long");
  +    public static final QName XSD_SHORT = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "short");
  +    public static final QName XSD_BYTE = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "byte");
  +    public static final QName XSD_DECIMAL = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "decimal");
  +    public static final QName XSD_BASE64 = new QName(Constants.URI_2001_SCHEMA_XSD, "base64Binary");
  +    public static final QName XSD_HEXBIN = new QName(Constants.URI_2001_SCHEMA_XSD, "hexBinary");
  +    public static final QName XSD_ANYTYPE = new QName(Constants.URI_2001_SCHEMA_XSD, "anyType");
  +    public static final QName XSD_QNAME = new QName(Constants.URI_2001_SCHEMA_XSD, "QName");
  +    public static final QName SOAP_BASE64 = new QName(Constants.URI_CURRENT_SOAP_ENC, "base64");
  +
  +    public static final QName SOAP_STRING = new QName(Constants.URI_CURRENT_SOAP_ENC, "string");
  +    public static final QName SOAP_BOOLEAN = new QName(Constants.URI_CURRENT_SOAP_ENC, "boolean");
  +    public static final QName SOAP_DOUBLE = new QName(Constants.URI_CURRENT_SOAP_ENC, "double");
  +    public static final QName SOAP_FLOAT = new QName(Constants.URI_CURRENT_SOAP_ENC, "float");
  +    public static final QName SOAP_INT = new QName(Constants.URI_CURRENT_SOAP_ENC, "int");
  +    public static final QName SOAP_LONG = new QName(Constants.URI_CURRENT_SOAP_ENC, "long");
  +    public static final QName SOAP_SHORT = new QName(Constants.URI_CURRENT_SOAP_ENC, "short");
  +    public static final QName SOAP_BYTE = new QName(Constants.URI_CURRENT_SOAP_ENC, "byte");
  +    public static final QName SOAP_INTEGER = new QName(Constants.URI_CURRENT_SOAP_ENC, "integer");
  +    public static final QName SOAP_DECIMAL = new QName(Constants.URI_CURRENT_SOAP_ENC, "decimal");
  +    public static final QName SOAP_ARRAY = new QName(Constants.URI_CURRENT_SOAP_ENC, "Array");
  +
  +    public static final QName SOAP_MAP = new QName("http://xml.apache.org/xml-soap", "Map");
  +    public static final QName SOAP_ELEMENT = new QName("http://xml.apache.org/xml-soap", "Element");
  +    public static final QName SOAP_VECTOR = new QName("http://xml.apache.org/xml-soap", "Vector");
  +
  +    public static       QName XSD_DATE = new QName(Constants.URI_CURRENT_SCHEMA_XSD, "dateTime");
  +    public static       QName XSD_DATE2= new QName(Constants.URI_1999_SCHEMA_XSD,    "timeInstant");
  +    public static       QName XSD_DATE3= new QName(Constants.URI_2000_SCHEMA_XSD,    "timeInstant");
       
       // Misc Strings
       //////////////////////////////////////////////////////////////////////////
  
  
  
  1.6       +5 -3      xml-axis/java/src/org/apache/axis/SOAPPart.java
  
  Index: SOAPPart.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/SOAPPart.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SOAPPart.java	10 Dec 2001 17:28:03 -0000	1.5
  +++ SOAPPart.java	26 Jan 2002 02:50:51 -0000	1.6
  @@ -56,7 +56,9 @@
   package org.apache.axis ;
   
   import org.apache.axis.encoding.DeserializationContext;
  +import org.apache.axis.encoding.DeserializationContextImpl;
   import org.apache.axis.encoding.SerializationContext;
  +import org.apache.axis.encoding.SerializationContextImpl;
   import org.apache.axis.message.InputStreamBody;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.log4j.Category;
  @@ -313,7 +315,7 @@
               StringWriter writer = new StringWriter();
               AxisFault env = (AxisFault)currentMessage;
               try {
  -                env.output(new SerializationContext(writer, getMessage().getMessageContext()));
  +                env.output(new SerializationContextImpl(writer, getMessage().getMessageContext()));
               } catch (Exception e) {
                   e.printStackTrace();
                   return null;
  @@ -326,7 +328,7 @@
               StringWriter writer = new StringWriter();
               SOAPEnvelope env = (SOAPEnvelope)currentMessage;
               try {
  -                env.output(new SerializationContext(writer, getMessage().getMessageContext()));
  +                env.output(new SerializationContextImpl(writer, getMessage().getMessageContext()));
               } catch (Exception e) {
                   e.printStackTrace();
                   return null;
  @@ -371,7 +373,7 @@
               is = new InputSource(new StringReader(getAsString()));
           }
           DeserializationContext dser =
  -            new DeserializationContext(is, getMessage().getMessageContext(), getMessage().getMessageType());
  +            new DeserializationContextImpl(is, getMessage().getMessageContext(), getMessage().getMessageType());
   
           // This may throw a SAXException
           try {
  
  
  
  1.64      +50 -17    xml-axis/java/src/org/apache/axis/client/Call.java
  
  Index: Call.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Call.java,v
  retrieving revision 1.63
  retrieving revision 1.64
  diff -u -r1.63 -r1.64
  --- Call.java	23 Jan 2002 18:10:07 -0000	1.63
  +++ Call.java	26 Jan 2002 02:50:51 -0000	1.64
  @@ -62,9 +62,14 @@
   import org.apache.axis.SOAPPart;
   import org.apache.axis.configuration.FileProvider;
   import org.apache.axis.encoding.DeserializerFactory;
  +import org.apache.axis.encoding.SerializerFactory;
  +import org.apache.axis.encoding.ser.BaseSerializerFactory;
  +import org.apache.axis.encoding.ser.BaseDeserializerFactory;
   import org.apache.axis.encoding.SerializationContext;
  +import org.apache.axis.encoding.SerializationContextImpl;
   import org.apache.axis.encoding.Serializer;
   import org.apache.axis.encoding.TypeMappingRegistry;
  +import org.apache.axis.encoding.TypeMapping;
   import org.apache.axis.message.RPCElement;
   import org.apache.axis.message.RPCParam;
   import org.apache.axis.message.SOAPBodyElement;
  @@ -138,7 +143,7 @@
       private Vector             paramNames      = null ;
       private Vector             paramTypes      = null ;
       private Vector             paramModes      = null ;
  -    private String             encodingStyle   = Constants.URI_SOAP_ENC ;
  +    private String             encodingStyle   = Constants.URI_CURRENT_SOAP_ENC ;
       private QName              returnType      = null ;
   
       private MessageContext     msgContext      = null ;
  @@ -1063,18 +1068,53 @@
       }
   
       /**
  -     * Map a type for serialization.
  +     * Register type mapping information for serialization/deserialization
        *
        * Note: Not part of JAX-RPC specification.
        *
  -     * @param _class the Java class of the data type.
  -     * @param qName the xsi:type QName of the associated XML type.
  -     * @param serializer a Serializer which will be used to write the XML.
  +     * @param javaType is  the Java class of the data type.
  +     * @param xmlType the xsi:type QName of the associated XML type.
  +     * @param sf/df are the factories (or the Class objects of the factory).
  +     * @param force Indicates whether to add the information if already registered.
        */
  -    public void addSerializer(Class _class, QName qName,
  -                              Serializer serializer){
  -        TypeMappingRegistry typeMap = msgContext.getTypeMappingRegistry();
  -        typeMap.addSerializer(_class, qName, serializer);
  +    public void registerTypeMapping(Class javaType, QName xmlType,
  +                                    SerializerFactory sf,
  +                                    DeserializerFactory df) {
  +        registerTypeMapping(javaType, xmlType, sf, df, true);
  +    }
  +    public void registerTypeMapping(Class javaType, QName xmlType,
  +                                    SerializerFactory sf,
  +                                    DeserializerFactory df,
  +                                    boolean force) {
  +        // Get the TypeMappingRegistry
  +        TypeMappingRegistry tmr = msgContext.getTypeMappingRegistry();
  +
  +        // If a TypeMapping is not available, add one.
  +        TypeMapping tm = (TypeMapping) tmr.getTypeMapping(Constants.URI_CURRENT_SOAP_ENC); 
  +        try {
  +            if (tm == null) {
  +                tm = (TypeMapping) tmr.createTypeMapping();
  +                tmr.register(tm, new String[] {Constants.URI_CURRENT_SOAP_ENC});
  +            }
  +            if (!force && tm.getClassForQName(xmlType) != null) 
  +                return;
  +
  +            // Register the information
  +            tm.register(javaType, xmlType, sf, df);
  +        } catch (Exception e) {}
  +    }
  +    public void registerTypeMapping(Class javaType, QName xmlType,
  +                                    Class sfClass, Class dfClass) {
  +        registerTypeMapping(javaType, xmlType, sfClass, dfClass, true);
  +    }
  +    public void registerTypeMapping(Class javaType, QName xmlType,
  +                                    Class sfClass, Class dfClass, boolean force){
  +        // Instantiate the factory using introspection.
  +        SerializerFactory   sf = BaseSerializerFactory.createFactory  (sfClass, javaType, xmlType);
  +        DeserializerFactory df = BaseDeserializerFactory.createFactory(dfClass, javaType, xmlType);
  +        if (sf != null || df != null) {
  +            registerTypeMapping(javaType, xmlType, sf, df, force);
  +        }
       }
   
       /**
  @@ -1089,13 +1129,6 @@
        * @throws IntrospectionException _class is not compatible with the
        *                            specified deserializer.
        */
  -    public void addDeserializerFactory(QName qName, Class _class,
  -                                       DeserializerFactory deserFactory)
  -        throws IntrospectionException
  -    {
  -        TypeMappingRegistry typeMap = msgContext.getTypeMappingRegistry();
  -        typeMap.addDeserializerFactory(qName, _class, deserFactory);
  -    }
   
       /************************************************
        * Invocation
  @@ -1370,7 +1403,7 @@
           if (category.isDebugEnabled()) {
               StringWriter writer = new StringWriter();
               try {
  -                SerializationContext ctx = new SerializationContext(writer,
  +                SerializationContext ctx = new SerializationContextImpl(writer,
                                                                      msgContext);
                   reqEnv.output(ctx);
                   writer.close();
  
  
  
  1.73      +0 -31     xml-axis/java/src/org/apache/axis/client/ServiceClient.java
  
  Index: ServiceClient.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/ServiceClient.java,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- ServiceClient.java	10 Jan 2002 20:28:35 -0000	1.72
  +++ ServiceClient.java	26 Jan 2002 02:50:51 -0000	1.73
  @@ -380,37 +380,6 @@
           call.clearHeaders();
       }
   
  -    /**
  -     * Map a type for serialization.
  -     *
  -     * @param _class the Java class of the data type.
  -     * @param qName the xsi:type QName of the associated XML type.
  -     * @param serializer a Serializer which will be used to write the XML.
  -     */
  -    public void addSerializer(Class _class,
  -                              QName qName,
  -                              Serializer serializer) {
  -        call.addSerializer(_class, qName, serializer);
  -    }
  -
  -    /**
  -     * Map a type for deserialization.
  -     *
  -     * @param qName the xsi:type QName of an XML Schema type.
  -     * @param _class the class of the associated Java data type.
  -     * @param deserializerFactory a factory which can create deserializer
  -     *                            instances for this type.
  -     * @throws IntrospectionException _class is not compatible with the
  -     *                            specified deserializer.
  -     */
  -    public void addDeserializerFactory(QName qName,
  -                                       Class _class,
  -                                       DeserializerFactory deserializerFactory)
  -        throws IntrospectionException
  -    {
  -        call.addDeserializerFactory(qName, _class, deserializerFactory);
  -    }
  -
       /************************************************
        * Invocation
        */
  
  
  
  1.20      +14 -5     xml-axis/java/src/org/apache/axis/deployment/DeploymentRegistry.java
  
  Index: DeploymentRegistry.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/DeploymentRegistry.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- DeploymentRegistry.java	28 Dec 2001 22:32:36 -0000	1.19
  +++ DeploymentRegistry.java	26 Jan 2002 02:50:51 -0000	1.20
  @@ -57,6 +57,7 @@
   import org.apache.axis.Handler;
   import org.apache.axis.deployment.wsdd.WSDDGlobalConfiguration;
   import org.apache.axis.deployment.wsdd.WSDDDocument;
  +import org.apache.axis.encoding.TypeMapping;
   import org.apache.axis.encoding.TypeMappingRegistry;
   import org.apache.axis.encoding.SerializationContext;
   import org.w3c.dom.Document;
  @@ -148,12 +149,20 @@
           throws DeploymentException;
   
       /**
  -     * retrieve an instance of the named mapping registry
  +     * retrieve an instance of the named type mapping registry
  +     * @return TypeMappingRegistery
  +     */
  +    public abstract TypeMappingRegistry getTypeMappingRegistry();
  +
  +
  +
  +    /**
  +     * retrieve an instance of the named type mapping    
        * @param encodingStyle XXX
        * @return XXX
        * @throws DeploymentException XXX
        */
  -    public abstract TypeMappingRegistry getTypeMappingRegistry(
  +    public abstract TypeMapping getTypeMapping(
           String encodingStyle)
           throws DeploymentException;
   
  @@ -163,8 +172,8 @@
        * @param tmr XXX
        * @throws DeploymentException XXX
        */
  -    public abstract void addTypeMappingRegistry(String encodingStyle,
  -                                                TypeMappingRegistry tmr)
  +    public abstract void addTypeMapping(String encodingStyle,
  +                                        TypeMapping tm)
           throws DeploymentException;
   
       /**
  @@ -172,7 +181,7 @@
        * @param encodingStyle XXX
        * @throws DeploymentException XXX
        */
  -    public abstract void removeTypeMappingRegistry(String encodingStyle)
  +    public abstract void removeTypeMapping(String encodingStyle)
           throws DeploymentException;
   
       /**
  
  
  
  1.25      +41 -23    xml-axis/java/src/org/apache/axis/deployment/SimpleDeploymentManager.java
  
  Index: SimpleDeploymentManager.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/SimpleDeploymentManager.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- SimpleDeploymentManager.java	28 Dec 2001 22:32:36 -0000	1.24
  +++ SimpleDeploymentManager.java	26 Jan 2002 02:50:51 -0000	1.25
  @@ -64,12 +64,14 @@
   import org.apache.axis.deployment.wsdd.WSDDService;
   import org.apache.axis.deployment.wsdd.WSDDTransport;
   import org.apache.axis.deployment.wsdd.WSDDTypeMapping;
  -import org.apache.axis.encoding.SOAPTypeMappingRegistry;
   import org.apache.axis.encoding.TypeMappingRegistry;
  +import org.apache.axis.encoding.TypeMappingRegistryImpl;
  +import org.apache.axis.encoding.TypeMapping;
   import org.apache.axis.encoding.SerializationContext;
   import org.w3c.dom.Document;
   
   import javax.xml.rpc.namespace.QName;
  +import javax.xml.rpc.JAXRPCException;
   import java.util.Hashtable;
   import java.util.Iterator;
   import java.util.Enumeration;
  @@ -94,7 +96,7 @@
       Hashtable transports = new Hashtable();
   
       /** Storage for our TypeMappingRegistries */
  -    Hashtable mappings;
  +    TypeMappingRegistry tmr = null;
       
       /** The deployment document we're rooted off of.
        * This will be updated as new items are deployed into the registry.
  @@ -106,14 +108,16 @@
        */
       public SimpleDeploymentManager()
       {
  -        mappings = new Hashtable();
  +        tmr = new TypeMappingRegistryImpl();
   
  -        try {
  -            mappings.put(Constants.URI_SOAP_ENC, new SOAPTypeMappingRegistry());
  -        } catch (Exception e) {
  -            // if this ever occurs, we have an internal error
  -            throw new InternalException(e);
  -        }
  +        // The TypeMappingRegistry already has a default TypeMapping, so 
  +        // the following is not needed.
  +        //try {
  +        //    mappings.put(Constants.URI_CURRENT_SOAP_ENC, new TypeMappingRegistryImpl());
  +        //} catch (Exception e) {
  +        //    // if this ever occurs, we have an internal error
  +        //    throw new InternalException(e);
  +        //}
       }
   
       /**
  @@ -353,43 +357,56 @@
       }
   
       /**
  -     * return the named mapping registry
  +     * Get the configured TypeMappingRegistry which contains
  +     * the TypeMapping objects
  +     * @return TypeMappingRegistry
  +     */
  +    public TypeMappingRegistry getTypeMappingRegistry() {
  +        return tmr;
  +    }
  +    /**
  +     * return the named type mapping
        * @param encodingStyle XXX
        * @return XXX
        * @throws DeploymentException XXX
        */
  -    public TypeMappingRegistry getTypeMappingRegistry(String encodingStyle)
  +    public TypeMapping getTypeMapping(String encodingStyle)
           throws DeploymentException
       {
           if (encodingStyle == null)
               encodingStyle = "";
           
  -        TypeMappingRegistry tmr =
  -            (TypeMappingRegistry) mappings.get(encodingStyle);
  +        TypeMapping tm = (TypeMapping) tmr.getTypeMapping(encodingStyle);
   
  -        return tmr;
  +        return tm;
       }
   
  +    
       /**
        * adds a new mapping registry
        * @param encodingStyle XXX
        * @param tmr XXX
        */
  -    public void addTypeMappingRegistry(String encodingStyle,
  -                                       TypeMappingRegistry tmr)
  +    public void addTypeMapping(String encodingStyle,
  +                               TypeMapping tm)
       {
  -        mappings.put(encodingStyle, tmr);
  +        try {
  +            TypeMapping existingTM = (TypeMapping) tmr.getTypeMapping(encodingStyle);
  +            if (existingTM == tm) 
  +                return;
  +            tmr.register(tm, new String[] {encodingStyle});
  +        } catch (Exception e) {}
       }
   
       /**
        * remove the named mapping registry
        * @param encodingStyle XXX
        */
  -    public void removeTypeMappingRegistry(String encodingStyle)
  +    public void removeTypeMapping(String encodingStyle)
       {
  -        mappings.remove(encodingStyle);
  +        tmr.removeTypeMapping(encodingStyle);
       }
  -    
  +
       public void writeToContext(SerializationContext context)
           throws IOException
       {
  @@ -419,9 +436,10 @@
               WSDDTransport transport = (WSDDTransport)i.next();
               transport.writeToContext(context);
           }
  -        
  -        TypeMappingRegistry tmr = getTypeMappingRegistry("");
  -        tmr.dumpToSerializationContext(context);
  +
  +        // The TypeMappings should be written out as part of the
  +        // service.writeToContext()
  +        //        context.dumpToSerializationContext();
           
           context.endElement();
       }
  
  
  
  1.3       +4 -2      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDBeanMapping.java
  
  Index: WSDDBeanMapping.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDBeanMapping.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- WSDDBeanMapping.java	20 Dec 2001 19:51:31 -0000	1.2
  +++ WSDDBeanMapping.java	26 Jan 2002 02:50:52 -0000	1.3
  @@ -60,6 +60,7 @@
   import org.apache.axis.utils.XMLUtils;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.encoding.SerializationContext;
  +import org.apache.axis.Constants;                      
   import org.xml.sax.helpers.AttributesImpl;
   
   import javax.xml.rpc.namespace.QName;
  @@ -93,8 +94,9 @@
       {
           super(e, true);
           
  -        serializer = "org.apache.axis.encoding.BeanSerializer";
  -        deserializer = "org.apache.axis.encoding.BeanSerializer$BeanDeserFactory";
  +        serializer = "org.apache.axis.encoding.ser.BeanSerializerFactory";
  +        deserializer = "org.apache.axis.encoding.ser.BeanDeserializerFactory";
  +        encodingStyle = Constants.URI_CURRENT_SOAP_ENC;
       }
   
       protected QName getElementName() {
  
  
  
  1.17      +51 -27    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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- WSDDDeployment.java	3 Dec 2001 22:49:23 -0000	1.16
  +++ WSDDDeployment.java	26 Jan 2002 02:50:52 -0000	1.17
  @@ -60,6 +60,8 @@
   import org.apache.axis.Constants;
   import org.apache.axis.deployment.DeploymentRegistry;
   import org.apache.axis.deployment.DeploymentException;
  +import org.apache.axis.encoding.ser.BaseSerializerFactory;
  +import org.apache.axis.encoding.ser.BaseDeserializerFactory;
   import org.apache.axis.encoding.*;
   
   import javax.xml.rpc.namespace.QName;
  @@ -172,6 +174,7 @@
       public void deployToRegistry(DeploymentRegistry registry)
           throws DeploymentException
       {
  +
           WSDDGlobalConfiguration global = getGlobalConfiguration();
   
           if (global != null) {
  @@ -194,7 +197,6 @@
           for (int n = 0; n < services.length; n++) {
               services[n].deployToRegistry(registry);
           }
  -
           for (int n = 0; n < mappings.length; n++) {
               WSDDTypeMapping     mapping = mappings[n];
               deployMappingToRegistry(mapping, registry);
  @@ -205,35 +207,57 @@
                                                  DeploymentRegistry registry)
               throws DeploymentException
       {
  -        TypeMappingRegistry tmr     =
  -                registry.getTypeMappingRegistry(mapping.getEncodingStyle());
  -
  -        if (tmr == null) {
  -            tmr = new TypeMappingRegistry();
  -            tmr.setParent(SOAPTypeMappingRegistry.getSingleton());
  -
  -            registry.addTypeMappingRegistry(mapping.getEncodingStyle(),
  -                                            tmr);
  -        }
  -
  -        Serializer          ser   = null;
  -        DeserializerFactory deser = null;
  -
           try {
  -            ser   = (Serializer) mapping.getSerializer().newInstance();
  -            deser =
  -                (DeserializerFactory) mapping.getDeserializer()
  -                    .newInstance();
  -
  -            if (ser != null) {
  -                tmr.addSerializer(mapping.getLanguageSpecificType(),
  -                                  mapping.getQName(), ser);
  +            //System.out.println(mapping.getQName() + " " +
  +            //                   mapping.getLanguageSpecificType() + " " +
  +            //                   mapping.getSerializer() + " " + 
  +            //                   mapping.getDeserializer() + " " +
  +            //                   mapping.getEncodingStyle());
  +
  +            TypeMappingRegistry tmr     = 
  +                registry.getTypeMappingRegistry();
  +            
  +            TypeMapping tm = (TypeMapping) tmr.getTypeMapping(mapping.getEncodingStyle());
  +            TypeMapping df = (TypeMapping) tmr.getDefaultTypeMapping();
  +            if (tm == null || tm == df) {
  +                tm = (TypeMapping) tmr.createTypeMapping();
  +                String namespace = mapping.getEncodingStyle();
  +                if (mapping.getEncodingStyle() == null) {
  +                    namespace = Constants.URI_CURRENT_SOAP_ENC;
  +                }
  +                tm.setSupportedEncodings(new String[] {namespace});
  +                tmr.register(tm, new String[] {namespace});
               }
  -
  -            if (deser != null) {
  -                tmr.addDeserializerFactory(mapping.getQName(), mapping
  -                    .getLanguageSpecificType(), deser);
  +            
  +            SerializerFactory   ser   = null;
  +            DeserializerFactory deser = null;
  +            
  +            // Try to construct a serializerFactory by introspecting for the
  +            // following:
  +            // public static create(Class javaType, QName xmlType)
  +            // public <constructor>(Class javaType, QName xmlType)
  +            // public <constructor>()
  +            // 
  +            // The BaseSerializerFactory createFactory() method is a utility 
  +            // that does this for us.
  +            //System.out.println("start creating sf and df");
  +            if (mapping.getSerializerName() != null &&
  +                !mapping.getSerializerName().equals("")) {
  +                ser = BaseSerializerFactory.createFactory(mapping.getSerializer(), 
  +                                                          mapping.getLanguageSpecificType(),
  +                                                          mapping.getQName());
  +            }
  +            //System.out.println("set ser factory");
  +            
  +            if (mapping.getDeserializerName() != null &&
  +                !mapping.getDeserializerName().equals("")) {
  +                deser = BaseDeserializerFactory.createFactory(mapping.getDeserializer(), 
  +                                                          mapping.getLanguageSpecificType(),
  +                                                          mapping.getQName());
               }
  +            //System.out.println("set dser factory");
  +            tm.register( mapping.getLanguageSpecificType(), mapping.getQName(), ser, deser);
  +            //System.out.println("registered");
           }
           catch (Exception e) {
               throw new DeploymentException(e);
  
  
  
  1.15      +1 -1      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDocument.java
  
  Index: WSDDDocument.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDDocument.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- WSDDDocument.java	3 Dec 2001 03:31:31 -0000	1.14
  +++ WSDDDocument.java	26 Jan 2002 02:50:52 -0000	1.15
  @@ -130,7 +130,7 @@
   
       public Document getDOMDocument() throws DeploymentException {
           StringWriter writer = new StringWriter();
  -        SerializationContext context = new SerializationContext(writer, null);
  +        SerializationContext context = new SerializationContextImpl(writer, null);
           context.setPretty(true);
           try {
               deployment.writeToContext(context);
  
  
  
  1.31      +47 -29    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.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- WSDDService.java	3 Jan 2002 18:08:28 -0000	1.30
  +++ WSDDService.java	26 Jan 2002 02:50:52 -0000	1.31
  @@ -60,7 +60,10 @@
   import org.apache.axis.utils.XMLUtils;
   import org.apache.axis.utils.JavaUtils;
   import org.apache.axis.handlers.soap.SOAPService;
  +import org.apache.axis.encoding.ser.BaseSerializerFactory;
  +import org.apache.axis.encoding.ser.BaseDeserializerFactory;
   import org.apache.axis.encoding.*;
  +import org.apache.axis.Constants;
   import org.apache.axis.deployment.DeploymentRegistry;
   import org.apache.axis.deployment.DeploymentException;
   import org.w3c.dom.Document;
  @@ -237,12 +240,8 @@
               service.setName(getQName().getLocalPart());
           service.setOptions(getParametersTable());
   
  -        if (tmr == null) {
  -            tmr = new TypeMappingRegistry();
  -        }
  -
  +        registry.getTypeMappingRegistry();
           service.setTypeMappingRegistry(tmr);
  -        tmr.setParent(registry.getTypeMappingRegistry(""));
   
           WSDDFaultFlow [] faultFlows = getFaultFlows();
           if (faultFlows != null && faultFlows.length > 0) {
  @@ -262,35 +261,52 @@
       public void addTypeMapping(WSDDTypeMapping mapping)
           throws WSDDException
       {
  -        if (tmr == null)
  -            tmr = new TypeMappingRegistry();
  -
  +        if (tmr == null) {
  +            tmr = new TypeMappingRegistryImpl();
  +        }
           try {
  -            Serializer          ser   = null;
  +
  +            TypeMapping tm = (TypeMapping) tmr.getTypeMapping(mapping.getEncodingStyle());
  +            TypeMapping df = (TypeMapping) tmr.getDefaultTypeMapping();
  +            if (tm == null || tm == df) {
  +                tm = (TypeMapping) tmr.createTypeMapping();
  +                String namespace = mapping.getEncodingStyle();
  +                if (mapping.getEncodingStyle() == null) {
  +                    namespace = Constants.URI_CURRENT_SOAP_ENC;
  +                }
  +                tm.setSupportedEncodings(new String[] {namespace});
  +                tmr.register(tm, new String[] {namespace});
  +            }
  +            
  +            SerializerFactory   ser   = null;
               DeserializerFactory deser = null;
  -        
  -            ser   = (Serializer) mapping.getSerializer().newInstance();
  -            deser =
  -                    (DeserializerFactory) mapping.getDeserializer()
  -                    .newInstance();
  -        
  -            if (ser != null) {
  -                tmr.addSerializer(mapping.getLanguageSpecificType(),
  -                                  mapping.getQName(), ser);
  +            
  +            // Try to construct a serializerFactory by introspecting for the
  +            // following:
  +            // public static create(Class javaType, QName xmlType)
  +            // public <constructor>(Class javaType, QName xmlType)
  +            // public <constructor>()
  +            // 
  +            // The BaseSerializerFactory createFactory() method is a utility 
  +            // that does this for us.
  +            if (mapping.getSerializerName() != null &&
  +                !mapping.getSerializerName().equals("")) {
  +                ser = BaseSerializerFactory.createFactory(mapping.getSerializer(), 
  +                                                          mapping.getLanguageSpecificType(),
  +                                                          mapping.getQName());
               }
  -        
  -            if (deser != null) {
  -                tmr.addDeserializerFactory(mapping.getQName(), mapping
  -                                                               .getLanguageSpecificType(), deser);
  +            
  +            if (mapping.getDeserializerName() != null &&
  +                !mapping.getDeserializerName().equals("")) {
  +                deser = BaseDeserializerFactory.createFactory(mapping.getDeserializer(), 
  +                                                          mapping.getLanguageSpecificType(),
  +                                                          mapping.getQName());
               }
  -        } catch (IntrospectionException e) {
  -            throw new WSDDException(e);
  -        } catch (InstantiationException e) {
  -            throw new WSDDException(e);
  -        } catch (IllegalAccessException e) {
  -            throw new WSDDException(e);
  +            tm.register( mapping.getLanguageSpecificType(), mapping.getQName(), ser, deser);
           } catch (ClassNotFoundException e) {
               throw new WSDDException(e);
  +        } catch (Exception e) {
  +            throw new WSDDException(e);
           }
       }
   
  @@ -315,7 +331,9 @@
           writeParamsToContext(context);
   
           if (tmr != null) {
  -            tmr.dumpToSerializationContext(context);
  +            // RJS_TEMP
  +            // Need to provide a writeTypeMappingsToContext
  +            //tmr.dumpToSerializationContext(context);
           }
   
           context.endElement();
  
  
  
  1.17      +17 -0     xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDTypeMapping.java
  
  Index: WSDDTypeMapping.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDTypeMapping.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- WSDDTypeMapping.java	25 Nov 2001 23:49:33 -0000	1.16
  +++ WSDDTypeMapping.java	26 Jan 2002 02:50:52 -0000	1.17
  @@ -242,6 +242,14 @@
   
       /**
        *
  +     * @return serializer factory name
  +     */
  +    public String getSerializerName()
  +    {
  +        return serializer;
  +    }
  +    /**
  +     *
        * @param ser XXX
        */
       public void setSerializer(Class ser)
  @@ -258,6 +266,15 @@
           throws ClassNotFoundException
       {
           return Class.forName(deserializer);
  +    }
  +
  +    /**
  +     *
  +     * @return deserializer factory name
  +     */
  +    public String getDeserializerName()
  +    {
  +        return deserializer;
       }
   
       /**
  
  
  
  1.2       +3 -1      xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDUndeployment.java
  
  Index: WSDDUndeployment.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/deployment/wsdd/WSDDUndeployment.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WSDDUndeployment.java	3 Dec 2001 03:31:31 -0000	1.1
  +++ WSDDUndeployment.java	26 Jan 2002 02:50:52 -0000	1.2
  @@ -215,7 +215,9 @@
           AttributesImpl attrs = new org.xml.sax.helpers.AttributesImpl();
           attrs.addAttribute("", "name", "name", "CDATA",
                              context.qName2String(qname));
  -        context.writeElement(elementQName, attrs);
  +         
  +        context.startElement(elementQName, attrs);
  +        context.endElement();
       }
   
       public void writeToContext(SerializationContext context)
  
  
  
  1.29      +1 -2      xml-axis/java/src/org/apache/axis/handlers/DebugHandler.java
  
  Index: DebugHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/DebugHandler.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- DebugHandler.java	10 Jan 2002 20:00:59 -0000	1.28
  +++ DebugHandler.java	26 Jan 2002 02:50:52 -0000	1.29
  @@ -59,7 +59,6 @@
   import org.apache.axis.Constants;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  -import org.apache.axis.encoding.SOAPTypeMappingRegistry;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeader;
   import org.apache.axis.utils.JavaUtils;
  @@ -84,7 +83,7 @@
   
               if (header != null) {
                   Integer i = ((Integer)header
  -                             .getValueAsType(SOAPTypeMappingRegistry.XSD_INT));
  +                             .getValueAsType(Constants.XSD_INT));
                   if (i == null)
                       throw new AxisFault(JavaUtils.getMessage("cantConvert03"));
   
  
  
  
  1.12      +3 -3      xml-axis/java/src/org/apache/axis/handlers/SimpleSessionHandler.java
  
  Index: SimpleSessionHandler.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/handlers/SimpleSessionHandler.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- SimpleSessionHandler.java	10 Jan 2002 20:00:59 -0000	1.11
  +++ SimpleSessionHandler.java	26 Jan 2002 02:50:52 -0000	1.12
  @@ -57,9 +57,9 @@
   
   import org.apache.axis.AxisEngine;
   import org.apache.axis.AxisFault;
  +import org.apache.axis.Constants;
   import org.apache.axis.Message;
   import org.apache.axis.MessageContext;
  -import org.apache.axis.encoding.SOAPTypeMappingRegistry;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeader;
   import org.apache.axis.session.SimpleSession;
  @@ -198,7 +198,7 @@
               // Got one!
               try {
                   Long id = (Long)header.
  -                             getValueAsType(SOAPTypeMappingRegistry.XSD_LONG);
  +                             getValueAsType(Constants.XSD_LONG);
                   // Store it away.
                   AxisEngine engine = context.getAxisEngine();
                   engine.setOption(SESSION_ID, id);
  @@ -259,7 +259,7 @@
                   // Got one!
                   try {
                       id = (Long)header.
  -                            getValueAsType(SOAPTypeMappingRegistry.XSD_LONG);
  +                            getValueAsType(Constants.XSD_LONG);
                   } catch (Exception e) {
                       throw AxisFault.makeFault(e);
                   }
  
  
  
  1.43      +8 -33     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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- SOAPService.java	10 Jan 2002 20:01:00 -0000	1.42
  +++ SOAPService.java	26 Jan 2002 02:50:52 -0000	1.43
  @@ -64,9 +64,9 @@
   import org.apache.axis.SimpleTargetedChain;
   import org.apache.axis.providers.java.MsgProvider;
   import org.apache.axis.encoding.DeserializerFactory;
  -import org.apache.axis.encoding.SOAPTypeMappingRegistry;
   import org.apache.axis.encoding.Serializer;
   import org.apache.axis.encoding.TypeMappingRegistry;
  +import org.apache.axis.encoding.TypeMappingRegistryImpl;
   import org.apache.axis.message.SOAPEnvelope;
   import org.apache.axis.message.SOAPHeader;
   import org.apache.axis.utils.JavaUtils;
  @@ -102,7 +102,7 @@
   
       /** Service-specific type mappings
        */
  -    private TypeMappingRegistry typeMap;
  +    private TypeMappingRegistry tmr;
       
       /**
        * SOAPRequestHandler is used to inject SOAP semantics just before
  @@ -189,18 +189,19 @@
       }
   
       private void initTypeMappingRegistry() {
  -        typeMap = new TypeMappingRegistry();
  -        typeMap.setParent(SOAPTypeMappingRegistry.getSingleton());
  +        tmr = new TypeMappingRegistryImpl();
  +        // The TMR has the SOAP/XSD in the default TypeMapping
  +        //tmr.setParent(SOAPTypeMappingRegistry.getSingleton());
       }
       
       public TypeMappingRegistry getTypeMappingRegistry()
       {
  -        return typeMap;
  +        return tmr;
       }
       
       public void setTypeMappingRegistry(TypeMappingRegistry map)
       {
  -        typeMap = map;
  +        tmr = map;
       }
       
       /** Convenience constructor for wrapping SOAP semantics around
  @@ -214,12 +215,10 @@
       
       /** Tell this service which engine it's deployed to.
        *
  -     * The main result of this right now is to set up type mapping
  -     * relationships.
        */
       public void setEngine(AxisEngine engine)
       {
  -      typeMap.setParent(engine.getTypeMappingRegistry());
  +      tmr = engine.getTypeMappingRegistry();
       }
   
       /**
  @@ -267,30 +266,6 @@
        */
       public void stop()
       {
  -    }
  -    
  -    /**
  -     * Register a new service type mapping
  -     */
  -    public void registerTypeMapping(QName qName,
  -                                    Class cls,
  -                                    DeserializerFactory deserFactory,
  -                                    Serializer serializer)
  -        throws IntrospectionException
  -    {
  -        if (deserFactory != null)
  -            typeMap.addDeserializerFactory(qName, cls, deserFactory);
  -        if (serializer != null)
  -            typeMap.addSerializer(cls, qName, serializer);
  -    }
  -        
  -    /**
  -     * Unregister a service type mapping
  -     */
  -    public void unregisterTypeMapping(QName qName, Class cls)
  -    {
  -        typeMap.removeDeserializer(qName);
  -        typeMap.removeSerializer(cls);
       }
       
       /**
  
  
  
  1.35      +1 -1      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.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- RPCProvider.java	24 Jan 2002 15:47:29 -0000	1.34
  +++ RPCProvider.java	26 Jan 2002 02:50:52 -0000	1.35
  @@ -313,7 +313,7 @@
               }
               
               resEnv.addBodyElement( resBody );
  -            resEnv.setEncodingStyleURI(Constants.URI_SOAP_ENC);
  +            resEnv.setEncodingStyleURI(Constants.URI_CURRENT_SOAP_ENC);
           }
       }
       
  
  
  
  1.93      +4 -3      xml-axis/java/src/org/apache/axis/utils/Admin.java
  
  Index: Admin.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/utils/Admin.java,v
  retrieving revision 1.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- Admin.java	17 Dec 2001 00:57:41 -0000	1.92
  +++ Admin.java	26 Jan 2002 02:50:52 -0000	1.93
  @@ -70,6 +70,7 @@
   import org.apache.axis.client.AxisClient;
   import org.apache.axis.configuration.FileProvider;
   import org.apache.axis.encoding.*;
  +import org.apache.axis.encoding.ser.*;
   import org.apache.axis.handlers.soap.SOAPService;
   import org.apache.axis.handlers.BasicHandler;
   import org.apache.axis.server.AxisServer;
  @@ -513,7 +514,7 @@
           throws AxisFault
       {
           StringWriter writer = new StringWriter();
  -        SerializationContext context = new SerializationContext(writer, null);
  +        SerializationContext context = new SerializationContextImpl(writer, null);
           context.setPretty(true);
           try {
               engine.getDeploymentRegistry().writeToContext(context);
  @@ -805,8 +806,8 @@
   
               // register both serializers and deserializers for this bean
               mapping.setQName(qn);
  -            mapping.setSerializer(BeanSerializer.class);
  -            mapping.setDeserializer(BeanSerializer.getFactory().getClass());
  +            mapping.setSerializer(BeanSerializerFactory.class);
  +            mapping.setDeserializer(BeanDeserializerFactory.class);
           } else {
               String typeName = elem.getAttribute("type");
               int idx = typeName.indexOf(':');
  
  
  
  1.22      +29 -0     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.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- JavaUtils.java	14 Jan 2002 21:27:14 -0000	1.21
  +++ JavaUtils.java	26 Jan 2002 02:50:52 -0000	1.22
  @@ -481,4 +481,33 @@
       {
           public HolderException () {}
       }; 
  +
  +
  +    /**
  +     * Determine if the class is a JAX-RPC enum class.
  +     * An enumeration class is recognized by
  +     * a getValue() method, a toString() method, a fromString(String) method
  +     * a fromValue(type) method and the lack
  +     * of a setValue(type) method
  +     */
  +    public static boolean isEnumClass(Class cls) {
  +        try {
  +            java.lang.reflect.Method m  = cls.getMethod("getValue", null);
  +            java.lang.reflect.Method m2 = cls.getMethod("toString", null);
  +            java.lang.reflect.Method m3 = cls.getMethod("fromString",
  +                                                        new Class[] {java.lang.String.class});
  +            
  +            if (m != null && m2 != null && m3 != null &&
  +                cls.getMethod("fromValue", new Class[] {m.getReturnType()}) != null) {
  +                try {
  +                    if (cls.getMethod("setValue",  new Class[] {m.getReturnType()}) == null)
  +                        return true;
  +                    return false;
  +                } catch (java.lang.NoSuchMethodException e) {
  +                    return true;  // getValue & fromValue exist.  setValue does not exist.  Thus return true. 
  +                }
  +            }
  +        } catch (java.lang.NoSuchMethodException e) {}
  +        return false;
  +    }  
   }
  
  
  

Mime
View raw message