You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by aj...@apache.org on 2005/09/07 07:50:51 UTC

svn commit: r279250 - /webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java

Author: ajith
Date: Tue Sep  6 22:50:42 2005
New Revision: 279250

URL: http://svn.apache.org/viewcvs?rev=279250&view=rev
Log:
Added an extra check to see the xmime:contenttype before marking as optimized

Modified:
    webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java

Modified: webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java?rev=279250&r1=279249&r2=279250&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java (original)
+++ webservices/axis2/trunk/java/modules/wsdl/src/org/apache/axis2/wsdl/codegen/extension/XMLBeansExtension.java Tue Sep  6 22:50:42 2005
@@ -98,12 +98,8 @@
                                 XmlObject.Factory.parse(
                                         element
                                         ,options));
-
-
                     }
-
                 }
-
             }
 
             // add the third party schemas
@@ -143,19 +139,33 @@
 
     /**
      * Populate the base64 types
+     * The algo is to look for simpletypes that have base64 content, and then step out of that
+     * onestep and get the element. For now there's an extended check to see whether the simple type
+     * is related to the Xmime:contentType!
      * @param sts
      */
     private void FindBase64Types(SchemaTypeSystem sts) {
         List allSeenTypes = new ArrayList();
         List base64ElementQNamesList = new ArrayList();
+        SchemaType outerType;
         //add the document types and global types
         allSeenTypes.addAll(Arrays.asList(sts.documentTypes()));
         allSeenTypes.addAll(Arrays.asList(sts.globalTypes()));
         for (int i = 0; i < allSeenTypes.size(); i++){
             SchemaType sType = (SchemaType)allSeenTypes.get(i);
+
             if (sType.getContentType()==SchemaType.SIMPLE_CONTENT) {
                 if (XSLTConstants.BASE_64_CONTENT_QNAME.equals(sType.getPrimitiveType().getName())){
-                    base64ElementQNamesList.add(sType.getOuterType().getDocumentElementName());
+                    outerType = sType.getOuterType();
+                    //check the outer type further to see whether it has the contenttype attribute from
+                    //XMime namespace
+                    SchemaProperty[] properties = sType.getProperties();
+                    for (int j = 0; j < properties.length; j++) {
+                        if (XSLTConstants.XMIME_CONTENT_TYPE_QNAME.equals(properties[j].getName())){
+                            base64ElementQNamesList.add(outerType.getDocumentElementName());
+                            break;
+                        }
+                    }
                 }
             }
             //add any of the child types if there are any