axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prad...@apache.org
Subject svn commit: r612147 [4/17] - in /webservices/axis2/branches/java/jaxws21: ./ modules/adb-codegen/ modules/adb-codegen/src/org/apache/axis2/schema/ modules/adb-codegen/src/org/apache/axis2/schema/template/ modules/adb-codegen/src/org/apache/axis2/schema...
Date Tue, 15 Jan 2008 16:22:27 GMT
Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/CTypeMap.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/CTypeMap.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/CTypeMap.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/CTypeMap.java Tue Jan 15 08:21:22 2008
@@ -18,20 +18,260 @@
  */
 package org.apache.axis2.schema.typemap;
 
-import org.apache.axis2.wsdl.codegen.emitter.CTypeInfo;
+import org.apache.axis2.schema.SchemaConstants;
+import org.apache.axis2.namespace.Constants;
+import java.util.Map;
 
+import javax.xml.namespace.QName;
+import java.math.BigDecimal;
+import java.util.HashMap;
 import java.util.Map;
 
 /**
- * The java type map. uses a static map for caching
- * Most code from Axis 1 Codebase*
- * Most code JavaTypeMap
+ * The C type map. uses a static map for caching
  */
 public class CTypeMap implements TypeMap{
 
-    public Map getTypeMap()
-    {
-         return CTypeInfo.getTypeMap();
+    private static Map typeMap = new HashMap();
+
+    // Type map for the standard schema types
+    public Map getTypeMap(){
+         return typeMap;
     }
 
-}
\ No newline at end of file
+    static {
+        // If SOAP 1.1 over the wire, map wrapper classes to XSD primitives.
+        CTypeMap.addTypemapping(SchemaConstants.XSD_STRING,
+                                 "axis2_char_t*");
+
+        // The XSD Primitives are mapped to axis2/c primitives.
+        CTypeMap.addTypemapping(SchemaConstants.XSD_BOOLEAN, "axis2_bool_t");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_DOUBLE, "double");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_FLOAT, "float");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_INT, "int");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_INTEGER,
+                                 "int");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_LONG, "long");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_SHORT, "short");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_BYTE, "axis2_byte_t");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_ANY, "axiom_node_t*");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_DECIMAL, "double");
+
+        CTypeMap.addTypemapping(SchemaConstants.XSD_ANYTYPE,
+                                 "axiom_node_t*");
+
+        CTypeMap.addTypemapping(SchemaConstants.XSD_QNAME,
+                                 "axutil_qname_t*");
+
+        CTypeMap.addTypemapping(SchemaConstants.XSD_DATE,
+                                 "axutil_date_time_t*");
+
+        CTypeMap.addTypemapping(SchemaConstants.XSD_TIME,
+                                 "axutil_date_time_t*");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_DATETIME,
+                                 "axutil_date_time_t*");
+
+        CTypeMap.addTypemapping(SchemaConstants.XSD_BASE64,
+                                 "axutil_base64_binary_t*");
+
+        CTypeMap.addTypemapping(SchemaConstants.XSD_HEXBIN,
+                                 "axiom_node_t*");
+
+        // These are the g* types (gYearMonth, etc) which map to Axis types
+        // These types are mapped to an integer
+        CTypeMap.addTypemapping(SchemaConstants.XSD_YEARMONTH,
+                                 "axutil_date_time_t*");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_YEAR,
+                                 "int");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_MONTH,
+                                 "int");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_DAY,
+                                 "int");
+        CTypeMap.addTypemapping(SchemaConstants.XSD_MONTHDAY,
+                                 "axutil_date_time_t*");
+
+        // xsd:token
+        CTypeMap.addTypemapping(SchemaConstants.XSD_TOKEN, "axis2_char_t*");
+
+        // a xsd:normalizedString
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NORMALIZEDSTRING,
+                                 "axis2_char_t*");
+
+        // a xsd:unsignedLong
+        CTypeMap.addTypemapping(SchemaConstants.XSD_UNSIGNEDLONG,
+                                 "unsigned long");
+
+        // a xsd:unsignedInt
+        CTypeMap.addTypemapping(SchemaConstants.XSD_UNSIGNEDINT,
+                                 "unsigned int");
+
+        // a xsd:unsignedShort
+        CTypeMap.addTypemapping(SchemaConstants.XSD_UNSIGNEDSHORT,
+                                 "unsigned short");
+
+        // a xsd:unsignedByte
+        CTypeMap.addTypemapping(SchemaConstants.XSD_UNSIGNEDBYTE,
+                                 "axis2_byte_t");
+
+        // a xsd:nonNegativeInteger
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NONNEGATIVEINTEGER,
+                                 "unsigned int");
+
+        // a xsd:negativeInteger
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NEGATIVEINTEGER,
+                                 "int");
+
+        // a xsd:positiveInteger
+        CTypeMap.addTypemapping(SchemaConstants.XSD_POSITIVEINTEGER,
+                                 "unsigned int");
+
+        // a xsd:nonPositiveInteger
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NONPOSITIVEINTEGER,
+                                 "unsigned int");
+
+        // a xsd:Name
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NAME, "axis2_char_t*");
+
+        // a xsd:NCName
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NCNAME, "axis2_char_t*");
+
+        // a xsd:ID
+        CTypeMap.addTypemapping(SchemaConstants.XSD_ID, "axis2_char_t*");
+
+        // a xsd:language
+        CTypeMap.addTypemapping(SchemaConstants.XSD_LANGUAGE, "axis2_char_t*");
+
+        // a xsd:NmToken
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NMTOKEN, "axis2_char_t*");
+
+        // a xsd:NmTokens
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NMTOKENS, "axis2_char_t*");
+
+        // a xsd:NOTATION
+        CTypeMap.addTypemapping(SchemaConstants.XSD_NOTATION, "axiom_node_t*");
+
+        // a xsd:XSD_ENTITY
+        CTypeMap.addTypemapping(SchemaConstants.XSD_ENTITY, "axis2_char_t*");
+
+        // a xsd:XSD_ENTITIES
+        CTypeMap.addTypemapping(SchemaConstants.XSD_ENTITIES, "axis2_char_t*");
+
+        // a xsd:XSD_IDREF
+        CTypeMap.addTypemapping(SchemaConstants.XSD_IDREF, "axis2_char_t*");
+
+        // a xsd:XSD_XSD_IDREFS
+        CTypeMap.addTypemapping(SchemaConstants.XSD_IDREFS, "axis2_char_t*");
+
+        // a xsd:Duration
+        CTypeMap.addTypemapping(SchemaConstants.XSD_DURATION, "axutil_duration_t*");
+
+        // a xsd:anyURI
+        CTypeMap.addTypemapping(SchemaConstants.XSD_ANYURI,
+                                 "axutil_uri_t*");
+    }
+
+    private static void addTypemapping(QName name, String str) {
+        CTypeMap.typeMap.put(name, str);
+    }
+
+    // Type map for the soap encoding types
+    public Map getSoapEncodingTypesMap() {
+        return soapEncodingTypeMap;
+    }
+
+    private static Map soapEncodingTypeMap = new HashMap();
+
+    static {
+        // populate the soapEncodingTypeMap
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ARRAY,
+                "axutil_array_list_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_STRUCT,
+                "axiom_node_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_BASE64,
+                "axutil_base64_binary_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DURATION,
+                "axutil_duration_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DATETIME,
+                "axutil_date_time_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NOTATION,
+                "axiom_node_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_TIME,
+                "axutil_date_time_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DATE,
+                "axutil_date_time_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GYEARMONTH,
+                "axutil_date_time_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GYEAR,
+                "int");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GMONTHDAY,
+                "axutil_date_time_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GDAY,
+                "int");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GMONTH,
+                "int");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_BOOLEAN,
+                "axis2_bool_t");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_BASE64BINARY,
+                "axutil_base64_binary_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_HEXBINARY,
+                "axiom_node_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_FLOAT,
+                "float");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DOUBLE,
+                "double");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ANYURI,
+                "axutil_uri_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_QNAME,
+                "axutil_qname_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_STRING,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NORMALIZEDSTRING,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_TOKEN,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_LANGUAGE,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NAME,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NMTOKEN,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NCNAME,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ID,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_IDREF,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ENTITY,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_IDREFS,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ENTITIES,
+                "axis2_char_t*");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DECIMAL,
+                "double");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_INTEGER,
+                "int");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NONPOSITIVEINTEGER,
+                "int");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NEGATIVEINTEGER,
+                "int");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_LONG,
+                "long");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_INT,
+                "int");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_SHORT,
+                "short");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_BYTE,
+                "axis2_byte_t");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NONNEGATIVEINTEGER,
+                "unsigned int");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_UNSIGNEDLONG,
+                "unsigned long");
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_UNSIGNEDINT,
+                "unsigned int");
+    }
+
+    private static void addSoapEncodingTypeMapping(QName name, String className) {
+        soapEncodingTypeMap.put(name, className);
+    }
+}

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/JavaTypeMap.java Tue Jan 15 08:21:22 2008
@@ -212,5 +212,113 @@
         typeMap.put(name, str);
     }
 
+    public Map getSoapEncodingTypesMap() {
+        return soapEncodingTypeMap;
+    }
+
+    private static Map soapEncodingTypeMap = new HashMap();
+
+    static {
+        // populate the soapEncodingTypeMap
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ARRAY,
+                org.apache.axis2.databinding.types.soapencoding.Array.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_STRUCT,
+                org.apache.axis2.databinding.types.soapencoding.Struct.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_BASE64,
+                org.apache.axis2.databinding.types.soapencoding.Base64.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DURATION,
+                org.apache.axis2.databinding.types.soapencoding.Duration.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DATETIME,
+                org.apache.axis2.databinding.types.soapencoding.DateTime.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NOTATION,
+                org.apache.axis2.databinding.types.soapencoding.NOTATION.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_TIME,
+                org.apache.axis2.databinding.types.soapencoding.Time.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DATE,
+                org.apache.axis2.databinding.types.soapencoding.Date.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GYEARMONTH,
+                org.apache.axis2.databinding.types.soapencoding.GYearMonth.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GYEAR,
+                org.apache.axis2.databinding.types.soapencoding.GYear.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GMONTHDAY,
+                org.apache.axis2.databinding.types.soapencoding.GMonthDay.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GDAY,
+                org.apache.axis2.databinding.types.soapencoding.GDay.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_GMONTH,
+                org.apache.axis2.databinding.types.soapencoding.GMonth.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_BOOLEAN,
+                org.apache.axis2.databinding.types.soapencoding._boolean.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_BASE64BINARY,
+                org.apache.axis2.databinding.types.soapencoding.Base64Binary.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_HEXBINARY,
+                org.apache.axis2.databinding.types.soapencoding.HexBinary.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_FLOAT,
+                org.apache.axis2.databinding.types.soapencoding._float.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DOUBLE,
+                org.apache.axis2.databinding.types.soapencoding._double.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ANYURI,
+                org.apache.axis2.databinding.types.soapencoding.AnyURI.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_QNAME,
+                org.apache.axis2.databinding.types.soapencoding.QName.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_STRING,
+                org.apache.axis2.databinding.types.soapencoding.String.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NORMALIZEDSTRING,
+                org.apache.axis2.databinding.types.soapencoding.NormalizedString.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_TOKEN,
+                org.apache.axis2.databinding.types.soapencoding.Token.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_LANGUAGE,
+                org.apache.axis2.databinding.types.soapencoding.Language.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NAME,
+                org.apache.axis2.databinding.types.soapencoding.Name.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NMTOKEN,
+                org.apache.axis2.databinding.types.soapencoding.NMTOKEN.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NCNAME,
+                org.apache.axis2.databinding.types.soapencoding.NCName.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NMTOKENS,
+                org.apache.axis2.databinding.types.soapencoding.NMTOKENS.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ID,
+                org.apache.axis2.databinding.types.soapencoding.ID.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_IDREF,
+                org.apache.axis2.databinding.types.soapencoding.IDREF.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ENTITY,
+                org.apache.axis2.databinding.types.soapencoding.ENTITY.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_IDREFS,
+                org.apache.axis2.databinding.types.soapencoding.IDREFS.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_ENTITIES,
+                org.apache.axis2.databinding.types.soapencoding.ENTITIES.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_DECIMAL,
+                org.apache.axis2.databinding.types.soapencoding.Decimal.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_INTEGER,
+                org.apache.axis2.databinding.types.soapencoding.Integer.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NONPOSITIVEINTEGER,
+                org.apache.axis2.databinding.types.soapencoding.NonPositiveInteger.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NEGATIVEINTEGER,
+                org.apache.axis2.databinding.types.soapencoding.NegativeInteger.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_LONG,
+                org.apache.axis2.databinding.types.soapencoding._long.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_INT,
+                org.apache.axis2.databinding.types.soapencoding._int.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_SHORT,
+                org.apache.axis2.databinding.types.soapencoding._short.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_BYTE,
+                org.apache.axis2.databinding.types.soapencoding._byte.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_NONNEGATIVEINTEGER,
+                org.apache.axis2.databinding.types.soapencoding.NonNegativeInteger.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_UNSIGNEDLONG,
+                org.apache.axis2.databinding.types.soapencoding.UnsignedLong.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_UNSIGNEDINT,
+                org.apache.axis2.databinding.types.soapencoding.UnsignedInt.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_UNSIGNEDSHORT,
+                org.apache.axis2.databinding.types.soapencoding.UnsignedShort.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_UNSIGNEDBYTE,
+                org.apache.axis2.databinding.types.soapencoding.UnsignedByte.class.getName());
+        addSoapEncodingTypeMapping(SchemaConstants.SOAP_ENCODING_POSITIVEINTEGER,
+                org.apache.axis2.databinding.types.soapencoding.PositiveInteger.class.getName());
+    }
+
+    private static void addSoapEncodingTypeMapping(QName name, String className) {
+        soapEncodingTypeMap.put(name, className);
+    }
+
 
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/TypeMap.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/TypeMap.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/TypeMap.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/typemap/TypeMap.java Tue Jan 15 08:21:22 2008
@@ -26,4 +26,7 @@
 public interface TypeMap {
 
     public Map getTypeMap();
+
+    public Map getSoapEncodingTypesMap();
+    
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/BeanWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/BeanWriter.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/BeanWriter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/BeanWriter.java Tue Jan 15 08:21:22 2008
@@ -74,6 +74,7 @@
      */
     public String write(QName qname,
                         Map typeMap,
+                        Map groupTypeMap,
                         BeanWriterMetaInfoHolder metainf,
                         boolean isAbstract)
             throws SchemaCompilationException;
@@ -87,7 +88,10 @@
      * @return Returns String.
      * @throws SchemaCompilationException
      */
-    public String write(XmlSchemaElement element, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException;
+    public String write(XmlSchemaElement element,
+                        Map typeMap,
+                        Map groupTypeMap,
+                        BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException;
 
 
     /**
@@ -99,7 +103,10 @@
      * @return Returns String.
      * @throws SchemaCompilationException
      */
-    public String write(XmlSchemaSimpleType simpleType, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException;
+    public String write(XmlSchemaSimpleType simpleType,
+                        Map typeMap,
+                        Map groupTypeMap,
+                        BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException;
 
 
      /**

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/CStructWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/CStructWriter.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/CStructWriter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/CStructWriter.java Tue Jan 15 08:21:22 2008
@@ -77,10 +77,10 @@
     // useful when  only a list of external elements need to be processed
 
     public static final String DEFAULT_CLASS_NAME = "axiom_node_t*";
-    public static final String DEFAULT_CLASS_ARRAY_NAME = "axis2_array_list_t";
+    public static final String DEFAULT_CLASS_ARRAY_NAME = "axiom_node_t*";
 
     public static final String DEFAULT_ATTRIB_CLASS_NAME = "axiom_attribute_t*";
-    public static final String DEFAULT_ATTRIB_ARRAY_CLASS_NAME = "axis2_array_list_t";
+    public static final String DEFAULT_ATTRIB_ARRAY_CLASS_NAME = "axiom_attribute_t*";
 
 
 
@@ -159,12 +159,15 @@
      * @throws org.apache.axis2.schema.SchemaCompilationException
      *
      */
-    public String write(XmlSchemaElement element, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
+    public String write(XmlSchemaElement element,
+                        Map typeMap,
+                        Map groupTypeMap,
+                        BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
 
         try {
             QName qName = element.getQName();
 
-            return process(qName, metainf, typeMap, true);
+            return process(qName, metainf, typeMap, groupTypeMap, true, false);
         } catch (Exception e) {
             throw new SchemaCompilationException(e);
         }
@@ -183,13 +186,14 @@
      */
     public String write(QName qName,
                         Map typeMap,
+                        Map groupTypeMap,
                         BeanWriterMetaInfoHolder metainf,
                         boolean isAbstract)
             throws SchemaCompilationException {
 
         try {
             //determine the package for this type.
-            return process(qName, metainf, typeMap, false);
+            return process(qName, metainf, typeMap, groupTypeMap, false, isAbstract);
 
         } catch (SchemaCompilationException e) {
             throw e;
@@ -228,14 +232,18 @@
      *
      * @see BeanWriter#write(org.apache.ws.commons.schema.XmlSchemaSimpleType, java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)
      */
-    public String write(XmlSchemaSimpleType simpleType, Map typeMap, BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
+    public String write(XmlSchemaSimpleType simpleType,
+                        Map typeMap,
+                        Map groupTypeMap,
+                        BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
         try {
             //determine the package for this type.
             QName qName = simpleType.getQName();
             if (qName == null) {
                 qName = (QName) simpleType.getMetaInfoMap().get(SchemaConstants.SchemaCompilerInfoHolder.FAKE_QNAME);
             }
-            return process(qName, metainf, typeMap, false);
+            metainf.addtStatus(qName, SchemaConstants.SIMPLE_TYPE_OR_CONTENT);
+            return process(qName, metainf, typeMap, groupTypeMap, true, false);
 
         } catch (SchemaCompilationException e) {
             throw e;
@@ -288,14 +296,20 @@
      * @return Returns String.
      * @throws Exception
      */
-    private String process(QName qName, BeanWriterMetaInfoHolder metainf, Map typeMap, boolean isElement) throws Exception {
+    private String process(QName qName,
+                        BeanWriterMetaInfoHolder metainf,
+                        Map typeMap,
+                        Map groupTypeMap,
+                        boolean isElement,
+                        boolean isAbstract)
+            throws Exception {
         String fullyQualifiedClassName = metainf.getOwnClassName();
         if (fullyQualifiedClassName == null)
             fullyQualifiedClassName = makeFullyQualifiedClassName(qName);
         String className = fullyQualifiedClassName;
 
 
-        String originalName = qName.getLocalPart();
+        String originalName = qName == null? "" : qName.getLocalPart();
         ArrayList propertyNames = new ArrayList();
 
         if (!templateLoaded) {
@@ -306,19 +320,26 @@
         //global class that is generated, one needs to call the writeBatch() method
         if (wrapClasses) {
             globalWrappedSourceDocument.getDocumentElement().appendChild(
-                    getBeanElement(globalWrappedSourceDocument, className, originalName, qName, isElement, metainf, propertyNames, typeMap)
-            );
+                    getBeanElement(globalWrappedSourceDocument, className,
+                        originalName, qName, isElement, isAbstract, 
+                        metainf, propertyNames, typeMap, groupTypeMap));
+
             globalWrappedHeaderDocument.getDocumentElement().appendChild(
-                    getBeanElement(globalWrappedHeaderDocument, className, originalName, qName, isElement, metainf, propertyNames, typeMap)
-            );
+                    getBeanElement(globalWrappedHeaderDocument, className,
+                        originalName, qName, isElement, isAbstract, 
+                        metainf, propertyNames, typeMap, groupTypeMap));
 
         } else {
             //create the model
             Document modelSource = XSLTUtils.getDocument();
             Document modelHeader = XSLTUtils.getDocument();
             //make the XML
-            modelSource.appendChild(getBeanElement(modelSource, className, originalName, qName, isElement, metainf, propertyNames, typeMap));
-            modelHeader.appendChild(getBeanElement(modelHeader, className, originalName, qName, isElement, metainf, propertyNames, typeMap));
+            modelSource.appendChild(getBeanElement(modelSource, className, originalName,
+                    qName, isElement, isAbstract, metainf, propertyNames,
+                    typeMap, groupTypeMap));
+            modelHeader.appendChild(getBeanElement(modelHeader, className, originalName,
+                    qName, isElement, isAbstract, metainf, propertyNames,
+                    typeMap, groupTypeMap));
 
             if (writeClasses) {
                 //create the file
@@ -363,10 +384,17 @@
      *
      */
     private Element getBeanElement(
-            Document model, String className, String originalName,
-            QName qName, boolean isElement,
-            BeanWriterMetaInfoHolder metainf, ArrayList propertyNames, Map typeMap
-    ) throws SchemaCompilationException {
+            Document model,
+            String className,
+            String originalName,
+            QName qName,
+            boolean isElement,
+            boolean isAbstract,
+            BeanWriterMetaInfoHolder metainf,
+            ArrayList propertyNames,
+            Map typeMap,
+            Map groupTypeMap)
+     throws SchemaCompilationException {
 
         Element rootElt = XSLTUtils.getElement(model, "class");
         XSLTUtils.addAttribute(model, "name", className, rootElt);
@@ -384,6 +412,10 @@
             XSLTUtils.addAttribute(model, "unwrapped", "yes", rootElt);
         }
 
+        if (isAbstract) {
+            XSLTUtils.addAttribute(model, "isAbstract", "yes", rootElt);
+        }
+
         if (!writeClasses) {
             XSLTUtils.addAttribute(model, "skip-write", "yes", rootElt);
         }
@@ -439,14 +471,14 @@
         }
 
         //populate all the information
-        populateInfo(metainf, model, rootElt, propertyNames, typeMap, false);
+        populateInfo(metainf, model, rootElt, propertyNames, typeMap, groupTypeMap, false);
 
         if (metainf.isSimple() && metainf.isUnion()) {
             populateMemberInfo(metainf, model, rootElt, typeMap);
         }
 
         if (metainf.isSimple() && metainf.isList()) {
-            populateListInfo(metainf, model, rootElt, typeMap);
+            populateListInfo(metainf, model, rootElt, typeMap, groupTypeMap);
         }
 
         return rootElt;
@@ -455,7 +487,8 @@
     protected void populateListInfo(BeanWriterMetaInfoHolder metainf,
                                     Document model,
                                     Element rootElement,
-                                    Map typeMap) {
+                                    Map typeMap,
+                                    Map groupTypeMap) {
 
         String cName = makeUniqueCStructName(new ArrayList(), metainf.getItemTypeQName().getLocalPart());
         Element itemType = XSLTUtils.addChildElement(model, "itemtype", rootElement);
@@ -464,7 +497,8 @@
         XSLTUtils.addAttribute(model, "originalName", metainf.getItemTypeQName().getLocalPart(), itemType);
         XSLTUtils.addAttribute(model, "cname", cName, itemType);
 
-        if (typeMap.containsKey(metainf.getItemTypeQName())) {
+        if (typeMap.containsKey(metainf.getItemTypeQName()) ||
+                groupTypeMap.containsKey(metainf.getItemTypeClassName())) {
             XSLTUtils.addAttribute(model, "ours", "true", itemType);
         }
         if (PrimitiveTypeFinder.isPrimitive(metainf.getItemTypeClassName())) {
@@ -512,11 +546,15 @@
                               Document model,
                               Element rootElt,
                               ArrayList propertyNames,
-                              Map typeMap, boolean isInherited) throws SchemaCompilationException {
-        if (metainf.getParent() != null) {
-            populateInfo(metainf.getParent(), model, rootElt, propertyNames, typeMap, true);
+                              Map typeMap,
+                              Map groupTypeMap,
+                              boolean isInherited) throws SchemaCompilationException {
+        if (metainf.getParent() != null && (!metainf.isRestriction() || (metainf.isRestriction() && metainf.isSimple())))
+        {
+            populateInfo(metainf.getParent(), model, rootElt, propertyNames,
+                    typeMap, groupTypeMap, true);
         }
-        addPropertyEntries(metainf, model, rootElt, propertyNames, typeMap, isInherited);
+        addPropertyEntries(metainf, model, rootElt, propertyNames, typeMap, groupTypeMap, isInherited);
 
     }
 
@@ -529,8 +567,11 @@
      * @throws org.apache.axis2.schema.SchemaCompilationException
 -     *
      */
-    private void addPropertyEntries(BeanWriterMetaInfoHolder metainf, Document model, Element rootElt, ArrayList propertyNames,
+    private void addPropertyEntries(BeanWriterMetaInfoHolder metainf,
+                                    Document model, Element rootElt,
+                                    ArrayList propertyNames,
                                     Map typeMap,
+                                    Map groupTypeMap,
                                     boolean isInherited) throws SchemaCompilationException {
         // go in the loop and add the part elements
         QName[] qName;
@@ -634,13 +675,6 @@
                 XSLTUtils.addAttribute(model, "inherited", "yes", property);
             }
 
-            QName schemaQName = metainf.getSchemaQNameForQName(name);
-            if(!schemaQName.getNamespaceURI().equals(name.getNamespaceURI())){
-                XSLTUtils.addAttribute(model, "child-nsuri", schemaQName.getNamespaceURI(), property);
-                XSLTUtils.addAttribute(model, "child-nsprefix", getPrefixForURI(schemaQName.getNamespaceURI(), null), property);
-
-            }
-
             if (metainf.getAnyStatusForQName(name)) {
                 XSLTUtils.addAttribute(model, "any", "yes", property);
             }
@@ -688,6 +722,7 @@
                         model,
                         property,
                         typeMap,
+                        groupTypeMap,
                         CClassNameForElement);
 
             } else {
@@ -697,6 +732,7 @@
                         model,
                         property,
                         typeMap,
+                        groupTypeMap,
                         CClassNameForElement);
             }
         }
@@ -707,13 +743,15 @@
                                              Document model,
                                              Element property,
                                              Map typeMap,
+                                             Map groupTypeMap,
                                              String javaClassNameForElement) {
             // add an attribute that says the type is default
             if (metainf.getDefaultStatusForQName(name)) {
                 XSLTUtils.addAttribute(model, "default", "yes", property);
             }
 
-            if (typeMap.containsKey(metainf.getSchemaQNameForQName(name))) {
+            if (typeMap.containsKey(metainf.getSchemaQNameForQName(name)) ||
+                groupTypeMap.containsKey(metainf.getSchemaQNameForQName(name))) {
                 XSLTUtils.addAttribute(model, "ours", "yes", property);
             }
 

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/src/org/apache/axis2/schema/writer/JavaBeanWriter.java Tue Jan 15 08:21:22 2008
@@ -44,6 +44,8 @@
 import java.io.*;
 import java.util.*;
 
+
+
 /**
  * Java Bean writer for the schema compiler.
  */
@@ -59,6 +61,8 @@
 
     private Templates templateCache;
 
+    private List nameList;
+
     private Map packageNameToClassNamesMap;
 
     private static int count = 0;
@@ -208,13 +212,15 @@
      * @return Returns String.
      * @throws SchemaCompilationException
      */
-    public String write(XmlSchemaElement element, Map typeMap,
+    public String write(XmlSchemaElement element,
+                        Map typeMap,
+                        Map groupTypeMap,
                         BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
 
         try {
             QName qName = element.getQName();
 
-            return process(qName, metainf, typeMap, true, false);
+            return process(qName, metainf, typeMap, groupTypeMap, true, false);
         } catch (Exception e) {
             e.printStackTrace();
             throw new SchemaCompilationException(e);
@@ -233,13 +239,14 @@
      */
     public String write(QName qName,
                         Map typeMap,
+                        Map groupTypeMap,
                         BeanWriterMetaInfoHolder metainf,
                         boolean isAbstract)
             throws SchemaCompilationException {
 
         try {
             // determine the package for this type.
-            return process(qName, metainf, typeMap, false,isAbstract);
+            return process(qName, metainf, typeMap, groupTypeMap, false,isAbstract);
 
         } catch (SchemaCompilationException e) {
             throw e;
@@ -281,10 +288,10 @@
      * @param metainf
      * @return Returns String.
      * @throws SchemaCompilationException
-     * @see BeanWriter#write(org.apache.ws.commons.schema.XmlSchemaSimpleType,
-     *      java.util.Map, org.apache.axis2.schema.BeanWriterMetaInfoHolder)
      */
-    public String write(XmlSchemaSimpleType simpleType, Map typeMap,
+    public String write(XmlSchemaSimpleType simpleType,
+                        Map typeMap,
+                        Map groupTypeMap,
                         BeanWriterMetaInfoHolder metainf) throws SchemaCompilationException {
         try {
             QName qName = simpleType.getQName();
@@ -292,7 +299,7 @@
                 qName = (QName) simpleType.getMetaInfoMap().get(SchemaConstants.SchemaCompilerInfoHolder.FAKE_QNAME);
             }
             metainf.addtStatus(qName, SchemaConstants.SIMPLE_TYPE_OR_CONTENT);
-            return process(qName, metainf, typeMap, true, false);
+            return process(qName, metainf, typeMap, groupTypeMap, true, false);
         } catch (Exception e) {
             throw new SchemaCompilationException(e);
         }
@@ -312,7 +319,7 @@
         } else {
             this.rootDir = rootDir;
         }
-
+        this.nameList = new ArrayList();
         this.packageNameToClassNamesMap = new HashMap();
         javaBeanTemplateName = SchemaPropertyLoader.getBeanTemplate();
     }
@@ -332,12 +339,20 @@
         String packageName = getPackage(namespaceURI);
 
         String originalName = qName.getLocalPart();
+        String className = null;
 
-        if (!this.packageNameToClassNamesMap.containsKey(packageName)){
-            this.packageNameToClassNamesMap.put(packageName, new ArrayList());
+        // when wrapping classes all the data binding and exception class should have
+        // a unique name since package name is not being applied.
+        // otherewise we can make unique with the package name
+        if (!wrapClasses){
+            className = makeUniqueJavaClassName(this.nameList, originalName);
+        } else {
+            if (!this.packageNameToClassNamesMap.containsKey(packageName)) {
+                this.packageNameToClassNamesMap.put(packageName, new ArrayList());
+            }
+            className = makeUniqueJavaClassName((List) this.packageNameToClassNamesMap.get(packageName), originalName);
         }
-        String className =
-                makeUniqueJavaClassName((List) this.packageNameToClassNamesMap.get(packageName), originalName);
+
 
         String packagePrefix = null;
 
@@ -386,6 +401,7 @@
     private String process(QName qName,
                            BeanWriterMetaInfoHolder metainf,
                            Map typeMap,
+                           Map groupTypeMap,
                            boolean isElement,
                            boolean isAbstract)
             throws Exception {
@@ -419,7 +435,7 @@
             globalWrappedDocument.getDocumentElement().appendChild(
                     getBeanElement(globalWrappedDocument, className,
                             originalName, basePackageName, qName, isElement,isAbstract,
-                            metainf, propertyNames, typeMap));
+                            metainf, propertyNames, typeMap, groupTypeMap));
 
         } else {
             // create the model
@@ -427,7 +443,7 @@
             // make the XML
             model.appendChild(getBeanElement(model, className, originalName,
                     basePackageName, qName, isElement,isAbstract, metainf, propertyNames,
-                    typeMap));
+                    typeMap, groupTypeMap));
 
             if (writeClasses) {
                 // create the file
@@ -485,7 +501,8 @@
                                    boolean isAbstract,
                                    BeanWriterMetaInfoHolder metainf,
                                    ArrayList propertyNames,
-                                   Map typeMap)
+                                   Map typeMap,
+                                   Map groupTypeMap)
             throws SchemaCompilationException {
 
         Element rootElt = XSLTUtils.getElement(model, "bean");
@@ -493,8 +510,7 @@
         XSLTUtils.addAttribute(model, "originalName", originalName, rootElt);
         XSLTUtils.addAttribute(model, "package", packageName, rootElt);
         XSLTUtils.addAttribute(model, "nsuri", qName.getNamespaceURI(), rootElt);
-        XSLTUtils.addAttribute(model, "isUseWrapperClasses", isUseWrapperClasses? "yes" : "false", rootElt);
-        XSLTUtils.addAttribute(model, "nsprefix", isSuppressPrefixesMode ? "" : getPrefixForURI(qName
+       XSLTUtils.addAttribute(model, "nsprefix", isSuppressPrefixesMode ? "" : getPrefixForURI(qName
                 .getNamespaceURI(), qName.getPrefix()), rootElt);
 
         if (!wrapClasses) {
@@ -517,6 +533,10 @@
             XSLTUtils.addAttribute(model, "anon", "yes", rootElt);
         }
 
+        if (isUseWrapperClasses){
+            XSLTUtils.addAttribute(model, "usewrapperclasses", "yes", rootElt);
+        }
+
         if (metainf.isExtension()) {
             XSLTUtils.addAttribute(model, "extension", metainf
                     .getExtensionClassName(), rootElt);
@@ -563,14 +583,14 @@
         }
 
         // populate all the information
-        populateInfo(metainf, model, rootElt, propertyNames, typeMap, false);
+        populateInfo(metainf, model, rootElt, propertyNames, typeMap, groupTypeMap, false);
 
         if (metainf.isSimple() && metainf.isUnion()) {
             populateMemberInfo(metainf, model, rootElt, typeMap);
         }
 
         if (metainf.isSimple() && metainf.isList()) {
-            populateListInfo(metainf, model, rootElt, typeMap);
+            populateListInfo(metainf, model, rootElt, typeMap, groupTypeMap);
         }
         //////////////////////////////////////////////////////////
 //        System.out.println(DOM2Writer.nodeToString(rootElt));
@@ -582,7 +602,8 @@
     protected void populateListInfo(BeanWriterMetaInfoHolder metainf,
                                     Document model,
                                     Element rootElement,
-                                    Map typeMap) {
+                                    Map typeMap,
+                                    Map groupTypeMap) {
 
         String javaName = makeUniqueJavaClassName(new ArrayList(), metainf.getItemTypeQName().getLocalPart());
         Element itemType = XSLTUtils.addChildElement(model, "itemtype", rootElement);
@@ -592,9 +613,10 @@
         XSLTUtils.addAttribute(model, "javaname", javaName, itemType);
 
 
-        if (typeMap.containsKey(metainf.getItemTypeQName())) {
-                XSLTUtils.addAttribute(model, "ours", "true", itemType);
-            }
+        if (typeMap.containsKey(metainf.getItemTypeQName()) ||
+                groupTypeMap.containsKey(metainf.getItemTypeClassName())) {
+            XSLTUtils.addAttribute(model, "ours", "true", itemType);
+        }
         if (PrimitiveTypeFinder.isPrimitive(metainf.getItemTypeClassName())) {
             XSLTUtils.addAttribute(model, "primitive", "yes", itemType);
         }
@@ -639,8 +661,12 @@
      * @param typeMap
      * @throws SchemaCompilationException
      */
-    private void populateInfo(BeanWriterMetaInfoHolder metainf, Document model,
-                              Element rootElt, ArrayList propertyNames, Map typeMap,
+    private void populateInfo(BeanWriterMetaInfoHolder metainf,
+                              Document model,
+                              Element rootElt,
+                              ArrayList propertyNames,
+                              Map typeMap,
+                              Map groupTypeMap,
                               boolean isInherited) throws SchemaCompilationException {
         // we should add parent class details only if it is
         // an extension or simple restriction
@@ -648,9 +674,9 @@
         if (metainf.getParent() != null && (!metainf.isRestriction() || (metainf.isRestriction() && metainf.isSimple())))
         {
             populateInfo(metainf.getParent(), model, rootElt, propertyNames,
-                    typeMap, true);
+                    typeMap, groupTypeMap, true);
         }
-        addPropertyEntries(metainf, model, rootElt, propertyNames, typeMap,
+        addPropertyEntries(metainf, model, rootElt, propertyNames, typeMap, groupTypeMap,
                 isInherited);
 
     }
@@ -664,8 +690,11 @@
      * @throws SchemaCompilationException
      */
     private void addPropertyEntries(BeanWriterMetaInfoHolder metainf,
-                                    Document model, Element rootElt, ArrayList propertyNames,
-                                    Map typeMap, boolean isInherited) throws SchemaCompilationException {
+                                    Document model, Element rootElt,
+                                    ArrayList propertyNames,
+                                    Map typeMap,
+                                    Map groupTypeMap,
+                                    boolean isInherited) throws SchemaCompilationException {
         // go in the loop and add the part elements
         QName[] qName;
         String javaClassNameForElement;
@@ -743,6 +772,7 @@
 
             XSLTUtils.addAttribute(model, "type", javaClassNameForElement, property);
 
+
             if (PrimitiveTypeFinder.isPrimitive(javaClassNameForElement)) {
 
                 XSLTUtils.addAttribute(model, "primitive", "yes", property);
@@ -799,6 +829,8 @@
                 XSLTUtils.addAttribute(model, "innerchoice", "yes", property);
             }
 
+
+
             if ((parentMetaInf != null) && metainf.isRestriction() && missingQNames.contains(name)) {
                 // this element details should be there with the parent meta Inf
                 addAttributesToProperty(
@@ -807,6 +839,7 @@
                         model,
                         property,
                         typeMap,
+                        groupTypeMap,
                         javaClassNameForElement);
 
             } else {
@@ -816,6 +849,7 @@
                         model,
                         property,
                         typeMap,
+                        groupTypeMap,
                         javaClassNameForElement);
             }
 
@@ -827,13 +861,15 @@
                                          Document model,
                                          Element property,
                                          Map typeMap,
+                                         Map groupTypeMap,
                                          String javaClassNameForElement) {
         // add an attribute that says the type is default
         if (metainf.getDefaultStatusForQName(name)) {
             XSLTUtils.addAttribute(model, "default", "yes", property);
         }
 
-        if (typeMap.containsKey(metainf.getSchemaQNameForQName(name))) {
+        if (typeMap.containsKey(metainf.getSchemaQNameForQName(name)) ||
+                groupTypeMap.containsKey(metainf.getSchemaQNameForQName(name))) {
             XSLTUtils.addAttribute(model, "ours", "yes", property);
         }
 

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/sub-build.xml Tue Jan 15 08:21:22 2008
@@ -394,6 +394,15 @@
 			<arg file="${testsuite.source.dir}/complexExtension.xsd"/>
 			<arg file="${schema.generated.src.dir}"/>
 		</java>
+
+         <echo>Compiling soapencoding.xsd</echo>
+		<java classname="org.apache.axis2.schema.XSD2Java" fork="true">
+			<jvmarg line="${maven.junit.jvmargs}"/>
+			<classpath refid="maven.dependency.classpath"/>
+			<classpath location="${compiled.classes.dir}"/>
+			<arg file="${testsuite.source.dir}/soapencoding.xsd"/>
+			<arg file="${schema.generated.src.dir}"/>
+		</java>
     </target>
 
 </project>

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/groups.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/groups.xsd?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/groups.xsd (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/groups.xsd Tue Jan 15 08:21:22 2008
@@ -78,7 +78,6 @@
             <xs:group ref="tns:TestChoiceGroup"/>
         </xs:choice>
     </xs:group>
-
     <xs:element name="TestAttributeGroupElement">
         <xs:complexType>
             <xs:sequence>
@@ -87,11 +86,9 @@
             <xs:attributeGroup ref="tns:TestAttributeGroup" />
         </xs:complexType>
     </xs:element>
-
     <xs:attributeGroup name="TestAttributeGroup">
         <xs:attribute name="attribute1" type="xs:string"/>
     </xs:attributeGroup>
-
     <xs:element name="TestNestedAttributeGroupElement">
         <xs:complexType>
             <xs:sequence>
@@ -100,7 +97,6 @@
             <xs:attributeGroup ref="tns:TestNestedAttributeGroup" />
         </xs:complexType>
     </xs:element>
-
     <xs:attributeGroup name="TestNestedAttributeGroup">
         <xs:attribute name="attribute2" type="xs:string"/>
         <xs:attributeGroup ref="tns:TestAttributeGroup" />

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/innerParticles.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/innerParticles.xsd?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/innerParticles.xsd (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/innerParticles.xsd Tue Jan 15 08:21:22 2008
@@ -106,4 +106,29 @@
         <xsd:sequence>
         </xsd:sequence>
     </xsd:complexType>
+
+    <xsd:complexType name="TestComplexType">
+        <xsd:sequence>
+            <xsd:element ref="test1:TestElement"/>
+            <xsd:sequence>
+                <xsd:element name="TestInnerElement" minOccurs="0">
+                    <xsd:complexType>
+                        <xsd:sequence>
+                        </xsd:sequence>
+                    </xsd:complexType>
+                </xsd:element>
+            </xsd:sequence>
+        </xsd:sequence>
+    </xsd:complexType>
+
+    <xsd:element name="TestElement">
+        <xsd:complexType>
+            <xsd:sequence>
+                <xsd:element name="param" type="xsd:string"/>
+            </xsd:sequence>
+        </xsd:complexType>
+    </xsd:element>
+
+    <xsd:element name="TestComplexTypeElement" type="test1:TestComplexType"/>
+
 </xsd:schema>

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/restrictions.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/restrictions.xsd?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/restrictions.xsd (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/restrictions.xsd Tue Jan 15 08:21:22 2008
@@ -189,7 +189,21 @@
         </xsd:restriction>
     </xsd:simpleType>
 
-
-
+    <xsd:element name="GetExemplarResponseTypeElement" type="tns:getExemplarResponseType"/>
+    <xsd:complexType name="getExemplarResponseType">
+        <xsd:complexContent>
+            <xsd:restriction base="xsd:anyType">
+                <xsd:sequence>
+                    <xsd:element name="exemplar" type="xsd:string"/>
+                </xsd:sequence>
+                <xsd:attributeGroup ref="tns:ResponseAttributeGroup"/>
+                <xsd:attribute name="supportedMethods" type="xsd:string" use="optional"/>
+            </xsd:restriction>
+        </xsd:complexContent>
+    </xsd:complexType>
+    <xsd:attributeGroup name="ResponseAttributeGroup">
+        <xsd:attribute name="responseCode" type="xsd:integer" use="optional" default="0"/>
+        <xsd:attribute name="responseMessage" type="xsd:string" use="optional"/>
+    </xsd:attributeGroup>
 
 </xsd:schema>

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/union2.xsd
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/union2.xsd?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/union2.xsd (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test-resources/testsuite/union2.xsd Tue Jan 15 08:21:22 2008
@@ -31,4 +31,19 @@
             <s:attribute name="attribute1" type="tns:TestList1"/>
         </s:complexType>
     </s:element>
+    <s:element name="TestFuzzyDateType" type="tns:fuzzyDateType"/>
+    <s:simpleType name="fuzzyDateType">
+        <s:union memberTypes="s:date s:dateTime s:gYear s:gYearMonth">
+        </s:union>
+    </s:simpleType>
+
+    <s:element name="TestElement">
+        <s:complexType>
+            <s:sequence>
+               <s:element name="creationDate" type="s:string"/>
+               <s:element name="CreationDate" type="s:string"/> 
+            </s:sequence>
+        </s:complexType>
+    </s:element>
+
 </s:schema>

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/innerparticles/InnerParticlesTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/innerparticles/InnerParticlesTest.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/innerparticles/InnerParticlesTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/innerparticles/InnerParticlesTest.java Tue Jan 15 08:21:22 2008
@@ -308,5 +308,37 @@
         }
     }
 
+    public void testTestComplexTypeElement(){
+        TestComplexTypeElement testComplexTypeElement = new TestComplexTypeElement();
+
+        TestComplexType testComplexType = new TestComplexType();
+        testComplexTypeElement.setTestComplexTypeElement(testComplexType);
+
+        TestElement_type0 testElement_type0 = new TestElement_type0();
+        testElement_type0.setParam("param");
+        testComplexType.setTestElement(testElement_type0);
+
+        TestComplexTypeSequence_type0 testComplexTypeSequence_type0 = new TestComplexTypeSequence_type0();
+        testComplexType.setTestComplexTypeSequence_type0(testComplexTypeSequence_type0);
+
+        try {
+            OMElement omElement = testComplexTypeElement.getOMElement(
+                    TestComplexTypeElement.MY_QNAME,OMAbstractFactory.getOMFactory());
+            String omElementString = omElement.toStringWithConsume();
+            System.out.println("OM String ==> " + omElementString);
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(
+                    new ByteArrayInputStream(omElementString.getBytes()));
+            TestComplexTypeElement result = TestComplexTypeElement.Factory.parse(xmlReader);
+            assertEquals(result.getTestComplexTypeElement().getTestElement().getParam(),"param");
+        } catch (ADBException e) {
+            fail();
+        } catch (XMLStreamException e) {
+            fail();
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail();
+        }
+    }
+
 
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/restriction/ComplexRestrictionTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/restriction/ComplexRestrictionTest.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/restriction/ComplexRestrictionTest.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/restriction/ComplexRestrictionTest.java Tue Jan 15 08:21:22 2008
@@ -20,9 +20,50 @@
 
 import junit.framework.TestCase;
 
+import java.io.ByteArrayInputStream;
+import java.math.BigInteger;
+
+import org.tempuri.GetExemplarResponseType;
+import org.tempuri.GetExemplarResponseTypeElement;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axis2.databinding.ADBException;
+
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
 public class ComplexRestrictionTest extends TestCase {
-    public void testComplexRestriction(){
-        
+
+    public void testGetExemplarResponseTypeElement(){
+        GetExemplarResponseTypeElement getExemplarResponseTypeElement = new GetExemplarResponseTypeElement();
+        GetExemplarResponseType getExemplarResponseType = new GetExemplarResponseType();
+        getExemplarResponseType.setExemplar("test string1");
+        getExemplarResponseType.setResponseCode(new BigInteger("23"));
+        getExemplarResponseType.setResponseMessage("test string2");
+        getExemplarResponseType.setSupportedMethods("test string3");
+
+        getExemplarResponseTypeElement.setGetExemplarResponseTypeElement(getExemplarResponseType);
+
+        try {
+            OMElement omElement =
+                    getExemplarResponseTypeElement.getOMElement(GetExemplarResponseTypeElement.MY_QNAME,
+                            OMAbstractFactory.getOMFactory());
+            String omElementString = omElement.toStringWithConsume();
+            System.out.println("OMElement string ==> " + omElementString);
+            XMLStreamReader xmlReader = StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
+            GetExemplarResponseTypeElement result = GetExemplarResponseTypeElement.Factory.parse(xmlReader);
+            GetExemplarResponseType resultType = result.getGetExemplarResponseTypeElement();
+            assertEquals(resultType.getExemplar(),"test string1");
+            assertEquals(resultType.getResponseMessage(),"test string2");
+            assertEquals(resultType.getSupportedMethods(),"test string3");
+        } catch (ADBException e) {
+            fail();
+        } catch (XMLStreamException e) {
+            fail();
+        } catch (Exception e) {
+            fail();
+        }
     }
 
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/union2/Union2Test.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/union2/Union2Test.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/union2/Union2Test.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb-codegen/test/org/apache/axis2/schema/union2/Union2Test.java Tue Jan 15 08:21:22 2008
@@ -15,10 +15,7 @@
  */
 package org.apache.axis2.schema.union2;
 
-import org.tempuri.union2.TestUnionElement2;
-import org.tempuri.union2.TestUnion1;
-import org.tempuri.union2.TestListElement1;
-import org.tempuri.union2.TestList1;
+import org.tempuri.union2.*;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.util.StAXUtils;
@@ -30,6 +27,7 @@
 import junit.framework.TestCase;
 
 import java.io.ByteArrayInputStream;
+import java.util.Date;
 
 
 public class Union2Test extends TestCase {
@@ -101,6 +99,30 @@
             fail();
         }
 
+    }
+
+    public void testFuzzDateType(){
+        TestFuzzyDateType testFuzzyDateType = new TestFuzzyDateType();
+
+        FuzzyDateType fuzzyDateType = new FuzzyDateType();
+        fuzzyDateType.setObject(new Date());
+
+        testFuzzyDateType.setTestFuzzyDateType(fuzzyDateType);
 
+        try {
+            OMElement omElement = testFuzzyDateType.getOMElement(
+                    TestFuzzyDateType.MY_QNAME,OMAbstractFactory.getOMFactory());
+            String omElementString = omElement.toStringWithConsume();
+            System.out.println("OM Element ==> " + omElementString);
+            XMLStreamReader xmlReader =
+                    StAXUtils.createXMLStreamReader(new ByteArrayInputStream(omElementString.getBytes()));
+            TestFuzzyDateType result = TestFuzzyDateType.Factory.parse(xmlReader);
+        } catch (ADBException e) {
+            fail();
+        } catch (XMLStreamException e) {
+            fail();
+        } catch (Exception e) {
+            fail();
+        }
     }
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/ADBBean.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/ADBBean.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/ADBBean.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/ADBBean.java Tue Jan 15 08:21:22 2008
@@ -24,13 +24,14 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamException;
+import java.io.Serializable;
 
 /*
  * ADBBean - Axis Data Binding Bean. This will be implemented by all the beans that are being generated by
  * Axis2 data binding framework
  */
 
-public interface ADBBean {
+public interface ADBBean extends Serializable {
     /**
      * Serializes an ADBBean. Gets the pull parser and fetches the XML pull events to represent the
      * bean.

Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/types/Time.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/types/Time.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/types/Time.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/types/Time.java Tue Jan 15 08:21:22 2008
@@ -106,7 +106,7 @@
         int second = 0;
         int miliSecond = 0;
         int timeZoneOffSet = TimeZone.getDefault().getRawOffset();
-
+         int milliSecondPartLength = 0;
         if (source.length() >= 8) {
             if ((source.charAt(2) != ':' )|| (source.charAt(5) != ':')){
                 throw new RuntimeException("Invalid time format (" + source + ") having : s in wrong places");
@@ -114,6 +114,9 @@
             hour = Integer.parseInt(source.substring(0, 2));
             minite = Integer.parseInt(source.substring(3, 5));
             second = Integer.parseInt(source.substring(6, 8));
+
+
+
             if (source.length() > 8) {
                 String rest = source.substring(8);
                 if (rest.startsWith(".")) {
@@ -122,19 +125,21 @@
                         // this is in gmt time zone
                         timeZoneOffSet = 0;
                         miliSecond = Integer.parseInt(rest.substring(1, rest.lastIndexOf("Z")));
-
+                        milliSecondPartLength = rest.substring(1,rest.lastIndexOf("Z")).trim().length();
                     } else if ((rest.lastIndexOf("+") > 0) || (rest.lastIndexOf("-") > 0)) {
                         // this is given in a general time zione
                         String timeOffSet = null;
                         if (rest.lastIndexOf("+") > 0) {
                             timeOffSet = rest.substring(rest.lastIndexOf("+") + 1);
                             miliSecond = Integer.parseInt(rest.substring(1, rest.lastIndexOf("+")));
+                            milliSecondPartLength = rest.substring(1, rest.lastIndexOf("+")).trim().length();
                             // we keep +1 or -1 to finally calculate the value
                             timeZoneOffSet = 1;
 
                         } else if (rest.lastIndexOf("-") > 0) {
                             timeOffSet = rest.substring(rest.lastIndexOf("-") + 1);
                             miliSecond = Integer.parseInt(rest.substring(1, rest.lastIndexOf("-")));
+                            milliSecondPartLength = rest.substring(1, rest.lastIndexOf("-")).trim().length();
                             // we keep +1 or -1 to finally calculate the value
                             timeZoneOffSet = -1;
                         }
@@ -149,6 +154,7 @@
                     } else {
                         // i.e it does not have time zone
                         miliSecond = Integer.parseInt(rest.substring(1));
+                        milliSecondPartLength = rest.substring(1).trim().length();
                     }
 
                 } else {
@@ -179,7 +185,17 @@
         calendar.set(Calendar.HOUR_OF_DAY, hour);
         calendar.set(Calendar.MINUTE, minite);
         calendar.set(Calendar.SECOND, second);
+        if (milliSecondPartLength != 3) {
+            // milisecond part represenst the fraction of the second so we have to
+            // find the fraction and multiply it by 1000. So if milisecond part
+            // has three digits nothing required
+            miliSecond = miliSecond * 1000;
+            for (int i = 0; i < milliSecondPartLength; i++) {
+                miliSecond = miliSecond / 10;
+            }
+        }
         calendar.set(Calendar.MILLISECOND, miliSecond);
+
         calendar.set(Calendar.ZONE_OFFSET, timeZoneOffSet);
 
         return calendar;

Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/BeanUtil.java Tue Jan 15 08:21:22 2008
@@ -24,7 +24,11 @@
 import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
 import org.apache.axiom.om.util.Base64;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.deployment.util.BeanExcludeInfo;
+import org.apache.axis2.deployment.util.ExcludeInfo;
+import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.java2wsdl.TypeTable;
+import org.apache.axis2.description.AxisService;
 import org.apache.axis2.databinding.typemapping.SimpleTypeMapper;
 import org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl;
 import org.apache.axis2.engine.ObjectSupplier;
@@ -103,19 +107,39 @@
                                             "elementName");
             }
 
+            AxisService axisService = null;
+            if (MessageContext.getCurrentMessageContext() != null) {
+                axisService = MessageContext.getCurrentMessageContext().getAxisService();
+            }
+            BeanExcludeInfo beanExcludeInfo = null;
+            if (axisService != null && axisService.getExcludeInfo() != null) {
+                beanExcludeInfo = axisService.getExcludeInfo().getBeanExcludeInfoForClass(
+                        jClass.getQualifiedName());
+            }
             // properties from JAM
             ArrayList propertyList = new ArrayList();
             JProperty properties [] = jClass.getDeclaredProperties();
             for (int i = 0; i < properties.length; i++) {
                 JProperty property = properties[i];
-                propertyList.add(property);
+                String propertyName = getCorrectName(property.getSimpleName());
+                if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcludedProperty(propertyName)){
+                    propertyList.add(property);
+                }
+
             }
             JClass supClass = jClass.getSuperclass();
-            while (!"java.lang.Object".equals(supClass.getQualifiedName())) {
+            while (!supClass.getQualifiedName().startsWith("java.")) {
                 properties = supClass.getDeclaredProperties();
+                ExcludeInfo excludeInfo = axisService.getExcludeInfo();
+                if (excludeInfo != null) {
+                    beanExcludeInfo = excludeInfo.getBeanExcludeInfoForClass(supClass.getQualifiedName());
+                }
                 for (int i = 0; i < properties.length; i++) {
                     JProperty property = properties[i];
-                    propertyList.add(property);
+                    String propertyName = getCorrectName(property.getSimpleName());
+                    if ((beanExcludeInfo == null) || !beanExcludeInfo.isExcludedProperty(propertyName)) {
+                        propertyList.add(property);
+                    }
                 }
                 supClass = supClass.getSuperclass();
             }

Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/ConverterUtil.java Tue Jan 15 08:21:22 2008
@@ -159,7 +159,19 @@
     }
 
     public static void appendDate(StringBuffer dateString, Calendar calendar) {
-        dateString.append(calendar.get(Calendar.YEAR)).append("-");
+
+        int year = calendar.get(Calendar.YEAR);
+
+        if (year < 1000){
+            dateString.append("0");
+        }
+        if (year < 100){
+            dateString.append("0");
+        }
+        if (year < 10) {
+            dateString.append("0");
+        }
+        dateString.append(year).append("-");
 
         // xml date month is started from 1 and calendar month is
         // started from 0. so have to add one
@@ -861,6 +873,8 @@
             minite = Integer.parseInt(source.substring(14, 16));
             second = Integer.parseInt(source.substring(17, 19));
 
+            int milliSecondPartLength = 0;
+
             if (source.length() > 19)  {
                 String rest = source.substring(19);
                 if (rest.startsWith(".")) {
@@ -869,19 +883,21 @@
                         // this is in gmt time zone
                         timeZoneOffSet = 0;
                         miliSecond = Integer.parseInt(rest.substring(1, rest.lastIndexOf("Z")));
-
+                        milliSecondPartLength = rest.substring(1,rest.lastIndexOf("Z")).trim().length();
                     } else if ((rest.lastIndexOf("+") > 0) || (rest.lastIndexOf("-") > 0)) {
                         // this is given in a general time zione
                         String timeOffSet = null;
                         if (rest.lastIndexOf("+") > 0) {
                             timeOffSet = rest.substring(rest.lastIndexOf("+") + 1);
                             miliSecond = Integer.parseInt(rest.substring(1, rest.lastIndexOf("+")));
+                            milliSecondPartLength = rest.substring(1, rest.lastIndexOf("+")).trim().length();
                             // we keep +1 or -1 to finally calculate the value
                             timeZoneOffSet = 1;
 
                         } else if (rest.lastIndexOf("-") > 0) {
                             timeOffSet = rest.substring(rest.lastIndexOf("-") + 1);
                             miliSecond = Integer.parseInt(rest.substring(1, rest.lastIndexOf("-")));
+                            milliSecondPartLength = rest.substring(1, rest.lastIndexOf("-")).trim().length();
                             // we keep +1 or -1 to finally calculate the value
                             timeZoneOffSet = -1;
                         }
@@ -896,6 +912,7 @@
                     } else {
                         // i.e it does not have time zone
                         miliSecond = Integer.parseInt(rest.substring(1));
+                        milliSecondPartLength = rest.substring(1).trim().length();
                     }
 
                 } else {
@@ -926,6 +943,15 @@
             calendar.set(Calendar.HOUR_OF_DAY, hour);
             calendar.set(Calendar.MINUTE, minite);
             calendar.set(Calendar.SECOND, second);
+            if (milliSecondPartLength != 3){
+                // milisecond part represenst the fraction of the second so we have to
+                // find the fraction and multiply it by 1000. So if milisecond part
+                // has three digits nothing required
+                miliSecond = miliSecond * 1000;
+                for (int i = 0; i < milliSecondPartLength; i++) {
+                    miliSecond = miliSecond / 10;
+                }
+            }
             calendar.set(Calendar.MILLISECOND, miliSecond);
             calendar.set(Calendar.ZONE_OFFSET, timeZoneOffSet);
 
@@ -1061,7 +1087,7 @@
             for (int i = 0; i < listSize; i++) {
                 Object o = objectList.get(i);
                 if (o != null) {
-                    array[i] = Boolean.parseBoolean(o.toString());
+                    array[i] = o.toString().equalsIgnoreCase("true");
                 }
             }
             returnArray = array;
@@ -1465,9 +1491,13 @@
 
                 if (attributeNameSpace.equals(Constants.XSD_NAMESPACE)) {
                     if ("base64Binary".equals(attributeType)) {
+                        xmlStreamReader.next();
                         returnObject = getDataHandlerObject(xmlStreamReader);
                     } else {
-                        String attribValue = xmlStreamReader.getElementText();
+                        // we have to do this other wise xmlstream event type is not set.
+                        xmlStreamReader.next();
+                        String attribValue = xmlStreamReader.getText();
+                        xmlStreamReader.next();
                         if (attribValue != null) {
                             if (attributeType.equals("string")) {
                                 returnObject = attribValue;

Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/MultirefHelper.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/MultirefHelper.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/MultirefHelper.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/databinding/utils/MultirefHelper.java Tue Jan 15 08:21:22 2008
@@ -19,10 +19,10 @@
 
 package org.apache.axis2.databinding.utils;
 
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.*;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPBody;
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.databinding.typemapping.SimpleTypeMapper;
 import org.apache.axis2.engine.ObjectSupplier;
@@ -30,6 +30,7 @@
 import javax.xml.namespace.QName;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.Map;
 
 public class MultirefHelper {
 
@@ -168,6 +169,138 @@
     public void clean() {
         elementMap.clear();
         objectmap.clear();
+    }
+
+    /**
+     * this method is used to process the href attributes which may comes with the incomming soap mesaage
+     * <soap:body>
+     * <operation>
+     * <arg1 href="#obj1"/>
+     * </operation>
+     * <multiref id="obj1">
+     * <name>the real argument</name>
+     * <color>blue</color>
+     * </multiref>
+     * </soap:body>
+     * here we assume first child of the soap body has the main object structure and others contain the
+     * multiref parts.
+     * Soap spec says that those multiref parts must be top level elements.
+     *
+     * @param soapEnvelope
+     */
+
+    public static void processHrefAttributes(SOAPEnvelope soapEnvelope)
+            throws AxisFault {
+        // first populate the multiref parts to a hash table.
+        SOAPBody soapBody = soapEnvelope.getBody();
+        // first build the whole tree
+        soapBody.build();
+        OMElement omElement = null;
+        OMAttribute idAttribute = null;
+        Map idAndOMElementMap = new HashMap();
+        for (Iterator iter = soapBody.getChildElements(); iter.hasNext();) {
+            omElement = (OMElement) iter.next();
+            // the attribute id is an unqualified attribute
+            idAttribute = omElement.getAttribute(new QName(null, "id"));
+            if (idAttribute != null) {
+                // for the first element there may not have an id
+                idAndOMElementMap.put(idAttribute.getAttributeValue(), omElement);
+            }
+        }
+
+        // start processing from the first child
+        processHrefAttributes(idAndOMElementMap, soapBody.getFirstElement(), OMAbstractFactory.getOMFactory());
+
+    }
+
+    public static void processHrefAttributes(Map idAndOMElementMap,
+                                         OMElement elementToProcess,
+                                         OMFactory omFactory)
+            throws AxisFault {
+
+        // first check whether this element has an href value.
+        // href is also an unqualifed attribute
+        OMAttribute hrefAttribute = elementToProcess.getAttribute(new QName(null, "href"));
+        if (hrefAttribute != null) {
+            // i.e this has an href attribute
+            String hrefAttributeValue = hrefAttribute.getAttributeValue();
+            if (!hrefAttributeValue.startsWith("#")) {
+                throw new AxisFault("In valid href ==> " + hrefAttributeValue + " does not starts with #");
+            } else {
+                OMElement referedOMElement =
+                        (OMElement) idAndOMElementMap.get(hrefAttributeValue.substring(1));
+                if (referedOMElement == null) {
+                    throw new AxisFault("In valid href ==> " + hrefAttributeValue + " can not find" +
+                            "the matching element");
+                } else {
+                    // now we have to remove the hrefAttribute and add all the child elements to the
+                    // element being proccesed
+                    elementToProcess.removeAttribute(hrefAttribute);
+                    OMElement clonedReferenceElement = getClonedOMElement(referedOMElement, omFactory);
+                    OMNode omNode = null;
+                    for (Iterator iter = clonedReferenceElement.getChildren(); iter.hasNext();) {
+                        omNode = (OMNode) iter.next();
+                        elementToProcess.addChild(omNode.detach());
+                    }
+
+                    // add attributes
+                    OMAttribute omAttribute = null;
+                    for (Iterator iter = clonedReferenceElement.getAllAttributes(); iter.hasNext();) {
+                        omAttribute = (OMAttribute) iter.next();
+                        // we do not have to populate the id attribute
+                        if (!omAttribute.getLocalName().equals("id")) {
+                            elementToProcess.addAttribute(omAttribute);
+                        }
+                    }
+                }
+            }
+        }
+
+        // call recursively to proces all elements
+        OMElement childOMElement = null;
+        for (Iterator iter = elementToProcess.getChildElements(); iter.hasNext();) {
+            childOMElement = (OMElement) iter.next();
+            processHrefAttributes(idAndOMElementMap, childOMElement, omFactory);
+        }
+    }
+
+    /**
+     * returns an cloned om element for this OMElement
+     *
+     * @param omElement
+     * @return cloned omElement
+     */
+    public static OMElement getClonedOMElement(OMElement omElement, OMFactory omFactory) throws AxisFault {
+
+        OMElement newOMElement = omFactory.createOMElement(omElement.getQName());
+
+        // copying attributes
+        OMAttribute omAttribute = null;
+        OMAttribute newOMAttribute = null;
+        for (Iterator iter = omElement.getAllAttributes(); iter.hasNext();) {
+            omAttribute = (OMAttribute) iter.next();
+            if (!omAttribute.getAttributeValue().equals("id")) {
+                newOMAttribute = omFactory.createOMAttribute(
+                        omAttribute.getLocalName(),
+                        omAttribute.getNamespace(),
+                        omAttribute.getAttributeValue());
+                newOMElement.addAttribute(newOMAttribute);
+            }
+        }
+        OMNode omNode = null;
+        OMText omText = null;
+        for (Iterator iter = omElement.getChildren(); iter.hasNext();) {
+            omNode = (OMNode) iter.next();
+            if (omNode instanceof OMText) {
+                omText = (OMText) omNode;
+                newOMElement.addChild(omFactory.createOMText(omText.getText()));
+            } else if (omNode instanceof OMElement) {
+                newOMElement.addChild(getClonedOMElement((OMElement) omNode, omFactory));
+            } else {
+                throw new AxisFault("Unknown child element type ==> " + omNode.getClass().getName());
+            }
+        }
+        return newOMElement;
     }
 
 }

Modified: webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java?rev=612147&r1=612146&r2=612147&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java (original)
+++ webservices/axis2/branches/java/jaxws21/modules/adb/src/org/apache/axis2/rpc/receivers/RPCMessageReceiver.java Tue Jan 15 08:21:22 2008
@@ -153,6 +153,7 @@
             log.error(msg, e);
             throw new AxisFault(msg, e);
         } catch(RuntimeException e) {
+            log.error(e.getMessage(), e);
             throw AxisFault.makeFault(e);
         } catch (Exception e) {
             String msg = "Exception occurred while trying to invoke service method " +



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message