gdaniels    2002/10/18 13:54:28

  Modified:    java/src/org/apache/axis AxisProperties.java
               java/src/org/apache/axis/configuration
                        EngineConfigurationFactoryFinder.java
               java/src/org/apache/axis/encoding
                        DefaultTypeMappingImpl.java
                        TypeMappingRegistryImpl.java
               java/src/org/apache/axis/wsdl Java2WSDL.java
               java/src/org/apache/axis/wsdl/gen NoopFactory.java
               java/src/org/apache/axis/wsdl/toJava Emitter.java
               java/tools/org/apache/axis/tools/ant/wsdl
                        Java2WsdlAntTask.java
  Added:       java/src/org/apache/axis/encoding
                        DefaultSOAPEncodingTypeMappingImpl.java
  Removed:     java/src/org/apache/axis/encoding
                        DefaultSOAP12TypeMappingImpl.java
  Log:
  Encoding refactor, stage 1.  Rename DefaultSOAP12TypeMappingImpl
  to something a little more accurate, and simplify the implementation so
  as not to repeat the SOAPENC type mappings, just make sure they
  end up in the right precedence.
  
  Next step is to change the "1.2" options various places to make
  sense as well.
  
  Revision  Changes    Path
  1.20      +0 -1      xml-axis/java/src/org/apache/axis/AxisProperties.java
  
  Index: AxisProperties.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/AxisProperties.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- AxisProperties.java       9 Oct 2002 00:44:02 -0000       1.19
  +++ AxisProperties.java       18 Oct 2002 20:54:28 -0000      1.20
  @@ -151,7 +151,6 @@
           return new DiscoverClasses(loaders).findResourceClasses(it);
       }
   
  -    
       private static ClassLoaders getClassLoaders() {
           if (loaders == null) {
               loaders = ClassLoaders.getAppLoaders(AxisProperties.class, null, true);
  
  
  
  1.22      +0 -1      
xml-axis/java/src/org/apache/axis/configuration/EngineConfigurationFactoryFinder.java
  
  Index: EngineConfigurationFactoryFinder.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/configuration/EngineConfigurationFactoryFinder.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- EngineConfigurationFactoryFinder.java     10 Oct 2002 20:47:01 -0000      1.21
  +++ EngineConfigurationFactoryFinder.java     18 Oct 2002 20:54:28 -0000      1.22
  @@ -88,7 +88,6 @@
           LogFactory.getLog(EngineConfigurationFactoryFinder.class.getName());
   
       private static final Class mySpi = EngineConfigurationFactory.class;
  -    private static final Class myFactory = EngineConfigurationFactoryFinder.class;
   
       private static final Class[] newFactoryParamTypes =
           new Class[] { Object.class };
  
  
  
  1.60      +43 -24    
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.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- DefaultTypeMappingImpl.java       9 Oct 2002 20:10:16 -0000       1.59
  +++ DefaultTypeMappingImpl.java       18 Oct 2002 20:54:28 -0000      1.60
  @@ -122,6 +122,10 @@
       }
   
       protected DefaultTypeMappingImpl() {
  +        this(false);
  +    }
  +
  +    protected DefaultTypeMappingImpl(boolean encoded) {
           super(null);
           delegate = null;
   
  @@ -151,18 +155,9 @@
                               Constants.MIME_PLAINTEXT));
           }
   
  -        // SOAP Encoded strings are treated as primitives.
  -        // Everything else is not.
  -        myRegisterSimple(Constants.SOAP_STRING, java.lang.String.class);
  -        myRegisterSimple(Constants.SOAP_BOOLEAN, java.lang.Boolean.class);
  -        myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double.class);
  -        myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float.class);
  -        myRegisterSimple(Constants.SOAP_INT, java.lang.Integer.class);
  -        myRegisterSimple(Constants.SOAP_INTEGER, java.math.BigInteger.class);
  -        myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal.class);
  -        myRegisterSimple(Constants.SOAP_LONG, java.lang.Long.class);
  -        myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short.class);
  -        myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte.class);
  +        if (!encoded) {
  +            registerSOAPTypes();
  +        }
   
           // HexBinary binary data needs to use the hex binary serializer/deserializer
           myRegister(Constants.XSD_HEXBIN,     HexBinary.class,
  @@ -194,18 +189,6 @@
                      null
           );
   
  -        myRegister(Constants.SOAP_BASE64,     byte[].class,
  -                   new Base64SerializerFactory(byte[].class,
  -                                               Constants.SOAP_BASE64 ),
  -                   new Base64DeserializerFactory(byte[].class,
  -                                                 Constants.SOAP_BASE64)
  -        );
  -        myRegister(Constants.SOAP_BASE64BINARY,     byte[].class,
  -                   new Base64SerializerFactory(byte[].class,
  -                                               Constants.SOAP_BASE64 ),
  -                   new Base64DeserializerFactory(byte[].class,
  -                                                 Constants.SOAP_BASE64)
  -        );
           myRegister(Constants.XSD_BASE64,     byte[].class,
                      new Base64SerializerFactory(byte[].class,
                                                  Constants.XSD_BASE64 ),
  @@ -535,7 +518,43 @@
           SchemaVersion.SCHEMA_1999.registerSchemaSpecificTypes(this);
           SchemaVersion.SCHEMA_2000.registerSchemaSpecificTypes(this);
           SchemaVersion.SCHEMA_2001.registerSchemaSpecificTypes(this);
  +
  +        if (encoded) {
  +            registerSOAPTypes();
  +        }
  +
           doneInit = true;
  +    }
  +
  +    /**
  +     * Register the SOAP encoding data types.  This is split out into a
  +     * method so it can happen either before or after the XSD mappings.
  +     */
  +    private void registerSOAPTypes() {
  +        // SOAP Encoded strings are treated as primitives.
  +        // Everything else is not.
  +        myRegisterSimple(Constants.SOAP_STRING, java.lang.String.class);
  +        myRegisterSimple(Constants.SOAP_BOOLEAN, java.lang.Boolean.class);
  +        myRegisterSimple(Constants.SOAP_DOUBLE, java.lang.Double.class);
  +        myRegisterSimple(Constants.SOAP_FLOAT, java.lang.Float.class);
  +        myRegisterSimple(Constants.SOAP_INT, java.lang.Integer.class);
  +        myRegisterSimple(Constants.SOAP_INTEGER, java.math.BigInteger.class);
  +        myRegisterSimple(Constants.SOAP_DECIMAL, java.math.BigDecimal.class);
  +        myRegisterSimple(Constants.SOAP_LONG, java.lang.Long.class);
  +        myRegisterSimple(Constants.SOAP_SHORT, java.lang.Short.class);
  +        myRegisterSimple(Constants.SOAP_BYTE, java.lang.Byte.class);
  +        myRegister(Constants.SOAP_BASE64,     byte[].class,
  +                   new Base64SerializerFactory(byte[].class,
  +                                               Constants.SOAP_BASE64 ),
  +                   new Base64DeserializerFactory(byte[].class,
  +                                                 Constants.SOAP_BASE64)
  +        );
  +        myRegister(Constants.SOAP_BASE64BINARY,     byte[].class,
  +                   new Base64SerializerFactory(byte[].class,
  +                                               Constants.SOAP_BASE64 ),
  +                   new Base64DeserializerFactory(byte[].class,
  +                                                 Constants.SOAP_BASE64)
  +        );
       }
   
       /**
  
  
  
  1.19      +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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- TypeMappingRegistryImpl.java      17 Oct 2002 04:40:19 -0000      1.18
  +++ TypeMappingRegistryImpl.java      18 Oct 2002 20:54:28 -0000      1.19
  @@ -173,7 +173,7 @@
                   new TypeMappingImpl(DefaultTypeMappingImpl.getSingleton());
           } else {
               defaultDelTM = 
  -                new TypeMappingImpl(DefaultSOAP12TypeMappingImpl.create()); 
  +                new TypeMappingImpl(DefaultSOAPEncodingTypeMappingImpl.create());
           }
       }
       
  
  
  
  1.1                  
xml-axis/java/src/org/apache/axis/encoding/DefaultSOAPEncodingTypeMappingImpl.java
  
  Index: DefaultSOAPEncodingTypeMappingImpl.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2001 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer. 
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *    if any, must include the following acknowledgment:  
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowledgment may appear in the software itself,
   *    if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "Axis" and "Apache Software Foundation" must
   *    not be used to endorse or promote products derived from this
   *    software without prior written permission. For written 
   *    permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *    nor may "Apache" appear in their name, without prior written
   *    permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  
  package org.apache.axis.encoding;
  
  /**
   * @author Rich Scheuerle ([EMAIL PROTECTED])
   * 
   * This is the implementation of the axis Default JAX-RPC SOAP 1.2 TypeMapping
   * See DefaultTypeMapping for more information.
   * 
   */
  public class DefaultSOAPEncodingTypeMappingImpl extends DefaultTypeMappingImpl {
      
      private static DefaultSOAPEncodingTypeMappingImpl tm = null;
      /**
       * Construct TypeMapping
       */
      public static TypeMapping create() {
          if (tm == null) {
              tm = new DefaultSOAPEncodingTypeMappingImpl();
          }
          return tm;
      }
  
      protected DefaultSOAPEncodingTypeMappingImpl() {
          super(true);
      }
  }
  
  
  
  1.33      +2 -2      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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Java2WSDL.java    17 Oct 2002 21:13:13 -0000      1.32
  +++ Java2WSDL.java    18 Oct 2002 20:54:28 -0000      1.33
  @@ -63,7 +63,7 @@
   import org.apache.axis.wsdl.fromJava.Emitter;
   
   import org.apache.axis.encoding.DefaultTypeMappingImpl;
  -import org.apache.axis.encoding.DefaultSOAP12TypeMappingImpl;
  +import org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl;
   
   import java.util.HashMap;
   import java.util.List;
  @@ -367,7 +367,7 @@
                                                 
DefaultTypeMappingImpl.getSingleton());
               } else if (value.equals("1.2")) {
                   emitter.setDefaultTypeMapping(
  -                                              
DefaultSOAP12TypeMappingImpl.create());
  +                                              
DefaultSOAPEncodingTypeMappingImpl.create());
               } else {
                   System.out.println(Messages.getMessage("j2wBadTypeMapping00"));
                   status = false;
  
  
  
  1.5       +2 -2      xml-axis/java/src/org/apache/axis/wsdl/gen/NoopFactory.java
  
  Index: NoopFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/gen/NoopFactory.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NoopFactory.java  8 Aug 2002 15:17:10 -0000       1.4
  +++ NoopFactory.java  18 Oct 2002 20:54:28 -0000      1.5
  @@ -62,7 +62,7 @@
   import javax.wsdl.Service;
   
   import org.apache.axis.encoding.TypeMapping;
  -import org.apache.axis.encoding.DefaultSOAP12TypeMappingImpl;
  +import org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl;
   
   import org.apache.axis.utils.JavaUtils;
   
  @@ -111,7 +111,7 @@
       public BaseTypeMapping getBaseTypeMapping() {
           if (btm == null) {
               btm = new BaseTypeMapping() {
  -                    TypeMapping defaultTM = DefaultSOAP12TypeMappingImpl.create();
  +                    TypeMapping defaultTM = 
DefaultSOAPEncodingTypeMappingImpl.create();
                       public String getBaseName(QName qNameIn) {
                           javax.xml.namespace.QName qName = 
                               new javax.xml.namespace.QName(
  
  
  
  1.51      +2 -2      xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java
  
  Index: Emitter.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/toJava/Emitter.java,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- Emitter.java      10 Oct 2002 19:56:45 -0000      1.50
  +++ Emitter.java      18 Oct 2002 20:54:28 -0000      1.51
  @@ -66,7 +66,7 @@
   import javax.xml.namespace.QName;
   import javax.wsdl.WSDLException;
   
  -import org.apache.axis.encoding.DefaultSOAP12TypeMappingImpl;
  +import org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl;
   import org.apache.axis.encoding.DefaultTypeMappingImpl;
   import org.apache.axis.encoding.TypeMapping;
   
  @@ -467,7 +467,7 @@
           } else {
               baseTypeMapping =
                       new BaseTypeMapping() {
  -                        final TypeMapping defaultTM = 
DefaultSOAP12TypeMappingImpl.create();
  +                        final TypeMapping defaultTM = 
DefaultSOAPEncodingTypeMappingImpl.create();
                           public String getBaseName(QName qNameIn) {
                               javax.xml.namespace.QName qName =
                                   new javax.xml.namespace.QName(
  
  
  
  1.8       +2 -2      
xml-axis/java/tools/org/apache/axis/tools/ant/wsdl/Java2WsdlAntTask.java
  
  Index: Java2WsdlAntTask.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/tools/org/apache/axis/tools/ant/wsdl/Java2WsdlAntTask.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Java2WsdlAntTask.java     17 Oct 2002 20:41:08 -0000      1.7
  +++ Java2WsdlAntTask.java     18 Oct 2002 20:54:28 -0000      1.8
  @@ -59,7 +59,7 @@
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
   import org.apache.axis.encoding.DefaultTypeMappingImpl;
  -import org.apache.axis.encoding.DefaultSOAP12TypeMappingImpl;
  +import org.apache.axis.encoding.DefaultSOAPEncodingTypeMappingImpl;
   
   import java.util.HashMap;
   import java.io.StringWriter;
  @@ -152,7 +152,7 @@
               if (tm.equals("1.1")) {
                   
emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.getSingleton());
               } else {
  -                
emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create());
  +                
emitter.setDefaultTypeMapping(DefaultSOAPEncodingTypeMappingImpl.create());
               }
               if (style != null) {
                   emitter.setStyle(style);
  
  
  


Reply via email to