scheu       2002/06/04 13:35:08

  Modified:    java/src/org/apache/axis Constants.java
               java/src/org/apache/axis/encoding
                        DefaultTypeMappingImpl.java
               java/src/org/apache/axis/encoding/ser BeanDeserializer.java
               java/src/org/apache/axis/wsdl/symbolTable ElementDecl.java
                        SchemaUtils.java SymbolTable.java Utils.java
               java/test/wsdl/extensibility server-deploy.wsdd
  Log:
  The following changes are made to improve
  the extensibility processing of the xsd:any element.
  
  1) The xsd:any element was being mapped to the xsd:anytype.
     I don't think that this duel use is appropriate.
     Introduced a new XSD_ANY type that maps to java.lang.Object
     and automatically uses the ElementSerializer/ElementDeserializer.
  
     a) Got rid of the special typemapping registered in
        test/wsdl/extensibility/deploy.wsdd.  No longer needed.
  
  2) Changed SchemaUtils to use the new XSD_ANY type when an
     xsd:any is identified.  Also sets a flag on the ElementDecl
     to indicate that this ElementDecl is a result of xsd:any.
  
  3) Changed the symbol table to put an XSD_ANY in the symbol
     table when an xsd:any is encountered.
  
  4) If an XSD_ANY is referenced, then all complex types are
     generated and deployed (just like the XSD_ANYTYPE case).
  
  Revision  Changes    Path
  1.62      +1 -0      xml-axis/java/src/org/apache/axis/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/Constants.java,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- Constants.java    31 May 2002 19:08:06 -0000      1.61
  +++ Constants.java    4 Jun 2002 20:35:08 -0000       1.62
  @@ -391,6 +391,7 @@
       public static final QName XSD_BASE64 = new QName(URI_DEFAULT_SCHEMA_XSD, 
"base64Binary");
       public static final QName XSD_HEXBIN = new QName(URI_DEFAULT_SCHEMA_XSD, 
"hexBinary");
       public static final QName XSD_ANYTYPE = new QName(URI_DEFAULT_SCHEMA_XSD, 
"anyType");
  +    public static final QName XSD_ANY = new QName(URI_DEFAULT_SCHEMA_XSD, "any");
       public static final QName XSD_QNAME = new QName(URI_DEFAULT_SCHEMA_XSD, 
"QName");
       public static final QName XSD_DATE = new QName(URI_DEFAULT_SCHEMA_XSD, 
"dateTime");
       public static final QName XSD_DATE1 = new QName(URI_DEFAULT_SCHEMA_XSD, "date");
  
  
  
  1.29      +6 -0      
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.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- DefaultTypeMappingImpl.java       31 May 2002 19:08:07 -0000      1.28
  +++ DefaultTypeMappingImpl.java       4 Jun 2002 20:35:08 -0000       1.29
  @@ -220,6 +220,12 @@
           myRegister(Constants.XSD_ANYTYPE,    java.lang.Object.class,
                      null, null, false);
   
  +        // This is the special type for the xsd:any element used for 
  +        // extensibility.
  +        myRegister(Constants.XSD_ANY,    java.lang.Object.class,
  +                   new ElementSerializerFactory(),
  +                   new ElementDeserializerFactory(), false);
  +
           // The xsd primitive for date has changed through the various
           // namespace versions.
           // XSD_DATE is the current one, which is why it is
  
  
  
  1.30      +1 -1      
xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java
  
  Index: BeanDeserializer.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/encoding/ser/BeanDeserializer.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- BeanDeserializer.java     25 May 2002 03:46:46 -0000      1.29
  +++ BeanDeserializer.java     4 Jun 2002 20:35:08 -0000       1.30
  @@ -255,7 +255,7 @@
                     dSer = context.getDeserializerForType(elemQName);
                   }
                   if (dSer == null)  {
  -                    qn = Constants.XSD_ANYTYPE;
  +                    qn = Constants.XSD_ANY;
                       // make sure that the Element Deserializer deserializes the 
current element and not the child
                       
messageContext.setProperty(ElementDeserializer.DESERIALIZE_CURRENT_ELEMENT, 
Boolean.TRUE);
                   } else {
  
  
  
  1.2       +12 -0     
xml-axis/java/src/org/apache/axis/wsdl/symbolTable/ElementDecl.java
  
  Index: ElementDecl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/ElementDecl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ElementDecl.java  9 May 2002 13:14:27 -0000       1.1
  +++ ElementDecl.java  4 Jun 2002 20:35:08 -0000       1.2
  @@ -74,6 +74,10 @@
       // causes nil=true to be passed over the wire.
       private boolean minOccursIs0=false;   
   
  +    // Indicate if the ElementDecl represents
  +    // an xsd:any element
  +    private boolean anyElement = false;
  +
       public ElementDecl() {
       }
   
  @@ -104,5 +108,13 @@
   
       public void setMinOccursIs0(boolean minOccursIs0) {
           this.minOccursIs0 = minOccursIs0;
  +    }
  +
  +    public boolean getAnyElement() {
  +        return anyElement;
  +    }
  +
  +    public void setAnyElement(boolean anyElement) {
  +        this.anyElement = anyElement;
       }
   }
  
  
  
  1.6       +10 -3     
xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java
  
  Index: SchemaUtils.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SchemaUtils.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SchemaUtils.java  30 May 2002 23:46:02 -0000      1.5
  +++ SchemaUtils.java  4 Jun 2002 20:35:08 -0000       1.6
  @@ -258,9 +258,16 @@
                   } else if (subNodeKind.getLocalPart().equals("group")) {
                       v.addAll(processGroupNode(children.item(j), symbolTable));
                   } else if (subNodeKind.getLocalPart().equals("any")) {
  -                    TypeEntry type = new 
DefinedType(Utils.getWSDLQName(Constants.XSD_ANYTYPE), sequenceNode);
  -                    type.setName("java.lang.Object");
  -                    ElementDecl elem = new ElementDecl(type, Utils.getAxisQName(new 
QName("","any")));
  +                    // Represent this as an element named any of type any type.
  +                    // This will cause it to be serialized with the element 
  +                    // serializer.
  +                    TypeEntry type = 
  +                        symbolTable.getType(
  +                            Utils.getWSDLQName(Constants.XSD_ANY));
  +                    ElementDecl elem = 
  +                        new ElementDecl(type, 
  +                                    Utils.getAxisQName(new QName("","any")));
  +                    elem.setAnyElement(true);
                       v.add(elem);
                   } else if (subNodeKind.getLocalPart().equals("element")) {
                       ElementDecl elem = 
  
  
  
  1.6       +8 -0      
xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java
  
  Index: SymbolTable.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/SymbolTable.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SymbolTable.java  17 May 2002 19:09:33 -0000      1.5
  +++ SymbolTable.java  4 Jun 2002 20:35:08 -0000       1.6
  @@ -655,6 +655,14 @@
                       }
                   }
               }
  +            else if (isXSD && localPart.equals("any")) {
  +                // Map xsd:any element to any xsd:any so that
  +                // it gets serialized using the ElementSerializer.
  +                QName anyQName = Utils.getWSDLQName(Constants.XSD_ANY);
  +                if (getType(anyQName) == null) {
  +                    symbolTablePut(new BaseType(anyQName));
  +                }
  +            }
               else if (localPart.equals("part") &&
                        Constants.isWSDL(nodeKind.getNamespaceURI())) {
                   
  
  
  
  1.8       +2 -1      xml-axis/java/src/org/apache/axis/wsdl/symbolTable/Utils.java
  
  Index: Utils.java
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/wsdl/symbolTable/Utils.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Utils.java        3 Jun 2002 02:03:32 -0000       1.7
  +++ Utils.java        4 Jun 2002 20:35:08 -0000       1.8
  @@ -401,7 +401,8 @@
           if (type != null && type.getNode() != null) {
               getDerivedTypes(type, types, symbolTable);
           } else if (Constants.isSchemaXSD(type.getQName().getNamespaceURI()) &&
  -                   type.getQName().getLocalPart().equals("anyType")) {
  +                   (type.getQName().getLocalPart().equals("anyType")||
  +                    type.getQName().getLocalPart().equals("any"))) {
               // All types are derived from anyType
               types.addAll(symbolTable.getTypes());
           }
  
  
  
  1.4       +3 -0      xml-axis/java/test/wsdl/extensibility/server-deploy.wsdd
  
  Index: server-deploy.wsdd
  ===================================================================
  RCS file: /home/cvs/xml-axis/java/test/wsdl/extensibility/server-deploy.wsdd,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- server-deploy.wsdd        10 May 2002 15:24:31 -0000      1.3
  +++ server-deploy.wsdd        4 Jun 2002 20:35:08 -0000       1.4
  @@ -26,6 +26,8 @@
           encodingStyle=""
         />
         
  +        <!-- Removed.  The xsd:any is now mapped to a type XSD_ANY that 
  +        automatically uses the ElementSerializer/ElementDeserializer 
         <typeMapping
           qname="xsd:anyType"
           type="java:java.lang.Object"
  @@ -33,6 +35,7 @@
           deserializer="org.apache.axis.encoding.ser.ElementDeserializerFactory"
           encodingStyle=""
         />
  +      -->
   
   
         <typeMapping
  
  
  


Reply via email to