[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-c-dev
Subject:    WSDL2Ws patched to currrent AXIS CVS level
From:       Aleksander Slominski <aslom () cs ! indiana ! edu>
Date:       2004-05-28 16:21:44
Message-ID: 40B76718.6030100 () cs ! indiana ! edu
[Download RAW message or body]

after patching this seems to work now fine. i have brought up-to-date 
ElementDecl and SchemaUtils (i am not sure why they were copied from 
AXIS) and made some small fixes to work with current axis.wsdl API.

please review the patch and apply in CVS.

thanks,

alek

ps. i think TABs should not be used in source code!

-- 
The best way to predict the future is to invent it - Alan Kay


["patch1.txt" (text/plain)]

? AXIS_WSDL2Ws.cpr
? benchmark1all.wsdl
? Benchmark1PortType.cpp
? Benchmark1PortType.h
? Benchmark1PortTypeService.cpp
? Benchmark1PortTypeWrapper.cpp
? Benchmark1PortTypeWrapper.h
? build
? build.cpr
? deploy.wsdd
? lib
? patch1.txt
? undeploy.wsdd
Index: build.xml
===================================================================
RCS file: /home/cvspublic/ws-axis/c/src/wsdl/build.xml,v
retrieving revision 1.2
diff -u -r1.2 build.xml
--- build.xml	26 May 2004 12:38:31 -0000	1.2
+++ build.xml	28 May 2004 16:16:33 -0000
@@ -1,4 +1,5 @@
- <project name="axis-mora" default="jar" basedir="../..">
+ <!--project name="axis-mora" default="jar" basedir="../.."-->
+ <project name="wsdl2ws" default="jar" basedir=".">
 	<description>
    Build file for Axis
 
@@ -31,10 +32,10 @@
   Srianth Perera  hemapani@opensource.lk
   
 Copyright:
-  Copyright (c) 2001-2003 Apache Software Foundation.
+  Copyright (c) 2001-2004 Apache Software Foundation.
 </description>
 	
-	<property name ="src" value="src"/>
+	<property name ="src" value="."/>
 	<property name ="lib" value="lib"/>
 	<property name ="test" value="test"/>
 	<property name ="classes" value="build/classes"/>
@@ -42,7 +43,10 @@
 
 	<property name="packages" value="org.apache.axis.*" />
 	<path id ="cp">
-		<fileset dir="${lib}" includes="*.jar"/>
+		<!--fileset dir="${lib}" includes="*.jar"/-->
+        	<fileset dir="${lib}">
+        	    <include name="*.jar" />
+        	</fileset>
 	</path>
 
 
@@ -57,8 +61,8 @@
   <!-- Compiles the source directory                                       -->
   <!-- =================================================================== -->
   <target name="compile"  depends="init">
-     <javac  srcdir="${src}" destdir="${classes}"  listfiles="true">
-      <classpath refid="cp"/>
+     <javac srcdir="${src}" destdir="${classes}" debug="true" optimize="off" \
listfiles="false"> +        <classpath refid="cp" />
     </javac>
   </target>     
     
Index: org/apache/axis/wsdl/symbolTable/ElementDecl.java
===================================================================
RCS file: /home/cvspublic/ws-axis/c/src/wsdl/org/apache/axis/wsdl/symbolTable/ElementDecl.java,v
 retrieving revision 1.4
diff -u -r1.4 ElementDecl.java
--- org/apache/axis/wsdl/symbolTable/ElementDecl.java	9 Apr 2004 08:49:31 -0000	1.4
+++ org/apache/axis/wsdl/symbolTable/ElementDecl.java	28 May 2004 16:16:33 -0000
@@ -1,129 +1,180 @@
 /*
- *   Copyright 2003-2004 The Apache Software Foundation.
+ * Copyright 2001-2004 The Apache Software Foundation.
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
-
 package org.apache.axis.wsdl.symbolTable;
 
 import javax.xml.namespace.QName;
 
 /**
  * Simple utility struct for holding element declarations.
- * 
+ * <p/>
  * This simply correlates a QName to a TypeEntry.
- * 
+ *
  * @author Glen Daniels (gdaniels@apache.org)
  * @author Tom Jordahl (tomj@apache.org)
  */
 public class ElementDecl {
-	private QName name;
-	private TypeEntry type;
-	
-	private int minOccrs = 1;
-	private int maxOccurs = 1;
-	private boolean nillable = false;
-	
-	// The following property is set if minOccurs=0.
-	// An item that is not set and has minOccurs=0 
-	// should not be passed over the wire.  This
-	// is slightly different than nillable=true which
-	// 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() {
-	}
-
-	public ElementDecl(TypeEntry type, QName name) {
-		this.type = type;
-		this.name = name;
-	}
-
-	public TypeEntry getType() {
-		return type;
-	}
-
-	public void setType(TypeEntry type) {
-		this.type = type;
-	}
-
-	public QName getName() {
-		return name;
-	}
-
-	public void setName(QName name) {
-		this.name = name;
-	}
-
-	public boolean getMinOccursIs0() {
-		return minOccursIs0;
-	}
-
-	public void setMinOccursIs0(boolean minOccursIs0) {
-		this.minOccursIs0 = minOccursIs0;
-	}
-
-	public boolean getAnyElement() {
-		return anyElement;
-	}
-
-	public void setAnyElement(boolean anyElement) {
-		this.anyElement = anyElement;
-	}
+
+    /** Field name */
+    private QName name;
+
+    /** Field type */
+    private TypeEntry type;
+    
+    /** Field documentation */
+    private String documentation;
+
+    // The following property is set if minOccurs=0.
+    // An item that is not set and has minOccurs=0
+    // should not be passed over the wire.  This
+    // is slightly different than nillable=true which
+    // causes nil=true to be passed over the wire.
+
+    /** Field minOccursIs0 */
+    private boolean minOccursIs0 = false;
+
+    /** Field nillable */
+    private boolean nillable = false;
+
+    // Indicate if the ElementDecl represents
+    // an xsd:any element
+
+    /** Field anyElement */
+    private boolean anyElement = false;
+
+    /**
+     * Constructor ElementDecl
+     */
+    public ElementDecl() {
+    }
+
     /**
+     * Constructor ElementDecl
+     *
+     * @param type
+     * @param name
+     */
+    public ElementDecl(TypeEntry type, QName name) {
+        this.type = type;
+        this.name = name;
+    }
+
+    /**
+     * Method getType
+     *
      * @return
      */
-    public int getMaxOccurs() {
-        return maxOccurs;
+    public TypeEntry getType() {
+        return type;
+    }
+
+    /**
+     * Method setType
+     *
+     * @param type
+     */
+    public void setType(TypeEntry type) {
+        this.type = type;
     }
 
     /**
+     * Method getName
+     *
      * @return
      */
-    public int getMinOccrs() {
-        return minOccrs;
+    public QName getName() {
+        return name;
     }
 
     /**
+     * Method setName
+     *
+     * @param name
+     */
+    public void setName(QName name) {
+        this.name = name;
+    }
+
+    /**
+     * Method getMinOccursIs0
+     *
      * @return
      */
-    public boolean isNillable() {
+    public boolean getMinOccursIs0() {
+        return minOccursIs0;
+    }
+
+    /**
+     * Method setMinOccursIs0
+     *
+     * @param minOccursIs0
+     */
+    public void setMinOccursIs0(boolean minOccursIs0) {
+        this.minOccursIs0 = minOccursIs0;
+    }
+
+    /**
+     * Method setNillable
+     *
+     * @param nillable
+     */
+    public void setNillable(boolean nillable) {
+        this.nillable = nillable;
+    }
+
+    /**
+     * Method getNillable
+     *
+     * @return
+     */
+    public boolean getNillable() {
         return nillable;
     }
 
     /**
-     * @param i
+     * Method getAnyElement
+     *
+     * @return
      */
-    public void setMaxOccurs(int i) {
-        maxOccurs = i;
+    public boolean getAnyElement() {
+        return anyElement;
     }
 
     /**
-     * @param i
+     * Method setAnyElement
+     *
+     * @param anyElement
      */
-    public void setMinOccurs(int i) {
-        minOccrs = i;
+    public void setAnyElement(boolean anyElement) {
+        this.anyElement = anyElement;
     }
 
     /**
-     * @param b
+     * Method getDocumentation
+     *
+     * @return string
      */
-    public void setNillable(boolean b) {
-        nillable = b;
+    public String getDocumentation() {
+        return documentation;
     }
 
+    /**
+     * Method setDocumentation
+     * @param documentation
+     */
+    public void setDocumentation(String documentation) {
+        this.documentation = documentation;
+    }
 }
Index: org/apache/axis/wsdl/symbolTable/SchemaUtils.java
===================================================================
RCS file: /home/cvspublic/ws-axis/c/src/wsdl/org/apache/axis/wsdl/symbolTable/SchemaUtils.java,v
 retrieving revision 1.4
diff -u -r1.4 SchemaUtils.java
--- org/apache/axis/wsdl/symbolTable/SchemaUtils.java	9 Apr 2004 08:49:31 -0000	1.4
+++ org/apache/axis/wsdl/symbolTable/SchemaUtils.java	28 May 2004 16:16:38 -0000
@@ -1,23 +1,24 @@
 /*
- *   Copyright 2003-2004 The Apache Software Foundation.
+ * Copyright 2001-2004 The Apache Software Foundation.
  *
- *   Licensed under the Apache License, Version 2.0 (the "License");
- *   you may not use this file except in compliance with the License.
- *   You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  *
- *       http://www.apache.org/licenses/LICENSE-2.0
+ *      http://www.apache.org/licenses/LICENSE-2.0
  *
- *   Unless required by applicable law or agreed to in writing, software
- *   distributed under the License is distributed on an "AS IS" BASIS,
- *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *   See the License for the specific language governing permissions and
- *   limitations under the License.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
-
 package org.apache.axis.wsdl.symbolTable;
 
 import org.apache.axis.Constants;
-import org.apache.axis.wsdl.wsdl2ws.info.ElementInfo;
+import org.apache.axis.utils.JavaUtils;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
@@ -27,6 +28,7 @@
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Set;
+import java.util.StringTokenizer;
 import java.util.Vector;
 
 /**
@@ -36,1023 +38,1867 @@
  */
 public class SchemaUtils {
 
-	static final QName VALUE_QNAME = Utils.findQName("", "value");
-    
-	/**
-	 * If the specified node represents a supported JAX-RPC complexType or 
-	 * simpleType, a Vector is returned which contains ElementDecls for the 
-	 * child element names. 
-	 * If the element is a simpleType, an ElementDecls is built representing
-	 * the restricted type with the special name "value".
-	 * If the element is a complexType which has simpleContent, an ElementDecl
-	 * is built representing the extended type with the special name "value".
-	 * This method does not return attribute names and types
-	 * (use the getContainedAttributeTypes)
-	 * If the specified node is not a supported 
-	 * JAX-RPC complexType/simpleType/element null is returned.
-	 */
-	public static Vector getContainedElementDeclarations(Node node, SymbolTable \
                symbolTable) {
-		if (node == null) {
-			return null;
-		}
-
-		// If the node kind is an element, dive into it.
-		if (isXSDNode(node, "element")) {
-			NodeList children = node.getChildNodes();
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexType")) {
-					node = kid;
-					break;
-				}
-			}
-		}
-
-		// Expecting a schema complexType or simpleType
-		if (isXSDNode(node, "complexType")) {
-			// Under the complexType there could be complexContent/simpleContent
-			// and extension elements if this is a derived type.  Skip over these.
-			NodeList children = node.getChildNodes();
-			Node complexContent = null;
-			Node simpleContent = null;
-			Node extension = null;
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexContent")) {
-					complexContent = kid;
-					break;      // REMIND: should this be here or on either branch?
-				} else if (isXSDNode(kid, "simpleContent")) {
-					simpleContent = kid;
-				}
-			}
-			if (complexContent != null) {
-				children = complexContent.getChildNodes();
-				for (int j = 0; j < children.getLength() && extension == null; j++) {
-					Node kid = children.item(j);
-					if (isXSDNode(kid, "extension")) { 
-						extension = kid;
-					}
-				}
-			}
-			if (simpleContent != null) {
-				children = simpleContent.getChildNodes();
-				for (int j = 0; j < children.getLength() && extension == null; j++) {
-					QName extensionOrRestrictionKind = Utils.getNodeQName(children.item(j));
-					if (extensionOrRestrictionKind != null &&
-						(extensionOrRestrictionKind.getLocalPart().equals("extension") ||
-						 extensionOrRestrictionKind.getLocalPart().equals("restriction")) &&
-						Constants.isSchemaXSD(extensionOrRestrictionKind.getNamespaceURI())) {
-                        
-						// get the type of the extension/restriction from the "base" attribute
-						QName extendsOrRestrictsType =
-							Utils.getTypeQName(children.item(j), new BooleanHolder(), false);
-                        
-						// Return an element declaration with a fixed name
-						// ("value") and the correct type.                        
-						Vector v = new Vector();
-						ElementDecl elem = new ElementDecl();
-						elem.setType(symbolTable.getTypeEntry(extendsOrRestrictsType, false));
-						elem.setName(VALUE_QNAME);
-						v.add(elem);
-						return v;
-					}
-				}
-			}
-
-			if (extension != null) {
-				node = extension;  // Skip over complexContent and extension
-			}
-
-			// Under the complexType there may be choice, sequence, group and/or all nodes.   \
                
-			// (There may be other #text nodes, which we will ignore).
-			children = node.getChildNodes();
-			Vector v = new Vector();
-			for (int j = 0; j < children.getLength(); j++) {
-				QName subNodeKind = Utils.getNodeQName(children.item(j));
-				if (subNodeKind != null &&
-					Constants.isSchemaXSD(subNodeKind.getNamespaceURI())) {
-					if (subNodeKind.getLocalPart().equals("sequence")) {
-						v.addAll(processSequenceNode(children.item(j), symbolTable));
-					} else if (subNodeKind.getLocalPart().equals("all")) {
-						v.addAll(processAllNode(children.item(j), symbolTable));
-					} else if (subNodeKind.getLocalPart().equals("choice")) {
-						v.addAll(processChoiceNode(children.item(j), symbolTable));
-					} else if (subNodeKind.getLocalPart().equals("group")) {
-						v.addAll(processGroupNode(children.item(j), symbolTable));
-					}
-				}
-			}
-			return v;
-		} else {
-			// This may be a simpleType, return the type with the name "value"
-			QName simpleQName = getSimpleTypeBase(node);
-			if (simpleQName != null) {
-				TypeEntry simpleType = symbolTable.getType(simpleQName);
-				if (simpleType != null) {
-					Vector v = new Vector();
-					ElementDecl elem = new ElementDecl();
-					elem.setType(simpleType);
-					elem.setName(new javax.xml.namespace.QName("", "value"));
-					v.add(elem);
-					return v;
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Invoked by getContainedElementDeclarations to get the child element types
-	 * and child element names underneath a Choice Node
-	 */
-	private static Vector processChoiceNode(Node choiceNode, 
-											SymbolTable symbolTable) {
-		Vector v = new Vector();
-		NodeList children = choiceNode.getChildNodes();
-		for (int j = 0; j < children.getLength(); j++) {
-			QName subNodeKind = Utils.getNodeQName(children.item(j));
-			if (subNodeKind != null &&
-				Constants.isSchemaXSD(subNodeKind.getNamespaceURI())) {
-				if (subNodeKind.getLocalPart().equals("choice")) {
-					v.addAll(processChoiceNode(children.item(j), symbolTable));
-				} else if (subNodeKind.getLocalPart().equals("sequence")) {
-					v.addAll(processSequenceNode(children.item(j), symbolTable));
-				} else if (subNodeKind.getLocalPart().equals("group")) {
-					v.addAll(processGroupNode(children.item(j), symbolTable));
-				} else if (subNodeKind.getLocalPart().equals("element")) {
-					ElementDecl elem = 
-							processChildElementNode(children.item(j), 
-													symbolTable);
-					if (elem != null)
-						v.add(elem);
-				}
-			}
-		}
-		return v;
-	}
-
-	/**
-	 * Invoked by getContainedElementDeclarations to get the child element types
-	 * and child element names underneath a Sequence Node
-	 */
-	private static Vector processSequenceNode(Node sequenceNode, 
-											  SymbolTable symbolTable) {
-		Vector v = new Vector();
-		NodeList children = sequenceNode.getChildNodes();
-		for (int j = 0; j < children.getLength(); j++) {
-			QName subNodeKind = Utils.getNodeQName(children.item(j));
-			if (subNodeKind != null &&
-				Constants.isSchemaXSD(subNodeKind.getNamespaceURI())) {
-				if (subNodeKind.getLocalPart().equals("choice")) {
-					v.addAll(processChoiceNode(children.item(j), symbolTable));
-				} else if (subNodeKind.getLocalPart().equals("sequence")) {
-					v.addAll(processSequenceNode(children.item(j), symbolTable));
-				} else if (subNodeKind.getLocalPart().equals("group")) {
-					v.addAll(processGroupNode(children.item(j), symbolTable));
-				} else if (subNodeKind.getLocalPart().equals("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(Constants.XSD_ANY);
-					ElementDecl elem = 
-						new ElementDecl(type, Utils.findQName("","any"));
-					elem.setAnyElement(true);
-					v.add(elem);
-				} else if (subNodeKind.getLocalPart().equals("element")) {
-					ElementDecl elem = 
-							processChildElementNode(children.item(j), 
-													symbolTable);
-					if (elem != null)
-						v.add(elem);
-				}
-			}
-		}
-		return v;
-	}
-
-	/**
-	 * Invoked by getContainedElementDeclarations to get the child element types
-	 * and child element names underneath a group node.
-	 * (Currently the code only supports a defined group it does not
-	 * support a group that references a previously defined group)
-	 */
-	private static Vector processGroupNode(Node groupNode, SymbolTable symbolTable) {
-		Vector v = new Vector();
-		NodeList children = groupNode.getChildNodes();
-		for (int j = 0; j < children.getLength(); j++) {
-			QName subNodeKind = Utils.getNodeQName(children.item(j));
-			if (subNodeKind != null &&
-				Constants.isSchemaXSD(subNodeKind.getNamespaceURI())) {
-				if (subNodeKind.getLocalPart().equals("choice")) {
-					v.addAll(processChoiceNode(children.item(j), symbolTable));
-				} else if (subNodeKind.getLocalPart().equals("sequence")) {
-					v.addAll(processSequenceNode(children.item(j), symbolTable));
-				} else if (subNodeKind.getLocalPart().equals("all")) {
-					v.addAll(processAllNode(children.item(j), symbolTable));
-				}
-			}
-		}
-		return v;
-	}
-
-	/**
-	 * Invoked by getContainedElementDeclarations to get the child element types
-	 * and child element names underneath an all node.
-	 */
-	private static Vector processAllNode(Node allNode, SymbolTable symbolTable) {
-		Vector v = new Vector();
-		NodeList children = allNode.getChildNodes();
-		for (int j = 0; j < children.getLength(); j++) {
-			Node kid = children.item(j);
-			if (isXSDNode(kid, "element")) {
-				ElementDecl elem = processChildElementNode(kid,symbolTable);
-				if (elem != null) {
-					v.add(elem);
-				}
-			}
-		}
-		return v;
-	}
-
-
-	/**
-	 * Invoked by getContainedElementDeclarations to get the child element type
-	 * and child element name for a child element node.
-	 *
-	 * If the specified node represents a supported JAX-RPC child element,
-	 * we return an ElementDecl containing the child element name and type.
-	 */
-	private static ElementDecl processChildElementNode(Node elementNode, 
-												  SymbolTable symbolTable) {
-		// Get the name qnames.
-		QName nodeName = Utils.getNodeNameQName(elementNode);
-		BooleanHolder forElement = new BooleanHolder();
-
-		// The type qname is used to locate the TypeEntry, which is then
-		// used to retrieve the proper java name of the type.
-		QName nodeType = Utils.getTypeQName(elementNode, forElement, false);
-
-		TypeEntry type = symbolTable.getTypeEntry(nodeType, forElement.value);
-
-		// An element inside a complex type is either qualified or unqualified.
-		// If the ref= attribute is used, the name of the ref'd element is used
-		// (which must be a root element).  If the ref= attribute is not
-		// used, the name of the element is unqualified.
-
-		if (!forElement.value) {
-			// check the Form (or elementFormDefault) attribute of this node to
-			// determine if it should be namespace quailfied or not.
-			String form = Utils.getAttribute(elementNode, "form");
-			if (form != null && form.equals("unqualified")) {
-				// Unqualified nodeName
-				nodeName = Utils.findQName("", nodeName.getLocalPart());            
-			} else if (form == null) {
-				// check elementForDefault on schema element
-				String def = Utils.getScopedAttribute(elementNode, 
-													  "elementFormDefault");
-				if (def == null || def.equals("unqualified")) {
-					// Unqualified nodeName
-					nodeName = Utils.findQName("", nodeName.getLocalPart());            
-				}
-			}
-		}
-
-		if (type != null) {
-			ElementDecl elem = new ElementDecl(type, nodeName);
-			String minOccurs = Utils.getAttribute(elementNode, "minOccurs");
-			if (minOccurs != null && minOccurs.equals("0")) {
-				elem.setMinOccursIs0(true);
-			}
-			if(minOccurs == null){}
-			else if("unbounded".equals(minOccurs))
-				elem.setMinOccurs(ElementInfo.UNBOUNDED);
-			else{	
-				elem.setMinOccurs(Integer.parseInt(minOccurs));
-			}
-
-			
-			String maxOccurs = Utils.getAttribute(elementNode, "maxOccurs");
-			
-			if(maxOccurs == null){}
-			else if("unbounded".equals(maxOccurs))
-				elem.setMaxOccurs(ElementInfo.UNBOUNDED);
-			else	
-				elem.setMaxOccurs(Integer.parseInt(maxOccurs));
-			String nillable = Utils.getAttribute(elementNode, "nilable");
-			if(nillable != null && "true".equals(nillable))
-				elem.setNillable(true);
-			
-			return elem;
-		}
-        
-		return null;
-	}
-
-	/**
-	 * Returns the WSDL2Java QName for the anonymous type of the element
-	 * or null.
-	 */
-	public static QName getElementAnonQName(Node node) {
-		if (isXSDNode(node, "element")) {
-			NodeList children = node.getChildNodes();
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexType") || isXSDNode(kid, "simpleType")) {
-					return Utils.getNodeNameQName(kid);
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * Returns the WSDL2Java QName for the anonymous type of the attribute
-	 * or null.
-	 */
-	public static QName getAttributeAnonQName(Node node) {
-		if (isXSDNode(node, "attribute")) {
-			NodeList children = node.getChildNodes();
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexType") || isXSDNode(kid, "simpleType")) {
-					return Utils.getNodeNameQName(kid);
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * If the specified node is a simple type or contains simpleContent, return true
-	 */
-	public static boolean isSimpleTypeOrSimpleContent(Node node) {
-		if (node == null) {
-			return false;
-		}
-
-		// If the node kind is an element, dive into it.
-		if (isXSDNode(node, "element")) {
-			NodeList children = node.getChildNodes();
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexType")) {
-					node = kid;
-					break;
-				} else if (isXSDNode(kid, "simpleType")) { 
-					return true;
-				}
-			}
-		}
-
-		// Expecting a schema complexType or simpleType
-		if (isXSDNode(node, "simpleType")) {
-			return true;
-		}
-
-		if (isXSDNode(node, "complexType")) {
-			// Under the complexType there could be complexContent/simpleContent
-			// and extension elements if this is a derived type.  Skip over these.
-			NodeList children = node.getChildNodes();
-			Node complexContent = null;
-			Node simpleContent = null;
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexContent")) {
-					complexContent = kid;
-					break;
-				} else if (isXSDNode(kid, "simpleContent")) {
-					simpleContent = kid;
-				}
-			}
-			if (complexContent != null) {
-				return false;
-			}
-			if (simpleContent != null) {
-				return true;
-			}
-		}
-		return false;
-	}
-
-	/**
-	 * Test whether <tt>node</tt> is not null, belongs to the XML
-	 * Schema namespace, and has a localName that matches
-	 * <tt>schemaLocalName</tt>
-	 *
-	 * This can be used to determine that a given Node defines a
-	 * schema "complexType" "element" and so forth.
-	 *
-	 * @param node a <code>Node</code> value
-	 * @param schemaLocalName a <code>String</code> value
-	 * @return true if the node is matches the name in the schema namespace.
-	 */
-	private static boolean isXSDNode(Node node, String schemaLocalName) {
-		if ((node != null) && Constants.isSchemaXSD(node.getNamespaceURI())) {
-			String localName = node.getLocalName();
-			return ((localName != null) && localName.equals(schemaLocalName));
-		}
-		return false;
-	}
-
-	/**
-	 * If the specified node represents a supported JAX-RPC complexType/element
-	 * which extends another complexType.  The Type of the base is returned.
-	 */
-	public static TypeEntry getComplexElementExtensionBase(Node node, SymbolTable \
                symbolTable) {
-		if (node == null) {
-			return null;
-		}
-
-		TypeEntry cached = (TypeEntry)symbolTable.node2ExtensionBase.get(node);
-		if (cached != null) {
-			return cached;      // cache hit
-		}
-
-		// If the node kind is an element, dive into it.
-		if (isXSDNode(node, "element")) {
-			NodeList children = node.getChildNodes();
-			Node complexNode = null;
-			for (int j = 0; j < children.getLength() && complexNode == null; j++) {
-				if (isXSDNode(children.item(j), "complexType")) {
-					complexNode = children.item(j);
-					node = complexNode;
-				}
-			}
-		}
-
-		// Expecting a schema complexType
-		if (isXSDNode(node, "complexType")) {
-
-			// Under the complexType there could be should be a complexContent &
-			// extension elements if this is a derived type. 
-			NodeList children = node.getChildNodes();
-			Node content = null;
-			Node extension = null;
-			for (int j = 0; j < children.getLength() && content == null; j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexContent") || isXSDNode(kid, "simpleContent")) {
-					content = kid;
-				}
-			}
-			if (content != null) {
-				children = content.getChildNodes();
-				for (int j = 0; j < children.getLength() && extension == null; j++) {
-					Node kid = children.item(j);
-					if (isXSDNode(kid, "extension")) {
-						extension = kid;
-					}
-				}
-			}
-			if (extension == null) {
-				cached = null;
-			} else {
-				// Get the QName of the extension base
-				QName extendsType = Utils.getTypeQName(extension, new BooleanHolder(), false);
-				if (extendsType == null) {
-					cached = null;
-				} else {
-					// Return associated Type
-					cached = symbolTable.getType(extendsType);
-				}
-			}
-		}
-		symbolTable.node2ExtensionBase.put(node, cached);
-		return cached;
-	}
-
-	/**
-	 * If the specified node represents a 'normal' non-enumeration simpleType,
-	 * the QName of the simpleType base is returned.
-	 */
-	public static QName getSimpleTypeBase(Node node) {
-		QName baseQName = null;
-
-		if (node == null) {
-			return null;
-		}
-
-		// If the node kind is an element, dive into it.
-		QName nodeKind = Utils.getNodeQName(node);
-		if (isXSDNode(node, "element")) {
-			NodeList children = node.getChildNodes();
-			for (int j = 0; j < children.getLength(); j++) {
-				if (isXSDNode(children.item(j), "simpleType")) {
-					node = children.item(j);
-					break;
-				}
-			}
-		}
-		// Get the node kind, expecting a schema simpleType
-		if (isXSDNode(node, "simpleType")) {
-			// Under the simpleType there should be a restriction.
-			// (There may be other #text nodes, which we will ignore).
-			NodeList children = node.getChildNodes();
-			Node restrictionNode = null;
-			for (int j = 0; j < children.getLength() && restrictionNode == null; j++) {
-				if (isXSDNode(children.item(j), "restriction")) {
-					restrictionNode = children.item(j);
-				}
-			}
-
-			// The restriction node indicates the type being restricted
-			// (the base attribute contains this type).
-            
-			if (restrictionNode != null) {
-				baseQName = Utils.getTypeQName(restrictionNode, new BooleanHolder(), false);
-			}
-            
-			// Look for enumeration elements underneath the restriction node
-			if (baseQName != null && restrictionNode != null) {
-				NodeList enums = restrictionNode.getChildNodes();
-				for (int i=0; i < enums.getLength(); i++) {
-					if (isXSDNode(enums.item(i), "enumeration")) {
-						// Found an enumeration, this isn't a 
-						// 'normal' simple type.
-						return null;
-					}
-				}
-			}
-		}
-		return baseQName;
-	}
-
-	/**
-	 * Returns the contained restriction or extension node underneath
-	 * the specified node.  Returns null if not found
-	 */
-	public static Node getRestrictionOrExtensionNode(Node node) {
-		Node re = null;
-		if (node == null) {
-			return re;
-		}
-
-		// If the node kind is an element, dive into it.
-		if (isXSDNode(node, "element")) {
-			NodeList children = node.getChildNodes();
-			Node node2 = null;
-			for (int j = 0; j < children.getLength(); j++) {
-				Node n = children.item(j);
-				if (isXSDNode(n, "simpleType") || isXSDNode(n, "complexType") || isXSDNode(n, \
                "simpleContent")) {
-					node = n;
-					break;
-				}
-			}
-		}
-		// Get the node kind, expecting a schema simpleType
-		if (isXSDNode(node, "simpleType") || isXSDNode(node, "complexType")) {
-			// Under the complexType there could be a complexContent.
-			NodeList children = node.getChildNodes();
-			Node complexContent = null;
-			if (node.getLocalName().equals("complexType")) {
-				for (int j = 0; j < children.getLength() && complexContent == null; j++) {
-					Node kid = children.item(j);
-					if (isXSDNode(kid, "complexContent") || isXSDNode(kid, "simpleContent")) {
-						complexContent = kid;
-					}
-				}
-				node = complexContent;
-			}
-			// Now get the extension or restriction node
-			if (node != null) {
-				children = node.getChildNodes();
-				for (int j = 0; j < children.getLength() && re == null; j++) {
-					Node kid = children.item(j);
-					if (isXSDNode(kid, "extension") || isXSDNode(kid, "restriction")) {
-						re = kid;
-					}
-				}
-			}
-		}
-            
-		return re;
-	}
-
-	/**
-	 * If the specified node represents an array encoding of one of the following
-	 * forms, then return the qname repesenting the element type of the array.
-	 * @param node is the node
-	 * @param dims is the output value that contains the number of dimensions if return \
                is not null
-	 * @return QName or null
-	 */
-	public static QName getArrayComponentQName(Node node, IntHolder dims) {
-		dims.value = 1;  // assume 1 dimension
-		QName qName = getCollectionComponentQName(node);
-		if (qName == null) {
-			qName = getArrayComponentQName_JAXRPC(node, dims);
-		}
-		return qName;
-	}
-
-	/**
-	 * If the specified node represents an element that references a collection
-	 * then return the qname repesenting the component of the collection.
-	 *
-	 *  <xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/>
-	 *    returns qname for"xsd:string"
-	 *  <xsd:element ref="alias"  maxOccurs="unbounded"/>
-	 *    returns qname for "alias"
-	 * @param node is the Node
-	 * @return QName of the compoent of the collection
-	 */
-	public static QName getCollectionComponentQName(Node node) {
-		if (node == null) {
-			return null;
-		}
-
-		// If the node kind is an element, dive get its type.
-		if (isXSDNode(node, "element")) {
-			// Compare the componentQName with the name of the
-			// full name.  If different, return componentQName
-			BooleanHolder forElement = new BooleanHolder();
-			QName componentQName = Utils.getTypeQName(node, forElement, true);
-			if (componentQName != null) {
-				QName fullQName = Utils.getTypeQName(node, forElement, false);
-				if (!componentQName.equals(fullQName)) {
-					return componentQName;
-				}
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * If the specified node represents an array encoding of one of the following
-	 * forms, then return the qname repesenting the element type of the array.
-	 *
-	 * @param node is the node
-	 * @param dims is the output value that contains the number of dimensions if return \
                is not null
-	 * @return QName or null
-	 *
-	 * JAX-RPC Style 2:
-	 *<xsd:complexType name="hobbyArray">
-	 *  <xsd:complexContent>
-	 *    <xsd:restriction base="soapenc:Array">
-	 *      <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
-	 *    </xsd:restriction>
-	 *  </xsd:complexContent>
-	 *</xsd:complexType>
-	 *
-	 * JAX-RPC Style 3:
-	 *<xsd:complexType name="petArray">
-	 *  <xsd:complexContent>
-	 *    <xsd:restriction base="soapenc:Array">
-	 *      <xsd:sequence>
-	 *        <xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/>
-	 *      </xsd:sequence>
-	 *    </xsd:restriction>
-	 *  </xsd:complexContent>
-	 *</xsd:complexType>
-	 *
-	 */
-	private static QName getArrayComponentQName_JAXRPC(Node node, IntHolder dims) {
-		dims.value = 0;  // Assume 0
-		if (node == null) {
-			return null;
-		}
-
-		// If the node kind is an element, dive into it.
-		if (isXSDNode(node, "element")) {
-			NodeList children = node.getChildNodes();
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexType")) {
-					node = kid;
-					break;
-				}
-			}
-		}
-
-		// Get the node kind, expecting a schema complexType
-		if (isXSDNode(node, "complexType")) {
-			// Under the complexType there should be a complexContent.
-			// (There may be other #text nodes, which we will ignore).
-			NodeList children = node.getChildNodes();
-			Node complexContentNode = null;
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexContent") || isXSDNode(kid, "simpleContent")) {
-					complexContentNode = kid;
-					break;
-				}
-			}
-
-			// Under the complexContent there should be a restriction.
-			// (There may be other #text nodes, which we will ignore).
-			Node restrictionNode = null;
-			if (complexContentNode != null) {
-				children = complexContentNode.getChildNodes();
-				for (int j = 0; j < children.getLength(); j++) {
-					Node kid = children.item(j);
-					if (isXSDNode(kid, "restriction")) {
-						restrictionNode = kid;
-						break;
-					}
-				}
-			}
-
-			// The restriction node must have a base of soapenc:Array.              
-			QName baseType = null;
-			if (restrictionNode != null) {
-				baseType = Utils.getTypeQName(restrictionNode, new BooleanHolder(), false);
-				if (baseType != null &&
-					baseType.getLocalPart().equals("Array") &&
-					Constants.isSOAP_ENC(baseType.getNamespaceURI()))
-					; // Okay
-				else
-					baseType = null;  // Did not find base=soapenc:Array
-			}
+    /** Field VALUE_QNAME */
+    static final QName VALUE_QNAME = Utils.findQName("", "value");
 
+    /**
+     * This method checks mixed=true attribute is set either on
+     * complexType or complexContent element.
+     */
+    public static boolean isMixed(Node node) {
+        // Expecting a schema complexType
+        if (isXSDNode(node, "complexType")) {
+            String mixed = ((Element)node).getAttribute("mixed");
+            if (mixed != null && mixed.length() > 0) {
+                return ("true".equalsIgnoreCase(mixed) ||
+                        "1".equals(mixed));
+            }
+            // Under the complexType there could be complexContent with
+            // mixed="true"
+            NodeList children = node.getChildNodes();
             
-			// Under the restriction there should be an attribute OR a sequence/all group \
                node.
-			// (There may be other #text nodes, which we will ignore).
-			Node groupNode = null;
-			Node attributeNode = null;
-			if (baseType != null) {
-				children = restrictionNode.getChildNodes();
-				for (int j = 0;
-					 j < children.getLength() && groupNode == null && attributeNode == null;
-					 j++) {
-					Node kid = children.item(j);
-					if (isXSDNode(kid, "sequence") || isXSDNode(kid, "all")) {
-						groupNode = kid;
-						if (groupNode.getChildNodes().getLength() == 0) {
-							// This covers the rather odd but legal empty sequence.
-							// <complexType name="ArrayOfString">
-							//   <complexContent>
-							//     <restriction base="soapenc:Array">
-							//       <sequence/>
-							//       <attribute ref="soapenc:arrayType" wsdl:arrayType="string[]"/>
-							//     </restriction>
-							//   </complexContent>
-							// </complexType>
-							groupNode = null;
-						}
-					}
-					if (isXSDNode(kid, "attribute")) {
-						// If the attribute node does not have ref="soapenc:arrayType"
-						// then keep looking.
-						BooleanHolder isRef = new BooleanHolder();
-						QName refQName = Utils.getTypeQName(kid, isRef, false);
-						if (refQName != null &&
-							isRef.value &&
-							refQName.getLocalPart().equals("arrayType") &&
-							Constants.isSOAP_ENC(refQName.getNamespaceURI())) {
-							attributeNode = kid;
-						}
-					}
-				}
-			}
-
-			// If there is an attribute node, look at wsdl:arrayType to get the element type
-			if (attributeNode != null) {
-				String wsdlArrayTypeValue = null;
-				Vector attrs = Utils.getAttributesWithLocalName(attributeNode, "arrayType");
-				for (int i=0; i < attrs.size() && wsdlArrayTypeValue == null; i++) {
-					Node attrNode = (Node) attrs.elementAt(i);
-					String attrName = attrNode.getNodeName();
-					QName attrQName = Utils.getQNameFromPrefixedName(attributeNode, attrName);
-					if (Constants.isWSDL(attrQName.getNamespaceURI())) {
-						wsdlArrayTypeValue = attrNode.getNodeValue();
-					}
-				}
-
-				// The value could have any number of [] or [,] on the end
-				// Strip these off to get the prefixed name.
-				// The convert the prefixed name into a qname.
-				// Count the number of [ and , to get the dim information.
-				if (wsdlArrayTypeValue != null) {
-					int i = wsdlArrayTypeValue.indexOf('[');
-					if (i > 0) {
-						String prefixedName = wsdlArrayTypeValue.substring(0,i);
-						String mangledString = wsdlArrayTypeValue.replace(',', '[');
-						dims.value = 0;
-						int index = mangledString.indexOf('[');
-						while (index > 0) {
-							dims.value++;
-							index = mangledString.indexOf('[',index+1);
-						}
-                        
-						return Utils.getQNameFromPrefixedName(restrictionNode, prefixedName);
-					}
-				}
-			} else if (groupNode != null) {
-
-				// Get the first element node under the group node.       
-				NodeList elements = groupNode.getChildNodes();
-				Node elementNode = null;
-				for (int i=0; i < elements.getLength() && elementNode == null; i++) {
-					Node kid = elements.item(i);
-					if (isXSDNode(kid, "element")) {
-						elementNode = elements.item(i);
-						break;
-					}
-				}
-                 
-				// The element node should have maxOccurs="unbounded" and
-				// a type
-				if (elementNode != null) {
-					String maxOccursValue = Utils.getAttribute(elementNode, "maxOccurs");
-					if (maxOccursValue != null &&
-						maxOccursValue.equalsIgnoreCase("unbounded")) {
-						// Get the QName of the type without considering maxOccurs
-						dims.value = 1;
-						return Utils.getTypeQName(elementNode, new BooleanHolder(), true);
-					}
-				}
-			}
-            
-		}
-		return null;
-	}
-
-	/**
-	 * Return the attribute names and types if any in the node
-	 * The even indices are the element types (TypeEntry) and
-	 * the odd indices are the corresponding names (Strings).
-	 * 
-	 * Example:
-	 * <complexType name="Person">
-	 *   <sequence>
-	 *     <element minOccurs="1" maxOccurs="1" name="Age" type="double" />
-	 *     <element minOccurs="1" maxOccurs="1" name="ID" type="xsd:float" />
-	 *   </sequence>
-	 *   <attribute name="Name" type="string" />
-	 *   <attribute name="Male" type="boolean" />
-	 * </complexType>
-	 * 
-	 */ 
-	public static Vector getContainedAttributeTypes(Node node, 
-													SymbolTable symbolTable) 
-	{
-		Vector v = null;    // return value
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+                if (isXSDNode(kid, "complexContent")) {
+                    mixed = ((Element)kid).getAttribute("mixed");
+                    return ("true".equalsIgnoreCase(mixed) ||
+                            "1".equals(mixed));
+                }
+            }
+        }
+        return false;
+    }
+
+  /**
+   * This method checks out if the given node satisfies the 3rd condition
+   * of the "wrapper" style:
+   * such an element (a wrapper) must be of a complex type defined using the
+   * xsd:sequence compositor and containing only elements declarations.
+   * (excerpt from JAX-RPC spec 1.1 Maintenanace Review 2 Chapter 6 Section 4.1.)
+   *
+   * @param node
+   * @return
+   */
+  public static boolean isWrappedType(Node node) {
+    
+    if (node == null) {
+      return false;
+    }
+
+    // If the node kind is an element, dive into it.
+    if (isXSDNode(node, "element")) {
+      NodeList children = node.getChildNodes();
+      boolean hasComplexType = false;
+      for (int j = 0; j < children.getLength(); j++) {
+        Node kid = children.item(j);
+        if (isXSDNode(kid, "complexType")) {
+          node = kid;
+          hasComplexType = true;
+          break;
+        }
+      }
+      if (!hasComplexType) {
+        return false;
+      }
+    }
+
+    // Expecting a schema complexType
+    if (isXSDNode(node, "complexType")) {
+      // Under the complexType there could be complexContent/simpleContent
+      // and extension elements if this is a derived type.
+      // A wrapper element must be complex-typed.
+      
+      NodeList children = node.getChildNodes();
+
+      for (int j = 0; j < children.getLength(); j++) {
+        Node kid = children.item(j);
+
+        if (isXSDNode(kid, "complexContent")) {
+          return false;
+        } else if (isXSDNode(kid, "simpleContent")) {
+          return false;
+        }
+      }
+
+      // Under the complexType there may be choice, sequence, group and/or all \
nodes. +      // (There may be other #text nodes, which we will ignore).
+      // The complex type of a wrapper element must have only sequence
+      // and again element declarations in the sequence.
+      children = node.getChildNodes();
+      for (int j = 0; j < children.getLength(); j++) {
+        QName subNodeKind = Utils.getNodeQName(children.item(j));
+        if ((subNodeKind != null)
+          && Constants.isSchemaXSD(
+          subNodeKind.getNamespaceURI())) {
+          if (subNodeKind.getLocalPart().equals("sequence")) {
+            Node sequenceNode = children.item(j);
+            NodeList sequenceChildren = sequenceNode.getChildNodes();
+            for (int k = 0; k < sequenceChildren.getLength(); k++) {
+              QName sequenceSubNodeKind = \
Utils.getNodeQName(sequenceChildren.item(k)); +              if ((sequenceSubNodeKind \
!= null) +                && \
Constants.isSchemaXSD(sequenceSubNodeKind.getNamespaceURI())) { +                if \
(!sequenceSubNodeKind.getLocalPart().equals("element")) { +                  return \
false; +                }
+              }
+            }
+            return true;
+          }
+          else {
+            return false;
+          }
+        }
+      }
+    }
+    // allows void type
+    return true;
+  }
+  
+    /**
+     * If the specified node represents a supported JAX-RPC complexType or
+     * simpleType, a Vector is returned which contains ElementDecls for the
+     * child element names.
+     * If the element is a simpleType, an ElementDecls is built representing
+     * the restricted type with the special name "value".
+     * If the element is a complexType which has simpleContent, an ElementDecl
+     * is built representing the extended type with the special name "value".
+     * This method does not return attribute names and types
+     * (use the getContainedAttributeTypes)
+     * If the specified node is not a supported
+     * JAX-RPC complexType/simpleType/element null is returned.
+     *
+     * @param node
+     * @param symbolTable
+     * @return
+     */
+    public static Vector getContainedElementDeclarations(Node node,
+                                                         SymbolTable symbolTable) {
+
+        if (node == null) {
+            return null;
+        }
+
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexType")) {
+                    node = kid;
+
+                    break;
+                }
+            }
+        }
+
+        // Expecting a schema complexType or simpleType
+        if (isXSDNode(node, "complexType")) {
+
+            // Under the complexType there could be complexContent/simpleContent
+            // and extension elements if this is a derived type.  Skip over these.
+            NodeList children = node.getChildNodes();
+            Node complexContent = null;
+            Node simpleContent = null;
+            Node extension = null;
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexContent")) {
+                    complexContent = kid;
+
+                    break;    // REMIND: should this be here or on either branch?
+                } else if (isXSDNode(kid, "simpleContent")) {
+                    simpleContent = kid;
+                }
+            }
+
+            if (complexContent != null) {
+                children = complexContent.getChildNodes();
+
+                for (int j = 0;
+                     (j < children.getLength()) && (extension == null);
+                     j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "extension")
+                            || isXSDNode(kid, "restriction")) {
+                        extension = kid;
+                    }
+                }
+            }
+
+            if (simpleContent != null) {
+                children = simpleContent.getChildNodes();
+
+                for (int j = 0;
+                     (j < children.getLength()) && (extension == null);
+                     j++) {
+                    QName extensionOrRestrictionKind =
+                            Utils.getNodeQName(children.item(j));
+
+                    if ((extensionOrRestrictionKind != null)
+                            && (extensionOrRestrictionKind.getLocalPart().equals(
+                                    "extension") || \
extensionOrRestrictionKind.getLocalPart().equals( +                                   \
"restriction")) +                            && Constants.isSchemaXSD(
+                                    extensionOrRestrictionKind.getNamespaceURI())) {
+
+                        // get the type of the extension/restriction from the "base" \
attribute +                        QName extendsOrRestrictsType =
+                                Utils.getTypeQName(children.item(j),
+                                        new BooleanHolder(), false);
+
+                        // Return an element declaration with a fixed name
+                        // ("value") and the correct type.
+                        Vector v = new Vector();
+                        ElementDecl elem = new ElementDecl();
+
+                        elem.setType(
+                                symbolTable.getTypeEntry(
+                                        extendsOrRestrictsType, false));
+                        elem.setName(VALUE_QNAME);
+                        v.add(elem);
+
+                        return v;
+                    }
+                }
+            }
+
+            if (extension != null) {
+                node = extension;    // Skip over complexContent and extension
+            }
+
+            // Under the complexType there may be choice, sequence, group and/or all \
nodes. +            // (There may be other #text nodes, which we will ignore).
+            children = node.getChildNodes();
+
+            Vector v = new Vector();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                QName subNodeKind = Utils.getNodeQName(children.item(j));
+
+                if ((subNodeKind != null)
+                        && Constants.isSchemaXSD(
+                                subNodeKind.getNamespaceURI())) {
+                    if (subNodeKind.getLocalPart().equals("sequence")) {
+                        v.addAll(processSequenceNode(children.item(j),
+                                symbolTable));
+                    } else if (subNodeKind.getLocalPart().equals("all")) {
+                        v.addAll(processAllNode(children.item(j), symbolTable));
+                    } else if (subNodeKind.getLocalPart().equals("choice")) {
+                        v.addAll(processChoiceNode(children.item(j),
+                                symbolTable));
+                    } else if (subNodeKind.getLocalPart().equals("group")) {
+                        v.addAll(processGroupNode(children.item(j),
+                                symbolTable));
+                    }
+                }
+            }
+
+            return v;
+        } else if (isXSDNode(node, "group")) {
+            NodeList children = node.getChildNodes();
+            Vector v = new Vector();
+            for (int j = 0; j < children.getLength(); j++) {
+                QName subNodeKind = Utils.getNodeQName(children.item(j));
+                if ((subNodeKind != null)
+                        && Constants.isSchemaXSD(
+                                subNodeKind.getNamespaceURI())) {
+                    if (subNodeKind.getLocalPart().equals("sequence")) {
+                        v.addAll(processSequenceNode(children.item(j),
+                                symbolTable));
+                    } else if (subNodeKind.getLocalPart().equals("all")) {
+                        v.addAll(processAllNode(children.item(j), symbolTable));
+                    } else if (subNodeKind.getLocalPart().equals("choice")) {
+                        v.addAll(processChoiceNode(children.item(j),
+                                symbolTable));
+                    }
+                }
+            }
+            return v;
+        } else {
+
+            // This may be a simpleType, return the type with the name "value"
+            QName[] simpleQName = getContainedSimpleTypes(node);
+
+            if (simpleQName != null) {
+                Vector v = null;
+
+                for (int i = 0; i < simpleQName.length; i++) {
+                    TypeEntry simpleType = symbolTable.getType(simpleQName[i]);
+
+                    if (simpleType != null) {
+                        if (v == null) {
+                            v = new Vector();
+                        }
+
+                        ElementDecl elem = new ElementDecl();
+
+                        elem.setType(simpleType);
+
+                        if (simpleQName.length > 1) {
+                            elem.setName(
+                                    new javax.xml.namespace.QName(
+                                            "",
+                                            simpleQName[i].getLocalPart() + \
"Value")); +                        } else {
+                            elem.setName(
+                                    new javax.xml.namespace.QName("", "value"));
+                        }
+
+                        v.add(elem);
+                    }
+                }
+
+                return v;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Invoked by getContainedElementDeclarations to get the child element types
+     * and child element names underneath a Choice Node
+     *
+     * @param choiceNode
+     * @param symbolTable
+     * @return
+     */
+    private static Vector processChoiceNode(Node choiceNode,
+                                            SymbolTable symbolTable) {
+
+        Vector v = new Vector();
+        NodeList children = choiceNode.getChildNodes();
+
+        for (int j = 0; j < children.getLength(); j++) {
+            QName subNodeKind = Utils.getNodeQName(children.item(j));
+
+            if ((subNodeKind != null)
+                    && Constants.isSchemaXSD(subNodeKind.getNamespaceURI())) {
+                if (subNodeKind.getLocalPart().equals("choice")) {
+                    v.addAll(processChoiceNode(children.item(j), symbolTable));
+                } else if (subNodeKind.getLocalPart().equals("sequence")) {
+                    v.addAll(processSequenceNode(children.item(j),
+                            symbolTable));
+                } else if (subNodeKind.getLocalPart().equals("group")) {
+                    v.addAll(processGroupNode(children.item(j), symbolTable));
+                } else if (subNodeKind.getLocalPart().equals("element")) {
+                    ElementDecl elem = processChildElementNode(children.item(j),
+                            symbolTable);
+
+                    if (elem != null) {
+                        v.add(elem);
+                    }
+                }
+            }
+        }
+
+        return v;
+    }
+
+    /**
+     * Returns named child node.
+     *
+     * @param parentNode Parent node.
+     * @param name Element name of child node to return.
+     */
+    private static Node getChildByName(Node parentNode, String name) throws \
DOMException { +        if (parentNode == null) return null;
+        NodeList children = parentNode.getChildNodes();
+        if (children != null) {
+            for (int i = 0; i < children.getLength(); i++) {
+                Node child = children.item(i);
+                if (child != null) {
+                    if (child.getNodeName() != null && \
name.equals(child.getNodeName())) { +                        return child;
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns all textual nodes of a subnode defined by a parent node
+     * and a path of element names to that subnode.
+     *
+     * @param root Parent node.
+     * @param path Path of element names to text of interest, delimited by "/".
+     */
+    public static String getTextByPath(Node root, String path) throws DOMException {
+        StringTokenizer st = new StringTokenizer(path, "/");
+        Node node = root;
+        while (st.hasMoreTokens()) {
+            String elementName = st.nextToken();
+            Node child = getChildByName(node, elementName);
+            if (child == null)
+                throw new DOMException(DOMException.NOT_FOUND_ERR, "could not find " \
+ elementName); +            node = child;
+        }
+    
+        // should have found the node
+        String text = "";
+        NodeList children = node.getChildNodes();
+        if (children != null) {
+            for (int i = 0; i < children.getLength(); i++) {
+                Node child = children.item(i);
+                if (child != null) {
+                    if (child.getNodeName() != null
+                            && (child.getNodeName().equals("#text")
+                            || child.getNodeName().equals("#cdata-section"))) {
+                        text += child.getNodeValue();
+                    }
+                }
+            }
+        }
+        return text;
+    }
+
+    /**
+     * Returns the complete text of the child xsd:annotation/xsd:documentation
+     * element from the provided node.  Only the first annotation element and
+     * the first documentation element in the annotation element will be used.
+     *
+     * @param root Parent node.
+     * @param path Path of element names to text of interest, delimited by "/".
+     */
+    public static String getAnnotationDocumentation(Node typeNode) {
+        Node annotationNode = typeNode.getFirstChild();
+        while (annotationNode != null) {
+            if (isXSDNode(annotationNode, "annotation")) {
+                break;
+            }
+            annotationNode = annotationNode.getNextSibling();
+        }
+        Node documentationNode;
+        if (annotationNode != null) {
+            documentationNode = annotationNode.getFirstChild();
+            while (documentationNode != null) {
+                if (isXSDNode(documentationNode, "documentation")) {
+                    break;
+                }
+                documentationNode = documentationNode.getNextSibling();
+            }
+        } else {
+            documentationNode = null;
+        }
         
-		if (node == null) {
-			return null;
-		}
-		// Check for SimpleContent
-		// If the node kind is an element, dive into it.
-		if (isXSDNode(node, "element")) {
-			NodeList children = node.getChildNodes();
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexType")) {
-					node = kid;
-					break;
-				}
-			}
-		}
-
-		// Expecting a schema complexType
-		if (isXSDNode(node, "complexType")) {
-			// Under the complexType there could be complexContent/simpleContent
-			// and extension elements if this is a derived type.  Skip over these.
-			NodeList children = node.getChildNodes();
-			Node content = null;
-			for (int j = 0; j < children.getLength(); j++) {
-				Node kid = children.item(j);
-				if (isXSDNode(kid, "complexContent") || isXSDNode(kid, "simpleContent")) {
-					content = kid;
-					break;
-				}
-			}
-			// Check for extensions
-			if (content != null) {
-				children = content.getChildNodes();
-				for (int j = 0; j < children.getLength(); j++) {
-					Node kid = children.item(j);
-					if (isXSDNode(kid, "extension")) {
-						node = kid;
-						break;
-					}
-				}
-			}
+        // should have found the node if it exists
+        String text = "";
+        if (documentationNode != null) {
+            NodeList children = documentationNode.getChildNodes();
+            if (children != null) {
+                for (int i = 0; i < children.getLength(); i++) {
+                    Node child = children.item(i);
+                    if (child != null) {
+                        if (child.getNodeName() != null
+                                && (child.getNodeName().equals("#text")
+                                || child.getNodeName().equals("#cdata-section"))) {
+                            text += child.getNodeValue();
+                        }
+                    }
+                }
+            }
+        }
+        return text;
+    }
+
+    /**
+     * Invoked by getContainedElementDeclarations to get the child element types
+     * and child element names underneath a Sequence Node
+     *
+     * @param sequenceNode
+     * @param symbolTable
+     * @return
+     */
+    private static Vector processSequenceNode(Node sequenceNode,
+                                              SymbolTable symbolTable) {
+
+        Vector v = new Vector();
+        NodeList children = sequenceNode.getChildNodes();
+
+        for (int j = 0; j < children.getLength(); j++) {
+            QName subNodeKind = Utils.getNodeQName(children.item(j));
+
+            if ((subNodeKind != null)
+                    && Constants.isSchemaXSD(subNodeKind.getNamespaceURI())) {
+                if (subNodeKind.getLocalPart().equals("choice")) {
+                    v.addAll(processChoiceNode(children.item(j), symbolTable));
+                } else if (subNodeKind.getLocalPart().equals("sequence")) {
+                    v.addAll(processSequenceNode(children.item(j),
+                            symbolTable));
+                } else if (subNodeKind.getLocalPart().equals("group")) {
+                    v.addAll(processGroupNode(children.item(j), symbolTable));
+                } else if (subNodeKind.getLocalPart().equals("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(Constants.XSD_ANY);
+                    ElementDecl elem = new ElementDecl(type,
+                            Utils.findQName("",
+                                    "any"));
+
+                    elem.setAnyElement(true);
+                    v.add(elem);
+                } else if (subNodeKind.getLocalPart().equals("element")) {
+                    ElementDecl elem = processChildElementNode(children.item(j),
+                            symbolTable);
+
+                    if (elem != null) {
+                        v.add(elem);
+                    }
+                }
+            }
+        }
+
+        return v;
+    }
+
+    /**
+     * Invoked by getContainedElementDeclarations to get the child element types
+     * and child element names underneath a group node. If a ref attribute is
+     * specified, only the referenced group element is returned.
+     *
+     * @param groupNode
+     * @param symbolTable
+     * @return
+     */
+    private static Vector processGroupNode(Node groupNode,
+                                           SymbolTable symbolTable) {
+
+        Vector v = new Vector();
+        if (groupNode.getAttributes().getNamedItem("ref") == null) {
+            NodeList children = groupNode.getChildNodes();
+            for (int j = 0; j < children.getLength(); j++) {
+                QName subNodeKind = Utils.getNodeQName(children.item(j));
+
+                if ((subNodeKind != null)
+                        && Constants.isSchemaXSD(subNodeKind.getNamespaceURI())) {
+                    if (subNodeKind.getLocalPart().equals("choice")) {
+                        v.addAll(processChoiceNode(children.item(j), symbolTable));
+                    } else if (subNodeKind.getLocalPart().equals("sequence")) {
+                        v.addAll(processSequenceNode(children.item(j),
+                                symbolTable));
+                    } else if (subNodeKind.getLocalPart().equals("all")) {
+                        v.addAll(processAllNode(children.item(j), symbolTable));
+                    }
+                }
+            }
+        } else {
+            QName nodeName = Utils.getNodeNameQName(groupNode);
+            QName nodeType = Utils.getTypeQName(groupNode, new BooleanHolder(), \
false); +            // The value of the second argument is 'false' since global \
model group +            // definitions are always represented by objects whose type \
is +            // assignment compatible with \
'org.apache.axis.wsdl.symbolTable.Type'. +            TypeEntry type = \
symbolTable.getTypeEntry(nodeType, false); +
+            if (type != null) {
+                v.add(new ElementDecl(type, nodeName));
+            }
+        }
+        return v;
+    }
+
+
+    /**
+     * Invoked by getContainedElementDeclarations to get the child element types
+     * and child element names underneath an all node.
+     *
+     * @param allNode
+     * @param symbolTable
+     * @return
+     */
+    private static Vector processAllNode(Node allNode,
+                                         SymbolTable symbolTable) {
+
+        Vector v = new Vector();
+        NodeList children = allNode.getChildNodes();
+
+        for (int j = 0; j < children.getLength(); j++) {
+            Node kid = children.item(j);
+
+            if (isXSDNode(kid, "element")) {
+                ElementDecl elem = processChildElementNode(kid, symbolTable);
+
+                if (elem != null) {
+                    v.add(elem);
+                }
+            }
+        }
+
+        return v;
+    }
+
+    /**
+     * Invoked by getContainedElementDeclarations to get the child element type
+     * and child element name for a child element node.
+     * <p/>
+     * If the specified node represents a supported JAX-RPC child element,
+     * we return an ElementDecl containing the child element name and type.
+     *
+     * @param elementNode
+     * @param symbolTable
+     * @return
+     */
+    private static ElementDecl processChildElementNode(Node elementNode,
+                                                       SymbolTable symbolTable) {
+
+        // Get the name qnames.
+        QName nodeName = Utils.getNodeNameQName(elementNode);
+        BooleanHolder forElement = new BooleanHolder();
+        String comments = null;
+        comments = getAnnotationDocumentation(elementNode);
+        
+        // The type qname is used to locate the TypeEntry, which is then
+        // used to retrieve the proper java name of the type.
+        QName nodeType = Utils.getTypeQName(elementNode, forElement, false);
+        TypeEntry type = symbolTable.getTypeEntry(nodeType,
+                forElement.value);
+
+        // An element inside a complex type is either qualified or unqualified.
+        // If the ref= attribute is used, the name of the ref'd element is used
+        // (which must be a root element).  If the ref= attribute is not
+        // used, the name of the element is unqualified.
+        if (!forElement.value) {
+
+            // check the Form (or elementFormDefault) attribute of this node to
+            // determine if it should be namespace quailfied or not.
+            String form = Utils.getAttribute(elementNode, "form");
+
+            if ((form != null) && form.equals("unqualified")) {
+
+                // Unqualified nodeName
+                nodeName = Utils.findQName("", nodeName.getLocalPart());
+            } else if (form == null) {
+
+                // check elementForDefault on schema element
+                String def = Utils.getScopedAttribute(elementNode,
+                        "elementFormDefault");
+
+                if ((def == null) || def.equals("unqualified")) {
+
+                    // Unqualified nodeName
+                    nodeName = Utils.findQName("", nodeName.getLocalPart());
+                }
+            }
+        }
+
+        if (type != null) {
+            ElementDecl elem = new ElementDecl(type, nodeName);
+            elem.setDocumentation(comments);
+            String minOccurs = Utils.getAttribute(elementNode,
+                    "minOccurs");
+
+            if ((minOccurs != null) && minOccurs.equals("0")) {
+                elem.setMinOccursIs0(true);
+            }
+
+            elem.setNillable(
+                    JavaUtils.isTrueExplicitly(
+                            Utils.getAttribute(elementNode, "nillable")));
+
+            return elem;
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns the WSDL2Java QName for the anonymous type of the element
+     * or null.
+     *
+     * @param node
+     * @return
+     */
+    public static QName getElementAnonQName(Node node) {
+
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexType")
+                        || isXSDNode(kid, "simpleType")) {
+                    return Utils.getNodeNameQName(kid);
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Returns the WSDL2Java QName for the anonymous type of the attribute
+     * or null.
+     *
+     * @param node
+     * @return
+     */
+    public static QName getAttributeAnonQName(Node node) {
+
+        if (isXSDNode(node, "attribute")) {
+            NodeList children = node.getChildNodes();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexType")
+                        || isXSDNode(kid, "simpleType")) {
+                    return Utils.getNodeNameQName(kid);
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * If the specified node is a simple type or contains simpleContent, return true
+     *
+     * @param node
+     * @return
+     */
+    public static boolean isSimpleTypeOrSimpleContent(Node node) {
+
+        if (node == null) {
+            return false;
+        }
+
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexType")) {
+                    node = kid;
+
+                    break;
+                } else if (isXSDNode(kid, "simpleType")) {
+                    return true;
+                }
+            }
+        }
+
+        // Expecting a schema complexType or simpleType
+        if (isXSDNode(node, "simpleType")) {
+            return true;
+        }
+
+        if (isXSDNode(node, "complexType")) {
+
+            // Under the complexType there could be complexContent/simpleContent
+            // and extension elements if this is a derived type.  Skip over these.
+            NodeList children = node.getChildNodes();
+            Node complexContent = null;
+            Node simpleContent = null;
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexContent")) {
+                    complexContent = kid;
+
+                    break;
+                } else if (isXSDNode(kid, "simpleContent")) {
+                    simpleContent = kid;
+                }
+            }
+
+            if (complexContent != null) {
+                return false;
+            }
+
+            if (simpleContent != null) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Test whether <tt>node</tt> is not null, belongs to the XML
+     * Schema namespace, and has a localName that matches
+     * <tt>schemaLocalName</tt>
+     * <p/>
+     * This can be used to determine that a given Node defines a
+     * schema "complexType" "element" and so forth.
+     *
+     * @param node            a <code>Node</code> value
+     * @param schemaLocalName a <code>String</code> value
+     * @return true if the node is matches the name in the schema namespace.
+     */
+    private static boolean isXSDNode(Node node, String schemaLocalName) {
+
+        if ((node != null) && Constants.isSchemaXSD(node.getNamespaceURI())) {
+            String localName = node.getLocalName();
+
+            return ((localName != null) && localName.equals(schemaLocalName));
+        }
+
+        return false;
+    }
+
+    /**
+     * Look for the base type of node iff node is a complex type that has been
+     * derived by restriction; otherwise return null.
+     *
+     * @param node
+     * @param symbolTable
+     * @return
+     */
+    public static TypeEntry getComplexElementRestrictionBase(Node node,
+                                                             SymbolTable \
symbolTable) { +
+        if (node == null) {
+            return null;
+        }
+
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+            Node complexNode = null;
+
+            for (int j = 0;
+                 (j < children.getLength()) && (complexNode == null); j++) {
+                if (isXSDNode(children.item(j), "complexType")) {
+                    complexNode = children.item(j);
+                    node = complexNode;
+                }
+            }
+        }
+
+        // Expecting a schema complexType
+        if (isXSDNode(node, "complexType")) {
+
+            // Under the complexType there could be should be a complexContent &
+            // restriction elements if this is a derived type.
+            NodeList children = node.getChildNodes();
+            Node content = null;
+            Node restriction = null;
+
+            for (int j = 0; (j < children.getLength()) && (content == null);
+                 j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexContent")) {
+                    content = kid;
+                }
+            }
+
+            if (content != null) {
+                children = content.getChildNodes();
+
+                for (int j = 0;
+                     (j < children.getLength()) && (restriction == null);
+                     j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "restriction")) {
+                        restriction = kid;
+                    }
+                }
+            }
+
+            if (restriction == null) {
+                return null;
+            } else {
+
+                // Get the QName of the extension base
+                QName restrictionType = Utils.getTypeQName(restriction,
+                        new BooleanHolder(),
+                        false);
+
+                if (restrictionType == null) {
+                    return null;
+                } else {
+
+                    // Return associated Type
+                    return symbolTable.getType(restrictionType);
+                }
+            }
+        } else {
+            return null;
+        }
+    }
+
+    /**
+     * If the specified node represents a supported JAX-RPC complexType/element
+     * which extends another complexType.  The Type of the base is returned.
+     *
+     * @param node
+     * @param symbolTable
+     * @return
+     */
+    public static TypeEntry getComplexElementExtensionBase(Node node,
+                                                           SymbolTable symbolTable) \
{ +
+        if (node == null) {
+            return null;
+        }
+
+        TypeEntry cached = (TypeEntry) symbolTable.node2ExtensionBase.get(node);
+
+        if (cached != null) {
+            return cached;    // cache hit
+        }
+
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+            Node complexNode = null;
+
+            for (int j = 0;
+                 (j < children.getLength()) && (complexNode == null); j++) {
+                if (isXSDNode(children.item(j), "complexType")) {
+                    complexNode = children.item(j);
+                    node = complexNode;
+                }
+            }
+        }
+
+        // Expecting a schema complexType
+        if (isXSDNode(node, "complexType")) {
+
+            // Under the complexType there could be should be a complexContent &
+            // extension elements if this is a derived type.
+            NodeList children = node.getChildNodes();
+            Node content = null;
+            Node extension = null;
+
+            for (int j = 0; (j < children.getLength()) && (content == null);
+                 j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexContent")
+                        || isXSDNode(kid, "simpleContent")) {
+                    content = kid;
+                }
+            }
+
+            if (content != null) {
+                children = content.getChildNodes();
+
+                for (int j = 0;
+                     (j < children.getLength()) && (extension == null);
+                     j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "extension")) {
+                        extension = kid;
+                    }
+                }
+            }
+
+            if (extension == null) {
+                cached = null;
+            } else {
+
+                // Get the QName of the extension base
+                QName extendsType = Utils.getTypeQName(extension,
+                        new BooleanHolder(),
+                        false);
+
+                if (extendsType == null) {
+                    cached = null;
+                } else {
+
+                    // Return associated Type
+                    cached = symbolTable.getType(extendsType);
+                }
+            }
+        }
+
+        symbolTable.node2ExtensionBase.put(node, cached);
+
+        return cached;
+    }
+
+    /**
+     * If the specified node represents a 'normal' non-enumeration simpleType,
+     * the QName of the simpleType base is returned.
+     *
+     * @param node
+     * @return
+     */
+    public static QName getSimpleTypeBase(Node node) {
+
+        QName[] qname = getContainedSimpleTypes(node);
+
+        if ((qname != null) && (qname.length > 0)) {
+            return qname[0];
+        }
+
+        return null;
+    }
+
+    /**
+     * Method getContainedSimpleTypes
+     *
+     * @param node
+     * @return
+     */
+    public static QName[] getContainedSimpleTypes(Node node) {
+
+        QName[] baseQNames = null;
+
+        if (node == null) {
+            return null;
+        }
+
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                if (isXSDNode(children.item(j), "simpleType")) {
+                    node = children.item(j);
+
+                    break;
+                }
+            }
+        }
+
+        // Get the node kind, expecting a schema simpleType
+        if (isXSDNode(node, "simpleType")) {
+
+            // Under the simpleType there should be a restriction.
+            // (There may be other #text nodes, which we will ignore).
+            NodeList children = node.getChildNodes();
+            Node restrictionNode = null;
+            Node unionNode = null;
+
+            for (int j = 0;
+                 (j < children.getLength()) && (restrictionNode == null);
+                 j++) {
+                if (isXSDNode(children.item(j), "restriction")) {
+                    restrictionNode = children.item(j);
+                } else if (isXSDNode(children.item(j), "union")) {
+                    unionNode = children.item(j);
+                }
+            }
+
+            // The restriction node indicates the type being restricted
+            // (the base attribute contains this type).
+            if (restrictionNode != null) {
+                baseQNames = new QName[1];
+                baseQNames[0] = Utils.getTypeQName(restrictionNode,
+                        new BooleanHolder(), false);
+            }
+
+            if (unionNode != null) {
+                baseQNames = Utils.getMemberTypeQNames(unionNode);
+            }
+
+            // Look for enumeration elements underneath the restriction node
+            if ((baseQNames != null) && (restrictionNode != null)
+                    && (unionNode != null)) {
+                NodeList enums = restrictionNode.getChildNodes();
+
+                for (int i = 0; i < enums.getLength(); i++) {
+                    if (isXSDNode(enums.item(i), "enumeration")) {
+
+                        // Found an enumeration, this isn't a
+                        // 'normal' simple type.
+                        return null;
+                    }
+                }
+            }
+        }
+
+        return baseQNames;
+    }
+
+    /**
+     * Returns the contained restriction or extension node underneath
+     * the specified node.  Returns null if not found
+     *
+     * @param node
+     * @return
+     */
+    public static Node getRestrictionOrExtensionNode(Node node) {
+
+        Node re = null;
+
+        if (node == null) {
+            return re;
+        }
+
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node n = children.item(j);
+
+                if (isXSDNode(n, "simpleType") || isXSDNode(n, "complexType")
+                        || isXSDNode(n, "simpleContent")) {
+                    node = n;
+
+                    break;
+                }
+            }
+        }
+
+        // Get the node kind, expecting a schema simpleType
+        if (isXSDNode(node, "simpleType") || isXSDNode(node, "complexType")) {
+
+            // Under the complexType there could be a complexContent.
+            NodeList children = node.getChildNodes();
+            Node complexContent = null;
+
+            if (node.getLocalName().equals("complexType")) {
+                for (int j = 0;
+                     (j < children.getLength()) && (complexContent == null);
+                     j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "complexContent")
+                            || isXSDNode(kid, "simpleContent")) {
+                        complexContent = kid;
+                    }
+                }
+
+                node = complexContent;
+            }
+
+            // Now get the extension or restriction node
+            if (node != null) {
+                children = node.getChildNodes();
+
+                for (int j = 0; (j < children.getLength()) && (re == null);
+                     j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "extension")
+                            || isXSDNode(kid, "restriction")) {
+                        re = kid;
+                    }
+                }
+            }
+        }
+
+        return re;
+    }
+
+    /**
+     * If the specified node represents an array encoding of one of the following
+     * forms, then return the qname repesenting the element type of the array.
+     *
+     * @param node is the node
+     * @param dims is the output value that contains the number of dimensions if \
return is not null +     * @return QName or null
+     */
+    public static QName getArrayComponentQName(Node node,
+                                               IntHolder dims,
+                                               SymbolTable symbolTable) {
+
+        dims.value = 1;    // assume 1 dimension
+
+        QName qName = getCollectionComponentQName(node);
+
+        if (qName == null) {
+            qName = getArrayComponentQName_JAXRPC(node, dims, symbolTable);
+        }
+
+        return qName;
+    }
+
+    /**
+     * If the specified node represents an element that references a collection
+     * then return the qname repesenting the component of the collection.
+     * <p/>
+     * <xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/>
+     * returns qname for"xsd:string"
+     * <xsd:element ref="alias"  maxOccurs="unbounded"/>
+     * returns qname for "alias"
+     *
+     * @param node is the Node
+     * @return QName of the compoent of the collection
+     */
+    public static QName getCollectionComponentQName(Node node) {
+
+        if (node == null) {
+            return null;
+        }
+
+        // If the node kind is an element, dive get its type.
+        if (isXSDNode(node, "element")) {
+
+            // Compare the componentQName with the name of the
+            // full name.  If different, return componentQName
+            BooleanHolder forElement = new BooleanHolder();
+            QName componentQName = Utils.getTypeQName(node, forElement,
+                    true);
+
+            if (componentQName != null) {
+                QName fullQName = Utils.getTypeQName(node, forElement, false);
+
+                if (!componentQName.equals(fullQName)) {
+                    return componentQName;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * If the specified node represents an array encoding of one of the following
+     * forms, then return the qname repesenting the element type of the array.
+     *
+     * @param node is the node
+     * @param dims is the output value that contains the number of dimensions if \
return is not null +     * @return QName or null
+     *         <p/>
+     *         JAX-RPC Style 2:
+     *         <xsd:complexType name="hobbyArray">
+     *         <xsd:complexContent>
+     *         <xsd:restriction base="soapenc:Array">
+     *         <xsd:attribute ref="soapenc:arrayType" \
wsdl:arrayType="xsd:string[]"/> +     *         </xsd:restriction>
+     *         </xsd:complexContent>
+     *         </xsd:complexType>
+     *         <p/>
+     *         JAX-RPC Style 3:
+     *         <xsd:complexType name="petArray">
+     *         <xsd:complexContent>
+     *         <xsd:restriction base="soapenc:Array">
+     *         <xsd:sequence>
+     *         <xsd:element name="alias" type="xsd:string" maxOccurs="unbounded"/>
+     *         </xsd:sequence>
+     *         </xsd:restriction>
+     *         </xsd:complexContent>
+     *         </xsd:complexType>
+     */
+    private static QName getArrayComponentQName_JAXRPC(Node node,
+                                                       IntHolder dims,
+                                                       SymbolTable symbolTable)
+    {
+
+        dims.value = 0;    // Assume 0
+
+        if (node == null) {
+            return null;
+        }
+
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexType")) {
+                    node = kid;
+
+                    break;
+                }
+            }
+        }
+
+        // Get the node kind, expecting a schema complexType
+        if (isXSDNode(node, "complexType")) {
+
+            // Under the complexType there should be a complexContent.
+            // (There may be other #text nodes, which we will ignore).
+            NodeList children = node.getChildNodes();
+            Node complexContentNode = null;
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexContent")
+                        || isXSDNode(kid, "simpleContent")) {
+                    complexContentNode = kid;
+
+                    break;
+                }
+            }
+
+            // Under the complexContent there should be a restriction.
+            // (There may be other #text nodes, which we will ignore).
+            Node restrictionNode = null;
+
+            if (complexContentNode != null) {
+                children = complexContentNode.getChildNodes();
+
+                for (int j = 0; j < children.getLength(); j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "restriction")) {
+                        restrictionNode = kid;
+
+                        break;
+                    }
+                }
+            }
+
+            // The restriction node must have a base of soapenc:Array.
+            QName baseType = null;
+
+            if (restrictionNode != null) {
+                baseType = Utils.getTypeQName(restrictionNode,
+                        new BooleanHolder(), false);
+
+                if (baseType != null) {
+                    if (!baseType.getLocalPart().equals("Array") ||
+                            !Constants.isSOAP_ENC(baseType.getNamespaceURI())) {
+                        if (!symbolTable.arrayTypeQNames.contains(baseType)) {
+                            baseType = null; // Did not find base=soapenc:Array
+                        }
+                    }
+                }
+            }
             
-			// examine children of the node for <attribute> elements
-			children = node.getChildNodes();
-			for (int i = 0; i < children.getLength(); i++) {
-				Node child = children.item(i);
-				if (! isXSDNode(child, "attribute")) {
-					continue;
-				}
-                
-				// we have an attribute node
-				if (v == null)
-					v = new Vector();
-
-				// Get the name and type qnames.
-				// The type qname is used to locate the TypeEntry, which is then
-				// used to retrieve the proper java name of the type.
-				QName attributeName = Utils.getNodeNameQName(child);
-				BooleanHolder forElement = new BooleanHolder();
-				QName attributeType = Utils.getTypeQName(child, forElement, false);
-
-				// An attribute is either qualified or unqualified.
-				// If the ref= attribute is used, the name of the ref'd element is used
-				// (which must be a root element).  If the ref= attribute is not
-				// used, the name of the attribute is unqualified.
-				if (!forElement.value) {
-					// check the Form (or attributeFormDefault) attribute of 
-					// this node to determine if it should be namespace 
-					// quailfied or not.
-					String form = Utils.getAttribute(child, "form");
-					if (form != null && form.equals("unqualified")) {
-						// Unqualified nodeName
-						attributeName = Utils.findQName("", attributeName.getLocalPart());            
-					} else if (form == null) {
-						// check attributeFormDefault on schema element
-						String def = Utils.getScopedAttribute(child, 
-															  "attributeFormDefault");
-						if (def == null || def.equals("unqualified")) {
-							// Unqualified nodeName
-							attributeName = Utils.findQName("", attributeName.getLocalPart());            \
                
-						}
-					}
-				} else {
-					attributeName = attributeType;
-				}
-                
-				// Get the corresponding TypeEntry from the symbol table
-				TypeEntry type = symbolTable.getTypeEntry(attributeType, 
-														  forElement.value);
-                
-				// add type and name to vector, skip it if we couldn't parse it
-				// XXX - this may need to be revisited.
-				if (type != null && attributeName != null) {
-					v.add(type);
-					v.add(attributeName);
-				}
-			}
-		}            
-		return v;
-	}
-
-	// list of all of the XSD types in Schema 2001
-	private static String schemaTypes[] = {
-		"string",
-		"normalizedString",
-		"token",        
-		"byte",
-		"unsignedByte",
-		"base64Binary",
-		"hexBinary",    
-		"integer",
-		"positiveInteger",
-		"negativeInteger",
-		"nonNegativeInteger",
-		"nonPositiveInteger",
-		"int",
-		"unsignedInt",  
-		"long",
-		"unsignedLong",
-		"short",
-		"unsignedShort",
-		"decimal",
-		"float",
-		"double",
-		"boolean",
-		"time",
-		"dateTime",
-		"duration",
-		"date",
-		"gMonth",
-		"gYear",
-		"gYearMonth",
-		"gDay",
-		"gMonthDay",
-		"Name",
-		"QName",
-		"NCName",
-		"anyURI",
-		"language",
-		"ID",
-		"IDREF",
-		"IDREFS",
-		"ENTITY",
-		"ENTITIES",
-		"NOTATION",
-		"NMTOKEN",
-		"NMTOKENS"
-	};
+            // Under the restriction there should be an attribute OR a sequence/all \
group node. +            // (There may be other #text nodes, which we will ignore).
+            Node groupNode = null;
+            Node attributeNode = null;
+
+            if (baseType != null) {
+                children = restrictionNode.getChildNodes();
+
+                for (int j = 0; (j < children.getLength())
+                        && (groupNode == null)
+                        && (attributeNode == null); j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "sequence") || isXSDNode(kid, "all")) {
+                        groupNode = kid;
+
+                        if (groupNode.getChildNodes().getLength() == 0) {
+
+                            // This covers the rather odd but legal empty sequence.
+                            // <complexType name="ArrayOfString">
+                            // <complexContent>
+                            // <restriction base="soapenc:Array">
+                            // <sequence/>
+                            // <attribute ref="soapenc:arrayType" \
wsdl:arrayType="string[]"/> +                            // </restriction>
+                            // </complexContent>
+                            // </complexType>
+                            groupNode = null;
+                        }
+                    }
+
+                    if (isXSDNode(kid, "attribute")) {
+
+                        // If the attribute node does not have \
ref="soapenc:arrayType" +                        // then keep looking.
+                        BooleanHolder isRef = new BooleanHolder();
+                        QName refQName = Utils.getTypeQName(kid, isRef,
+                                false);
+
+                        if ((refQName != null) && isRef.value
+                                && refQName.getLocalPart().equals("arrayType")
+                                && Constants.isSOAP_ENC(
+                                        refQName.getNamespaceURI())) {
+                            attributeNode = kid;
+                        }
+                    }
+                }
+            }
+
+            // If there is an attribute node, look at wsdl:arrayType to get the \
element type +            if (attributeNode != null) {
+                String wsdlArrayTypeValue = null;
+                Vector attrs =
+                        Utils.getAttributesWithLocalName(attributeNode,
+                                "arrayType");
+
+                for (int i = 0;
+                     (i < attrs.size()) && (wsdlArrayTypeValue == null);
+                     i++) {
+                    Node attrNode = (Node) attrs.elementAt(i);
+                    String attrName = attrNode.getNodeName();
+                    QName attrQName =
+                            Utils.getQNameFromPrefixedName(attributeNode, attrName);
+
+                    if (Constants.isWSDL(attrQName.getNamespaceURI())) {
+                        wsdlArrayTypeValue = attrNode.getNodeValue();
+                    }
+                }
+
+                // The value could have any number of [] or [,] on the end
+                // Strip these off to get the prefixed name.
+                // The convert the prefixed name into a qname.
+                // Count the number of [ and , to get the dim information.
+                if (wsdlArrayTypeValue != null) {
+                    int i = wsdlArrayTypeValue.indexOf('[');
+
+                    if (i > 0) {
+                        String prefixedName = wsdlArrayTypeValue.substring(0,
+                                i);
+                        String mangledString = wsdlArrayTypeValue.replace(',',
+                                '[');
+
+                        dims.value = 0;
+
+                        int index = mangledString.indexOf('[');
+
+                        while (index > 0) {
+                            dims.value++;
+
+                            index = mangledString.indexOf('[', index + 1);
+                        }
+
+                        return Utils.getQNameFromPrefixedName(restrictionNode,
+                                prefixedName);
+                    }
+                }
+            } else if (groupNode != null) {
+
+                // Get the first element node under the group node.
+                NodeList elements = groupNode.getChildNodes();
+                Node elementNode = null;
+
+                for (int i = 0;
+                     (i < elements.getLength()) && (elementNode == null);
+                     i++) {
+                    Node kid = elements.item(i);
+
+                    if (isXSDNode(kid, "element")) {
+                        elementNode = elements.item(i);
+
+                        break;
+                    }
+                }
+
+                // The element node should have maxOccurs="unbounded" and
+                // a type
+                if (elementNode != null) {
+                    String maxOccursValue = Utils.getAttribute(elementNode,
+                            "maxOccurs");
+
+                    if ((maxOccursValue != null)
+                            && maxOccursValue.equalsIgnoreCase("unbounded")) {
+
+                        // Get the QName of the type without considering maxOccurs
+                        dims.value = 1;
+
+                        return Utils.getTypeQName(elementNode,
+                                new BooleanHolder(), true);
+                    }
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * adds an attribute node's type and name to the vector
+     * helper used by getContainedAttributeTypes
+     *
+     * @param v
+     * @param child
+     * @param symbolTable
+     */
+    private static void addAttributeToVector(Vector v, Node child,
+                                             SymbolTable symbolTable) {
+
+        // Get the name and type qnames.
+        // The type qname is used to locate the TypeEntry, which is then
+        // used to retrieve the proper java name of the type.
+        QName attributeName = Utils.getNodeNameQName(child);
+        BooleanHolder forElement = new BooleanHolder();
+        QName attributeType = Utils.getTypeQName(child, forElement,
+                false);
+
+        // An attribute is either qualified or unqualified.
+        // If the ref= attribute is used, the name of the ref'd element is used
+        // (which must be a root element).  If the ref= attribute is not
+        // used, the name of the attribute is unqualified.
+        if (!forElement.value) {
+
+            // check the Form (or attributeFormDefault) attribute of
+            // this node to determine if it should be namespace
+            // quailfied or not.
+            String form = Utils.getAttribute(child, "form");
+
+            if ((form != null) && form.equals("unqualified")) {
+
+                // Unqualified nodeName
+                attributeName = Utils.findQName("",
+                        attributeName.getLocalPart());
+            } else if (form == null) {
+
+                // check attributeFormDefault on schema element
+                String def = Utils.getScopedAttribute(child,
+                        "attributeFormDefault");
+
+                if ((def == null) || def.equals("unqualified")) {
+
+                    // Unqualified nodeName
+                    attributeName =
+                            Utils.findQName("", attributeName.getLocalPart());
+                }
+            }
+        } else {
+            attributeName = attributeType;
+        }
+
+        // Get the corresponding TypeEntry from the symbol table
+        TypeEntry type = symbolTable.getTypeEntry(attributeType,
+                forElement.value);
+
+        // add type and name to vector, skip it if we couldn't parse it
+        // XXX - this may need to be revisited.
+        if ((type != null) && (attributeName != null)) {
+            v.add(type);
+            v.add(attributeName);
+        }
+    }
+
+    /**
+     * adds an attribute to the vector
+     * helper used by addAttributeGroupToVector
+     *
+     * @param v
+     * @param symbolTable
+     * @param type
+     * @param name
+     */
+    private static void addAttributeToVector(Vector v, SymbolTable symbolTable,
+                                             QName type, QName name) {
+
+        TypeEntry typeEnt = symbolTable.getTypeEntry(type, false);
+
+        if (typeEnt != null)    // better not be null
+        {
+            v.add(typeEnt);
+            v.add(name);
+        }
+    }
+
+    /**
+     * adds each attribute group's attribute node to the vector
+     * helper used by getContainedAttributeTypes
+     *
+     * @param v
+     * @param attrGrpnode
+     * @param symbolTable
+     */
+    private static void addAttributeGroupToVector(Vector v, Node attrGrpnode,
+                                                  SymbolTable symbolTable) {
+
+        // get the type of the attributeGroup
+        QName attributeGroupType = Utils.getTypeQName(attrGrpnode,
+                new BooleanHolder(), false);
+        TypeEntry type =
+                symbolTable.getTypeEntry(attributeGroupType, false);
+
+        if (type != null) {
+            if (type.getNode() != null) {
+
+                // for each attribute or attributeGroup defined in the \
attributeGroup... +                NodeList children = \
type.getNode().getChildNodes(); +
+                for (int j = 0; j < children.getLength(); j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "attribute")) {
+                        addAttributeToVector(v, kid, symbolTable);
+                    } else if (isXSDNode(kid, "attributeGroup")) {
+                        addAttributeGroupToVector(v, kid, symbolTable);
+                    }
+                }
+            } else if (type.isBaseType()) {
+
+                // soap/encoding is treated as a "known" schema
+                // so let's act like we know it
+                if (type.getQName().equals(Constants.SOAP_COMMON_ATTRS11)) {
+
+                    // 1.1 commonAttributes contains two attributes
+                    addAttributeToVector(v, symbolTable, Constants.XSD_ID,
+                            new QName(Constants.URI_SOAP11_ENC,
+                                    "id"));
+                    addAttributeToVector(v, symbolTable, Constants.XSD_ANYURI,
+                            new QName(Constants.URI_SOAP11_ENC,
+                                    "href"));
+                } else if (type.getQName().equals(
+                        Constants.SOAP_COMMON_ATTRS12)) {
+
+                    // 1.2 commonAttributes contains one attribute
+                    addAttributeToVector(v, symbolTable, Constants.XSD_ID,
+                            new QName(Constants.URI_SOAP12_ENC,
+                                    "id"));
+                } else if (type.getQName().equals(
+                        Constants.SOAP_ARRAY_ATTRS11)) {
+
+                    // 1.1 arrayAttributes contains two attributes
+                    addAttributeToVector(v, symbolTable, Constants.XSD_STRING,
+                            new QName(Constants.URI_SOAP12_ENC,
+                                    "arrayType"));
+                    addAttributeToVector(v, symbolTable, Constants.XSD_STRING,
+                            new QName(Constants.URI_SOAP12_ENC,
+                                    "offset"));
+                } else if (type.getQName().equals(
+                        Constants.SOAP_ARRAY_ATTRS12)) {
+
+                    // 1.2 arrayAttributes contains two attributes
+                    // the type of "arraySize" is really "2003soapenc:arraySize"
+                    // which is rather of a hairy beast that is not yet supported
+                    // in Axis, so let's just use string; nobody should care for
+                    // now because arraySize wasn't used at all up until this
+                    // bug 23145 was fixed, which had nothing to do, per se, with
+                    // adding support for arraySize
+                    addAttributeToVector(v, symbolTable, Constants.XSD_STRING,
+                            new QName(Constants.URI_SOAP12_ENC,
+                                    "arraySize"));
+                    addAttributeToVector(v, symbolTable, Constants.XSD_QNAME,
+                            new QName(Constants.URI_SOAP12_ENC,
+                                    "itemType"));
+                }
+            }
+        }
+    }
+
+    /**
+     * Return the attribute names and types if any in the node
+     * The even indices are the attribute types (TypeEntry) and
+     * the odd indices are the corresponding names (Strings).
+     * <p/>
+     * Example:
+     * <complexType name="Person">
+     * <sequence>
+     * <element minOccurs="1" maxOccurs="1" name="Age" type="double" />
+     * <element minOccurs="1" maxOccurs="1" name="ID" type="xsd:float" />
+     * </sequence>
+     * <attribute name="Name" type="string" />
+     * <attribute name="Male" type="boolean" />
+     * <attributeGroup ref="s0:MyAttrSet" />
+     * </complexType>
+     *
+     * @param node
+     * @param symbolTable
+     * @return
+     */
+    public static Vector getContainedAttributeTypes(Node node,
+                                                    SymbolTable symbolTable) {
+
+        Vector v = null;    // return value
+
+        if (node == null) {
+            return null;
+        }
+
+        // Check for SimpleContent
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexType")) {
+                    node = kid;
+
+                    break;
+                }
+            }
+        }
+
+        // Expecting a schema complexType
+        if (isXSDNode(node, "complexType")) {
+
+            // Under the complexType there could be complexContent/simpleContent
+            // and extension elements if this is a derived type.  Skip over these.
+            NodeList children = node.getChildNodes();
+            Node content = null;
+
+            for (int j = 0; j < children.getLength(); j++) {
+                Node kid = children.item(j);
+
+                if (isXSDNode(kid, "complexContent")
+                        || isXSDNode(kid, "simpleContent")) {
+                    content = kid;
+
+                    break;
+                }
+            }
+
+            // Check for extensions or restrictions
+            if (content != null) {
+                children = content.getChildNodes();
+
+                for (int j = 0; j < children.getLength(); j++) {
+                    Node kid = children.item(j);
+
+                    if (isXSDNode(kid, "extension")
+                            || isXSDNode(kid, "restriction")) {
+                        node = kid;
+
+                        break;
+                    }
+                }
+            }
+
+            // examine children of the node for <attribute> elements
+            children = node.getChildNodes();
+
+            for (int i = 0; i < children.getLength(); i++) {
+                Node child = children.item(i);
+
+                if (!isXSDNode(child, "attribute")
+                        && !isXSDNode(child, "attributeGroup")) {
+                    continue;
+                }
+
+                // we have an attribute or attributeGroup node
+                if (v == null) {
+                    v = new Vector();
+                }
+
+                if (isXSDNode(child, "attributeGroup")) {
+                    addAttributeGroupToVector(v, child, symbolTable);
+                } else {
+
+                    // we have an attribute
+                    addAttributeToVector(v, child, symbolTable);
+                }
+            }
+        }
+
+        return v;
+    }
+
+    // list of all of the XSD types in Schema 2001
+
+    /** Field schemaTypes[] */
+    private static String schemaTypes[] = {
+        "string", "normalizedString", "token", "byte", "unsignedByte",
+        "base64Binary", "hexBinary", "integer", "positiveInteger",
+        "negativeInteger", "nonNegativeInteger", "nonPositiveInteger", "int",
+        "unsignedInt", "long", "unsignedLong", "short", "unsignedShort",
+        "decimal", "float", "double", "boolean", "time", "dateTime", "duration",
+        "date", "gMonth", "gYear", "gYearMonth", "gDay", "gMonthDay", "Name",
+        "QName", "NCName", "anyURI", "language", "ID", "IDREF", "IDREFS",
+        "ENTITY", "ENTITIES", "NOTATION", "NMTOKEN", "NMTOKENS",
+        "anySimpleType"
+    };
+
+    /** Field schemaTypeSet */
+    private static final Set schemaTypeSet =
+            new HashSet(Arrays.asList(schemaTypes));
+
+    /**
+     * Determine if a string is a simple XML Schema type
+     *
+     * @param s
+     * @return
+     */
+    private static boolean isSimpleSchemaType(String s) {
+
+        if (s == null) {
+            return false;
+        }
+
+        return schemaTypeSet.contains(s);
+    }
+
+    /**
+     * Determine if a QName is a simple XML Schema type
+     *
+     * @param qname
+     * @return
+     */
+    public static boolean isSimpleSchemaType(QName qname) {
+
+        if ((qname == null) || !Constants.isSchemaXSD(qname.getNamespaceURI())) {
+            return false;
+        }
+
+        return isSimpleSchemaType(qname.getLocalPart());
+    }
+
+    /**
+     * Returns the base type of a given type with its symbol table.
+     * This logic is extracted from JavaTypeWriter's constructor() method
+     * for reusing.
+     *
+     * @param type
+     * @param symbolTable
+     * @return
+     */
+    public static TypeEntry getBaseType(TypeEntry type, SymbolTable symbolTable) {
+        Node node = type.getNode();
+        TypeEntry base = getComplexElementExtensionBase(
+                node, symbolTable);
+        if (base == null) {
+            base = getComplexElementRestrictionBase(node, symbolTable);
+        }
+        
+        if (base == null) {
+            QName baseQName = getSimpleTypeBase(node);
+            if (baseQName != null) {
+                base = symbolTable.getType(baseQName);
+            }
+        }
+        return base;
+    }
+
+    /**
+     * Returns whether the specified node represents a <xsd:simpleType>
+     * with a nested <xsd:list itemType="...">.
+     * @param node
+     * @return
+     */
+    public static boolean isListWithItemType(Node node) {
+        
+        return getListItemType(node) != null;
+    }
 
-	private static final Set schemaTypeSet = new HashSet(Arrays.asList(schemaTypes));
-    
-	/**
-	 * Determine if a string is a simple XML Schema type 
-	 */ 
-	private static boolean isSimpleSchemaType(String s) {
-		if (s == null)
-			return false;
-
-		return schemaTypeSet.contains(s);
-	}
-	/**
-	 * Determine if a QName is a simple XML Schema type 
-	 */ 
-	public static boolean isSimpleSchemaType(QName qname) {
-		if (qname == null || 
-			!Constants.isSchemaXSD(qname.getNamespaceURI())) {
-			return false;
-		}
-		return isSimpleSchemaType(qname.getLocalPart());
-	}
+    /**
+     * Returns the value of itemType attribute of <xsd:list> in <xsd:simpleType>
+     * @param node
+     * @return
+     */
+    public static QName getListItemType(Node node) {
+        
+        if (node == null) {
+            return null;
+        }
+        
+        // If the node kind is an element, dive into it.
+        if (isXSDNode(node, "element")) {
+            NodeList children = node.getChildNodes();
+            for (int j = 0; j < children.getLength(); j++) {
+                if (isXSDNode(children.item(j), "simpleType")) {
+                    node = children.item(j);
+                    break;
+                }
+            }
+        }
+        // Get the node kind, expecting a schema simpleType
+        if (isXSDNode(node, "simpleType")) {
+            NodeList children = node.getChildNodes();
+            for (int j = 0; j < children.getLength(); j++) {
+                if (isXSDNode(children.item(j), "list")) {
+                    Node listNode = children.item(j);
+                    org.w3c.dom.Element listElement =
+                    (org.w3c.dom.Element) listNode;
+                    String type = listElement.getAttribute("itemType");
+                    if (type.equals("")) {
+                        return null;
+                    }
+                    int colonIndex = type.lastIndexOf(":");
+                    if (colonIndex > 0) {
+                        type = type.substring(colonIndex + 1);
+                    }
+                    return new QName(Constants.URI_2001_SCHEMA_XSD, type + "[]");
+                }
+            }
+        }
+        return null;
+    }
 }
Index: org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java
===================================================================
RCS file: /home/cvspublic/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java,v
 retrieving revision 1.27
diff -u -r1.27 WSDL2Ws.java
--- org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java	27 Apr 2004 03:23:08 -0000	1.27
+++ org/apache/axis/wsdl/wsdl2ws/WSDL2Ws.java	28 May 2004 16:16:44 -0000
@@ -56,15 +56,15 @@
 import org.w3c.dom.Node;
 
 /**
- * This this the main class for the WSDL2Ws Tool. This class reuses the code in the 
+ * This this the main class for the WSDL2Ws Tool. This class reuses the code in the
  * Axis java implementations to parse the WSDL file.
- * the functinality of the class can be discribed as follows 
- * 	1) create a Symbol table
+ * the functinality of the class can be discribed as follows
+ *      1) create a Symbol table
  *  2) create WrapperInfo class parsing the commandline arguments and the \
                SymbolTable
  *  3) create TypeMap parsing the  Symbol Table
  *  4) create Service Info parsing the Symbol table
- *  5) create WebServiceContext using above three classes and start execution 
- * 
+ *  5) create WebServiceContext using above three classes and start execution
+ *
  * @author hemapani@opensource.lk
  */
 public class WSDL2Ws {
@@ -87,7 +87,7 @@
     private ServiceEntry serviceentry;
     private BindingEntry bindingEntry;
     private PortTypeEntry portTypeEntry;
-	private ArrayList methods;	
+        private ArrayList methods;
 
     public WSDL2Ws(CLArgParser cmdLineArgs) throws WrapperFault {
         try {
@@ -99,40 +99,40 @@
             symbolTable = wsdlParser.getSymbolTable();
             
             //get the target namespace
-			targetNameSpaceOfWSDL = symbolTable.getDefinition().getTargetNamespace();
+                        targetNameSpaceOfWSDL = \
symbolTable.getDefinition().getTargetNamespace();  } catch (Exception e) {
             e.printStackTrace();
             throw new WrapperFault(e);
         }
     }
     
-    /** 
-     * this method initailize the serviceEntry portEntry and bindingEntry   
+    /**
+     * this method initailize the serviceEntry portEntry and bindingEntry
      * @throws WrapperFault
      */
     
     public void perprocess()throws WrapperFault{
-		typeMap = new TypeMap(language);
-		this.serviceentry = getServiceEntry();
-		Iterator ports = this.serviceentry.getService().getPorts().values().iterator();
-		
+                typeMap = new TypeMap(language);
+                this.serviceentry = getServiceEntry();
+                Iterator ports = \
this.serviceentry.getService().getPorts().values().iterator(); +                
 //TODO  resolve this
-//		this code support only the service with onebindings it will not care about the
-//		second binding if exists.. if the NO binding specified it will failed
-//		this should be resolved by let user specify which binding to use.
-
-		Binding binding = null;
-		if (ports.hasNext())
-			binding = ((Port) ports.next()).getBinding();
-		if (binding == null)
-			throw new WrapperFault("No binding specified");
-		this.bindingEntry = symbolTable.getBindingEntry(binding.getQName());
-		
-		this.portTypeEntry = \
                symbolTable.getPortTypeEntry(binding.getPortType().getQName());
-		if (portTypeEntry == null)
-			throw new WrapperFault("Service not found");
-		ports = this.serviceentry.getService().getPorts().values().iterator();
-		this.targetEndpointURI = SymbolTableParsingUtils.getTargetEndPointURI(ports);			
+//              this code support only the service with onebindings it will not care \
about the +//              second binding if exists.. if the NO binding specified it \
will failed +//              this should be resolved by let user specify which \
binding to use. +
+                Binding binding = null;
+                if (ports.hasNext())
+                        binding = ((Port) ports.next()).getBinding();
+                if (binding == null)
+                        throw new WrapperFault("No binding specified");
+                this.bindingEntry = symbolTable.getBindingEntry(binding.getQName());
+                
+                this.portTypeEntry = \
symbolTable.getPortTypeEntry(binding.getPortType().getQName()); +                if \
(portTypeEntry == null) +                        throw new WrapperFault("Service not \
found"); +                ports = \
this.serviceentry.getService().getPorts().values().iterator(); +                \
this.targetEndpointURI = SymbolTableParsingUtils.getTargetEndPointURI(ports);  }
     
     
@@ -144,31 +144,31 @@
      */
     private void getWebServiceInfo()
         throws WrapperFault {
-		this.qualifiedServiceName = portTypeEntry.getName();
-		if (this.qualifiedServiceName == null) {
-			qualifiedServiceName = portTypeEntry.getQName().getNamespaceURI();
-			qualifiedServiceName =
-				WrapperUtils.firstCharacterToLowercase(
-					WrapperUtils.nsURI2packageName(qualifiedServiceName))
-					+ "."
-					+ portTypeEntry.getQName().getLocalPart();
-		}
-		
-		//the service style (rpc|doc|msg)
-		this.serviceStyle = bindingEntry.getBindingStyle().getName();
-		//extract the trasport type as a uri
-		this.transportURI = \
SymbolTableParsingUtils.getTransportType(bindingEntry.getBinding()); +                \
this.qualifiedServiceName = portTypeEntry.getName(); +                if \
(this.qualifiedServiceName == null) { +                        qualifiedServiceName = \
portTypeEntry.getQName().getNamespaceURI(); +                        \
qualifiedServiceName = +                                \
WrapperUtils.firstCharacterToLowercase( +                                        \
WrapperUtils.nsURI2packageName(qualifiedServiceName)) +                               \
+ "." +                                        + \
portTypeEntry.getQName().getLocalPart(); +                }
+                
+                //the service style (rpc|doc|msg)
+                this.serviceStyle = bindingEntry.getBindingStyle().getName();
+                //extract the trasport type as a uri
+                this.transportURI = \
                SymbolTableParsingUtils.getTransportType(bindingEntry.getBinding());
         List operations = bindingEntry.getBinding().getBindingOperations();
         if (operations != null) {
 
             for (int i = 0; i < operations.size(); i++) {
                 //for the each binding operation found
                 if (operations.get(i) instanceof javax.wsdl.BindingOperation) {
-                	
-					javax.wsdl.BindingOperation bindinop = (javax.wsdl.BindingOperation) \
                operations.get(i);
-					MethodInfo method = getMethodInfoByName(bindinop.getName());
-					method.setSoapAction(SymbolTableParsingUtils.getSoapAction(bindinop));
-					SymbolTableParsingUtils.getInputInfo(bindinop.getBindingInput(),method);
+                        
+                                        javax.wsdl.BindingOperation bindinop = \
(javax.wsdl.BindingOperation) operations.get(i); +                                    \
MethodInfo method = getMethodInfoByName(bindinop.getName()); +                        \
method.setSoapAction(SymbolTableParsingUtils.getSoapAction(bindinop)); +              \
                SymbolTableParsingUtils.getInputInfo(bindinop.getBindingInput(),method);
                
                     \
SymbolTableParsingUtils.getOutputInfo(bindinop.getBindingOutput(),method);  }
             }
@@ -185,10 +185,10 @@
         Iterator oplist = porttype.getOperations().iterator();
         ArrayList methods = new ArrayList();
         MethodInfo minfo;
-		Element element;
-		QName qname;
+                Element element;
+                QName qname;
         ParameterInfo pinfo;
-		Type type;
+                Type type;
         org.apache.axis.wsdl.symbolTable.Type ptype;
         //for each operation
         while (oplist.hasNext()) {
@@ -201,150 +201,150 @@
             
             //setting the faults
             Map faults = op.getFaults();
-			addFaultInfo(faults,minfo);
+                        addFaultInfo(faults,minfo);
             
             Iterator paramlist = null;
             //add each parameter to parameter list
             if ("document".equals(bindingEntry.getBindingStyle().getName())){
-				paramlist = op.getInput().getMessage().getParts().values().iterator();
-				Part part = (Part) paramlist.next();
-				QName minfoqname;
-				element = symbolTable.getElement(part.getElementName());
-				if ( element == null ) {
-					// the part reference a type.
-					qname =  symbolTable.getType(part.getTypeName()).getQName();
-					minfoqname = symbolTable.getType(part.getTypeName()).getQName();
-				}
-				else {
-					qname = element.getRefType().getQName();
-					minfoqname = element.getQName();
-				}
-				if (qname != null){
-					minfo.setInputMessage(minfoqname);
-					type = this.typeMap.getType(qname);
-					boolean wrapped = true; //TODO take this from a commandline argument
-					if (wrapped){
-						if(type == null)
-							 throw new WrapperFault("unregisterd type "+qname+" refered");
-						else{
-							/* if(type.getLanguageSpecificName().startsWith(">")){*/ //anyway skip the \
                wrapping element type even if it is a named type.
-							//get inner attributes and elements and add them as parameters
-							ArrayList elementlist = new ArrayList();
-							Iterator names = type.getElementnames();
-							while (names.hasNext()){
-								elementlist.add(names.next());
-							}
-							Type innerType;
-							for (int i = 0 ; i < elementlist.size(); i++) {
-								String elementname = (String)elementlist.get(i);
-								innerType = type.getElementForElementName(elementname).getType();
-								pinfo = new ParameterInfo(innerType,elementname);
-								pinfo.setElementName(type.getElementForElementName(elementname).getName());
-								minfo.addInputParameter(pinfo);		
-							}
-							//remove the type that represents the wrapping element so that such type is \
                not created.
-							this.typeMap.removeType(qname);
-						}
-					}
-					else{
-						
-					}
-				}
-	    	}
-    	   	else{
-    	   		if (op.getParameterOrdering() != null){
-	    	   		for (int ix=0; ix < op.getParameterOrdering().size(); ix++){
-						Part p = (Part)(op.getInput().getMessage().getParts().get((String)op.getParameterOrdering().get(ix)));
                
-						if (p == null) continue;
-						pinfo = createParameterInfo(p);
-						if (null != pinfo) minfo.addInputParameter(pinfo);
-	    	   		}
-    	   		}
-    	   		else {
-					paramlist = op.getInput().getMessage().getParts().values().iterator();
-					while (paramlist.hasNext()) { //RPC style messages can have multiple parts
-						Part p = (Part) paramlist.next();
-						pinfo = createParameterInfo(p);
-						if (null != pinfo) minfo.addInputParameter(pinfo);
-					}    	   			
-    	   		}
+                                paramlist = \
op.getInput().getMessage().getParts().values().iterator(); +                          \
Part part = (Part) paramlist.next(); +                                QName \
minfoqname; +                                element = \
symbolTable.getElement(part.getElementName()); +                                if ( \
element == null ) { +                                        // the part reference a \
type. +                                        qname =  \
symbolTable.getType(part.getTypeName()).getQName(); +                                 \
minfoqname = symbolTable.getType(part.getTypeName()).getQName(); +                    \
} +                                else {
+                                        qname = element.getRefType().getQName();
+                                        minfoqname = element.getQName();
+                                }
+                                if (qname != null){
+                                        minfo.setInputMessage(minfoqname);
+                                        type = this.typeMap.getType(qname);
+                                        boolean wrapped = true; //TODO take this \
from a commandline argument +                                        if (wrapped){
+                                                if(type == null)
+                                                         throw new \
WrapperFault("unregisterd type "+qname+" refered"); +                                 \
else{ +                                                        /* \
if(type.getLanguageSpecificName().startsWith(">")){*/ //anyway skip the wrapping \
element type even if it is a named type. +                                            \
//get inner attributes and elements and add them as parameters +                      \
ArrayList elementlist = new ArrayList(); +                                            \
Iterator names = type.getElementnames(); +                                            \
while (names.hasNext()){ +                                                            \
elementlist.add(names.next()); +                                                      \
} +                                                        Type innerType;
+                                                        for (int i = 0 ; i < \
elementlist.size(); i++) { +                                                          \
String elementname = (String)elementlist.get(i); +                                    \
innerType = type.getElementForElementName(elementname).getType(); +                   \
pinfo = new ParameterInfo(innerType,elementname); +                                   \
pinfo.setElementName(type.getElementForElementName(elementname).getName()); +         \
minfo.addInputParameter(pinfo); +                                                     \
} +                                                        //remove the type that \
represents the wrapping element so that such type is not created. +                   \
this.typeMap.removeType(qname); +                                                }
+                                        }
+                                        else{
+                                                
+                                        }
+                                }
+                }
+                else{
+                        if (op.getParameterOrdering() != null){
+                                for (int ix=0; ix < \
op.getParameterOrdering().size(); ix++){ +                                            \
Part p = (Part)(op.getInput().getMessage().getParts().get((String)op.getParameterOrdering().get(ix)));
 +                                                if (p == null) continue;
+                                                pinfo = createParameterInfo(p);
+                                                if (null != pinfo) \
minfo.addInputParameter(pinfo); +                                }
+                        }
+                        else {
+                                        paramlist = \
op.getInput().getMessage().getParts().values().iterator(); +                          \
while (paramlist.hasNext()) { //RPC style messages can have multiple parts +          \
Part p = (Part) paramlist.next(); +                                                \
pinfo = createParameterInfo(p); +                                                if \
(null != pinfo) minfo.addInputParameter(pinfo); +                                     \
} +                        }
             }
             //get the return type
-			if(op.getOutput()!=null){
-	            Iterator returnlist = \
                op.getOutput().getMessage().getParts().values().iterator();
-				if (returnlist.hasNext() && \
                "document".equals(bindingEntry.getBindingStyle().getName())){
-					Part part = (Part) returnlist.next();
-					QName minfoqname;
-					element = symbolTable.getElement(part.getElementName());
-					if ( element == null ) {
-						// the part reference a type.
-						qname =  symbolTable.getType(part.getTypeName()).getQName();
-						minfoqname = symbolTable.getType(part.getTypeName()).getQName();
-					}
-					else {
-						qname = element.getRefType().getQName();
-						minfoqname = element.getQName();
-					}
-					if (qname != null){
-						minfo.setOutputMessage(minfoqname);
-						type = this.typeMap.getType(qname);				
-						boolean wrapped = true; //TODO take this from a commandline argument
-						if (wrapped){
-							if(type == null)
-								 throw new WrapperFault("unregisterd type "+qname+" refered");
-							else{
-								/*if(type.getLanguageSpecificName().startsWith(">")){*///anyway skip the \
                wrapping element type even if it is a named type.
-								//get inner attributes and elements and add them as parameters 
-								ArrayList elementlist = new ArrayList();
-								Iterator names = type.getElementnames();
-								while (names.hasNext()){
-									elementlist.add(names.next());
-								}
-								Type innerType;
-								for (int i = 0 ; i < elementlist.size(); i++) {
-									String elementname = (String)elementlist.get(i);
-									innerType = type.getElementForElementName(elementname).getType();
-									pinfo = new ParameterInfo(innerType,elementname);
-									pinfo.setElementName(type.getElementForElementName(elementname).getName());
-									minfo.addOutputParameter(pinfo);		
-								}							
-								pinfo = new ParameterInfo(type,part.getName());
-								pinfo.setElementName(part.getElementName());
-								//remove the type that represents the wrapping element so that such type is \
                not created.							
-								this.typeMap.removeType(qname);
-							}
-						}
-						else{
-						}
-					}
-				}
-				else{
-					if (op.getParameterOrdering() != null){
-						for (int ix=0; ix < op.getParameterOrdering().size(); ix++){
-							Part p = (Part)(op.getOutput().getMessage().getParts().get((String)op.getParameterOrdering().get(ix)));
                
-							if (p == null) continue;
-							pinfo = createParameterInfo(p);
-							if (null != pinfo) minfo.addOutputParameter(pinfo);
-						}
-						/* there can be more output parameters than in parameterOrder list (partial \
                parameter ordering) */
-						returnlist = op.getOutput().getMessage().getParts().values().iterator();
-						while (returnlist.hasNext()) { //RPC style messages can have multiple parts
-							Part p = (Part) returnlist.next();
-							if (op.getParameterOrdering().contains(p.getName())) continue;
-							pinfo = createParameterInfo(p);
-							if (null != pinfo) minfo.addOutputParameter(pinfo);
-						}    	   				    	   			
-					}
-					else {
-						returnlist = op.getOutput().getMessage().getParts().values().iterator();
-						while (returnlist.hasNext()) { //RPC style messages can have multiple parts
-							Part p = ((Part) returnlist.next());
-							pinfo = createParameterInfo(p);
-							if (null != pinfo) minfo.addOutputParameter(pinfo);
-						}
-					}
-				}
-			}
+                        if(op.getOutput()!=null){
+                    Iterator returnlist = \
op.getOutput().getMessage().getParts().values().iterator(); +                         \
if (returnlist.hasNext() && \
"document".equals(bindingEntry.getBindingStyle().getName())){ +                       \
Part part = (Part) returnlist.next(); +                                        QName \
minfoqname; +                                        element = \
symbolTable.getElement(part.getElementName()); +                                      \
if ( element == null ) { +                                                // the part \
reference a type. +                                                qname =  \
symbolTable.getType(part.getTypeName()).getQName(); +                                 \
minfoqname = symbolTable.getType(part.getTypeName()).getQName(); +                    \
} +                                        else {
+                                                qname = \
element.getRefType().getQName(); +                                                \
minfoqname = element.getQName(); +                                        }
+                                        if (qname != null){
+                                                minfo.setOutputMessage(minfoqname);
+                                                type = this.typeMap.getType(qname);
+                                                boolean wrapped = true; //TODO take \
this from a commandline argument +                                                if \
(wrapped){ +                                                        if(type == null)
+                                                                 throw new \
WrapperFault("unregisterd type "+qname+" refered"); +                                 \
else{ +                                                                \
/*if(type.getLanguageSpecificName().startsWith(">")){*///anyway skip the wrapping \
element type even if it is a named type. +                                            \
//get inner attributes and elements and add them as parameters +                      \
ArrayList elementlist = new ArrayList(); +                                            \
Iterator names = type.getElementnames(); +                                            \
while (names.hasNext()){ +                                                            \
elementlist.add(names.next()); +                                                      \
} +                                                                Type innerType;
+                                                                for (int i = 0 ; i < \
elementlist.size(); i++) { +                                                          \
String elementname = (String)elementlist.get(i); +                                    \
innerType = type.getElementForElementName(elementname).getType(); +                   \
pinfo = new ParameterInfo(innerType,elementname); +                                   \
pinfo.setElementName(type.getElementForElementName(elementname).getName()); +         \
minfo.addOutputParameter(pinfo); +                                                    \
} +                                                                pinfo = new \
ParameterInfo(type,part.getName()); +                                                 \
pinfo.setElementName(part.getElementName()); +                                        \
//remove the type that represents the wrapping element so that such type is not \
created. +                                                                \
this.typeMap.removeType(qname); +                                                     \
} +                                                }
+                                                else{
+                                                }
+                                        }
+                                }
+                                else{
+                                        if (op.getParameterOrdering() != null){
+                                                for (int ix=0; ix < \
op.getParameterOrdering().size(); ix++){ +                                            \
Part p = (Part)(op.getOutput().getMessage().getParts().get((String)op.getParameterOrdering().get(ix)));
 +                                                        if (p == null) continue;
+                                                        pinfo = \
createParameterInfo(p); +                                                        if \
(null != pinfo) minfo.addOutputParameter(pinfo); +                                    \
} +                                                /* there can be more output \
parameters than in parameterOrder list (partial parameter ordering) */ +              \
returnlist = op.getOutput().getMessage().getParts().values().iterator(); +            \
while (returnlist.hasNext()) { //RPC style messages can have multiple parts +         \
Part p = (Part) returnlist.next(); +                                                  \
if (op.getParameterOrdering().contains(p.getName())) continue; +                      \
pinfo = createParameterInfo(p); +                                                     \
if (null != pinfo) minfo.addOutputParameter(pinfo); +                                 \
} +                                        }
+                                        else {
+                                                returnlist = \
op.getOutput().getMessage().getParts().values().iterator(); +                         \
while (returnlist.hasNext()) { //RPC style messages can have multiple parts +         \
Part p = ((Part) returnlist.next()); +                                                \
pinfo = createParameterInfo(p); +                                                     \
if (null != pinfo) minfo.addOutputParameter(pinfo); +                                 \
} +                                        }
+                                }
+                        }
         }
         return methods;
     }
@@ -364,7 +364,7 @@
             type = (TypeEntry) it.next();
             Node node = type.getNode();
             if (node != null) {
-					createTypeInfo(type,targetLanguage);
+                                        createTypeInfo(type,targetLanguage);
 
             }
         } //end of type while
@@ -379,21 +379,21 @@
         String targetEngine,
         String security)
         throws WrapperFault {
-        	
-		if (targetLanguage == null) targetLanguage = "c++";
-		if (targetEngine == null) targetEngine = "server";
-		if (targetoutputLocation == null) targetoutputLocation = "./";
-		this.language = targetLanguage;
-		
-		perprocess();
-		
-		QName serviceqname = serviceentry.getService().getQName();
-		servicename = serviceqname.getLocalPart();
-		typeMap = this.getTypeInfo(targetLanguage);
+                
+                if (targetLanguage == null) targetLanguage = "c++";
+                if (targetEngine == null) targetEngine = "server";
+                if (targetoutputLocation == null) targetoutputLocation = "./";
+                this.language = targetLanguage;
+                
+                perprocess();
+                
+                QName serviceqname = serviceentry.getService().getQName();
+                servicename = serviceqname.getLocalPart();
+                typeMap = this.getTypeInfo(targetLanguage);
         methods = this.getServiceInfo(this.portTypeEntry.getPortType());
         this.getWebServiceInfo();
         
-        //TODO	chaeck weather the name at the WrapperConstant Doclit is right "doc"
+        //TODO  chaeck weather the name at the WrapperConstant Doclit is right "doc"
 
         WebServiceGenarator wsg =
             WebServiceGenaratorFactory.createWebServiceGenarator(
@@ -413,48 +413,48 @@
         if (wsg == null)
             throw new WrapperFault("does not support the option combination");
         if(verbose){
-        	Iterator it = typeMap.getTypes().iterator();
-        	while(it.hasNext()){
-        		System.out.println(it.next());
-        	}
-        }    
- 		wsg.genarate();
+                Iterator it = typeMap.getTypes().iterator();
+                while(it.hasNext()){
+                        System.out.println(it.next());
+                }
+        }
+                wsg.genarate();
     }
     
     /**
      * This code is taken from the org.apache.axis.wsdl.gen.Parser Class.
-     * WSDL file should have only one service, The first service 
+     * WSDL file should have only one service, The first service
      * find is utilized.
      * @return
      * @throws WrapperFault
      */
     public ServiceEntry getServiceEntry()throws WrapperFault{
-		Iterator it = symbolTable.getHashMap().values().iterator();
-		 while (it.hasNext()) {
-			Vector v = (Vector) it.next();
-			  for (int i = 0; i < v.size(); ++i) {
-				  SymTabEntry entry = (SymTabEntry) v.elementAt(i);
+                Iterator it = symbolTable.getHashMap().values().iterator();
+                 while (it.hasNext()) {
+                        Vector v = (Vector) it.next();
+                          for (int i = 0; i < v.size(); ++i) {
+                                  SymTabEntry entry = (SymTabEntry) v.elementAt(i);
    
-			 if (entry instanceof ServiceEntry) {
-					return (ServiceEntry)entry;
-				 }
-			}
-		 }
-		 throw new WrapperFault("the service does not exists");
+                         if (entry instanceof ServiceEntry) {
+                                        return (ServiceEntry)entry;
+                                 }
+                        }
+                 }
+                 throw new WrapperFault("the service does not exists");
     }
     
-	public Type createTypeInfo(QName typename,String targetLanguage)throws \
                WrapperFault{
-		TypeEntry type = symbolTable.getType(typename);	
-		if(type == null){
-			type = symbolTable.getElement(typename);
-			if(type == null){
-				throw new WrapperFault("["+typename+"]unexpected condition occured " +
-					".. please inform the axis-dev@apache.org mailing list ASAP");
-			}
-			type.getRefType();
-		}
-		return createTypeInfo(type,targetLanguage);
-	}
+        public Type createTypeInfo(QName typename,String targetLanguage)throws \
WrapperFault{ +                TypeEntry type = symbolTable.getType(typename);
+                if(type == null){
+                        type = symbolTable.getElement(typename);
+                        if(type == null){
+                                throw new WrapperFault("["+typename+"]unexpected \
condition occured " + +                                        ".. please inform the \
axis-dev@apache.org mailing list ASAP"); +                        }
+                        type.getRefType();
+                }
+                return createTypeInfo(type,targetLanguage);
+        }
     
     /**
      * This code is borrowd from the JavaBeanWriter#writeFullConstructor().
@@ -463,186 +463,186 @@
      * @return
      */
 
-	public Type createTypeInfo(TypeEntry type,String targetLanguage)throws \
                WrapperFault{
-		if (!type.isReferenced()) return null; //do not add types which are not used in \
                the wsdl
-		if (type instanceof CollectionElement){ //an array
-		}
-		else if (type instanceof DefinedElement){ //skip any wrapping elements where \
                ref=....
-			if (type.getRefType() != null){
-				return createTypeInfo(type.getRefType(), targetLanguage);
-			}
-			return null;
-		}
-		Type typedata = typeMap.getType(type.getQName());		
-		if(typedata!= null){
-			//type is a inbild type or a already created type
-			return typedata;  
-		}
-		System.out.println("############## the type found =" + type.getQName());
-		if (-1 != type.getQName().getLocalPart().indexOf('[')) {/* it seems that this is \
                an array */
-			if (null == type.getRefType())throw new WrapperFault("Array type found without a \
                Ref type");
-			QName qn = type.getRefType().getQName();
-			if (null == qn)throw new WrapperFault("Array type found without a Ref type");
-			if (CUtils.isBasicType(qn)) return null;
-			QName newqn = new QName(type.getQName().getNamespaceURI(), \
                qn.getLocalPart()+"_Array");
-			typedata = new Type(newqn, newqn.getLocalPart(), true, targetLanguage);
-			typeMap.addType(newqn, typedata);
-		}else {
-			typedata = new Type(type.getQName(), type.getQName().getLocalPart(), true, \
                targetLanguage);
-			typeMap.addType(type.getQName(), typedata);
-		}
-			
-		Node node = type.getNode();
-
-		Vector restrictdata = null;
-		if(type.isSimpleType()){
-			restrictdata = CUtils.getRestrictionBaseAndValues(node,symbolTable);
-			if(restrictdata != null)
-				typedata.setRestrictiondata(restrictdata);
-		}else if(type instanceof CollectionType){
-			typedata.setTypeNameForElementName(new ElementInfo(type.getQName(),
-					createTypeInfo(type.getRefType().getQName(),targetLanguage)));
-			typedata.setArray(true);
-		}else{
-			//is this a SOAPEnc array type	
-			QName arrayType =
-				SchemaUtils.getArrayComponentQName(node, new IntHolder(0));
-			if (arrayType != null) {
-				typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
-						createTypeInfo(arrayType,targetLanguage)));
-				typedata.setArray(true);
-			} else if (
-				(arrayType = SchemaUtils.getCollectionComponentQName(node))
-					!= null) {
-				typedata.setTypeNameForElementName(new ElementInfo(new QName("item"),
-						createTypeInfo(arrayType,targetLanguage)));
-				typedata.setArray(true);
-			} 
-			//Note in a array the parameter type is stored as under the name item all the \
                time  
-			else {
-				// get all extended types
-				Vector extendList = new Vector();
-				extendList.add(type);
-				TypeEntry parent = SchemaUtils.getComplexElementExtensionBase(
-														type.getNode(),symbolTable);
-				while(parent != null) {
-					extendList.add(parent);
-					parent = SchemaUtils.getComplexElementExtensionBase(
-												parent.getNode(),symbolTable);
-				}
-		
-				// Now generate a list of names and types starting with
-				// the oldest parent.  (Attrs are considered before elements).
-				for (int i=extendList.size()-1; i >= 0; i--) {
-					TypeEntry te = (TypeEntry) extendList.elementAt(i);
-		
-					
-					//TODO the code require the attributes name at extension base types
-					//different, the WSDL2Ws do not support it having same name at up and below.
-					
-					// The names of the inherited parms are mangled
-					// in case they interfere with local parms.
-					String mangle = "";
-					//if (i > 0) {
-					//	mangle = "_" +
-					//		Utils.xmlNameToJava(te.getQName().getLocalPart()) +
-					//		"_";
-					//}
-					
-					// Process the attributes
-					Vector attributes = SchemaUtils.getContainedAttributeTypes(
-						te.getNode(), symbolTable);
-					if (attributes != null) {
-						for (int j=0; j<attributes.size(); j+=2) {
-							typedata.setTypeForAttributeName(
-								((QName)attributes.get(j + 1)).getLocalPart(),
-							createTypeInfo(((TypeEntry) attributes.get(j)).getQName(),targetLanguage));
-						}
-					}
-					// Process the elements
-					Vector elements = SchemaUtils.getContainedElementDeclarations(
-											te.getNode(), symbolTable);
-					if (elements != null) {
-						for (int j=0; j<elements.size(); j++) {
-							ElementDecl elem = (ElementDecl)elements.get(j);
-							QName typeName = elem.getType().getQName();
-							ElementInfo eleinfo = null;
-							if(typeName.getLocalPart().indexOf('[')>0){
-								String localpart = \
                typeName.getLocalPart().substring(0,typeName.getLocalPart().indexOf('['));
                
-								typeName = new QName(typeName.getNamespaceURI(),localpart);
-								if (CUtils.isBasicType(typeName)){
-									eleinfo = new \
                ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));
-								}
-								else{
-									eleinfo = new \
                ElementInfo(elem.getName(),createTypeInfo(elem.getType(),targetLanguage)); \
                
-								}
-							}
-							else{
-								eleinfo = new \
                ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage));								
                
-							}
-							eleinfo.setMinOccurs(elem.getMinOccrs());
-							eleinfo.setMaxOccurs(elem.getMaxOccurs());
-							typedata.setTypeNameForElementName(eleinfo);
-						}			
-					}
-				}
-			}
-		}	
-		return typedata;
-	}
-
-	private void addFaultInfo(Map faults,MethodInfo methodinfo)throws WrapperFault{
-		if(faults == null)
-			return;
-		Iterator faultIt = faults.values().iterator();
-		while(faultIt.hasNext()){
-			Fault fault = (Fault)faultIt.next();
-			FaultInfo faultinfo = new FaultInfo(fault.getName());
-			Map parts = fault.getMessage().getParts();
-			Iterator partIt = parts.values().iterator();
-			while(partIt.hasNext()){
-				faultinfo.addParam(createParameterInfo((Part)partIt.next()));
-			}			  
-		}	 
-	}
-	
-	private ParameterInfo createParameterInfo(Part part)throws WrapperFault{
-		QName qname = part.getTypeName();
-		if(qname == null){
-			Element element = symbolTable.getElement(part.getElementName());
-			qname = element.getRefType().getQName();
-		}
-		TypeEntry tentry = symbolTable.getType(qname);		
-		Type type = this.typeMap.getType(qname);
-		if(type == null)
-			throw new WrapperFault("unregisterd type "+qname+" refered");
-		ParameterInfo parainfo = 
-			new ParameterInfo(type,part.getName());
-		parainfo.setElementName(part.getElementName());
-		return parainfo;
-	}
-
-	private MethodInfo getMethodInfoByName(String name)throws WrapperFault{
-		for(int i = 0; i < methods.size();i++){
-			if(((MethodInfo)methods.get(i)).getMethodname().equals(name))
-				return (MethodInfo)methods.get(i);
-		}
-		throw new WrapperFault("binding and the port type do not match");
-	}
+        public Type createTypeInfo(TypeEntry type,String targetLanguage)throws \
WrapperFault{ +                if (!type.isReferenced()) return null; //do not add \
types which are not used in the wsdl +                if (type instanceof \
CollectionElement){ //an array +                }
+                else if (type instanceof DefinedElement){ //skip any wrapping \
elements where ref=.... +                        if (type.getRefType() != null){
+                                return createTypeInfo(type.getRefType(), \
targetLanguage); +                        }
+                        return null;
+                }
+                Type typedata = typeMap.getType(type.getQName());
+                if(typedata!= null){
+                        //type is a inbild type or a already created type
+                        return typedata;
+                }
+                System.out.println("############## the type found =" + \
type.getQName()); +                if (-1 != \
type.getQName().getLocalPart().indexOf('[')) {/* it seems that this is an array */ +  \
if (null == type.getRefType())throw new WrapperFault("Array type found without a Ref \
type"); +                        QName qn = type.getRefType().getQName();
+                        if (null == qn)throw new WrapperFault("Array type found \
without a Ref type"); +                        if (CUtils.isBasicType(qn)) return \
null; +                        QName newqn = new \
QName(type.getQName().getNamespaceURI(), qn.getLocalPart()+"_Array"); +               \
typedata = new Type(newqn, newqn.getLocalPart(), true, targetLanguage); +             \
typeMap.addType(newqn, typedata); +                }else {
+                        typedata = new Type(type.getQName(), \
type.getQName().getLocalPart(), true, targetLanguage); +                        \
typeMap.addType(type.getQName(), typedata); +                }
+                        
+                Node node = type.getNode();
+
+                Vector restrictdata = null;
+                if(type.isSimpleType()){
+                        restrictdata = \
CUtils.getRestrictionBaseAndValues(node,symbolTable); +                        \
if(restrictdata != null) +                                \
typedata.setRestrictiondata(restrictdata); +                }else if(type instanceof \
CollectionType){ +                        typedata.setTypeNameForElementName(new \
ElementInfo(type.getQName(), +                                        \
createTypeInfo(type.getRefType().getQName(),targetLanguage))); +                      \
typedata.setArray(true); +                }else{
+                        //is this a SOAPEnc array type
+                        QName arrayType =
+                                SchemaUtils.getArrayComponentQName(node, new \
IntHolder(0),symbolTable); +                        if (arrayType != null) {
+                                typedata.setTypeNameForElementName(new \
ElementInfo(new QName("item"), +                                                \
createTypeInfo(arrayType,targetLanguage))); +                                \
typedata.setArray(true); +                        } else if (
+                                (arrayType = \
SchemaUtils.getCollectionComponentQName(node)) +                                      \
!= null) { +                                typedata.setTypeNameForElementName(new \
ElementInfo(new QName("item"), +                                                \
createTypeInfo(arrayType,targetLanguage))); +                                \
typedata.setArray(true); +                        }
+                        //Note in a array the parameter type is stored as under the \
name item all the time +                        else {
+                                // get all extended types
+                                Vector extendList = new Vector();
+                                extendList.add(type);
+                                TypeEntry parent = \
SchemaUtils.getComplexElementExtensionBase( +                                         \
type.getNode(),symbolTable); +                                while(parent != null) {
+                                        extendList.add(parent);
+                                        parent = \
SchemaUtils.getComplexElementExtensionBase( +                                         \
parent.getNode(),symbolTable); +                                }
+                
+                                // Now generate a list of names and types starting \
with +                                // the oldest parent.  (Attrs are considered \
before elements). +                                for (int i=extendList.size()-1; i \
>= 0; i--) { +                                        TypeEntry te = (TypeEntry) \
> extendList.elementAt(i);
+                
+                                        
+                                        //TODO the code require the attributes name \
at extension base types +                                        //different, the \
WSDL2Ws do not support it having same name at up and below. +                         \
 +                                        // The names of the inherited parms are \
mangled +                                        // in case they interfere with local \
parms. +                                        String mangle = "";
+                                        //if (i > 0) {
+                                        //      mangle = "_" +
+                                        //              \
Utils.xmlNameToJava(te.getQName().getLocalPart()) + +                                 \
//              "_"; +                                        //}
+                                        
+                                        // Process the attributes
+                                        Vector attributes = \
SchemaUtils.getContainedAttributeTypes( +                                             \
te.getNode(), symbolTable); +                                        if (attributes \
!= null) { +                                                for (int j=0; \
j<attributes.size(); j+=2) { +                                                        \
typedata.setTypeForAttributeName( +                                                   \
((QName)attributes.get(j + 1)).getLocalPart(), +                                      \
createTypeInfo(((TypeEntry) attributes.get(j)).getQName(),targetLanguage)); +         \
} +                                        }
+                                        // Process the elements
+                                        Vector elements = \
SchemaUtils.getContainedElementDeclarations( +                                        \
te.getNode(), symbolTable); +                                        if (elements != \
null) { +                                                for (int j=0; \
j<elements.size(); j++) { +                                                        \
ElementDecl elem = (ElementDecl)elements.get(j); +                                    \
QName typeName = elem.getType().getQName(); +                                         \
ElementInfo eleinfo = null; +                                                        \
if(typeName.getLocalPart().indexOf('[')>0){ +                                         \
String localpart = typeName.getLocalPart().substring(0,typeName.getLocalPart().indexOf('['));
 +                                                                typeName = new \
QName(typeName.getNamespaceURI(),localpart); +                                        \
if (CUtils.isBasicType(typeName)){ +                                                  \
eleinfo = new ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage)); +  \
} +                                                                else{
+                                                                        eleinfo = \
new ElementInfo(elem.getName(),createTypeInfo(elem.getType(),targetLanguage)); +      \
} +                                                        }
+                                                        else{
+                                                                eleinfo = new \
ElementInfo(elem.getName(),createTypeInfo(typeName,targetLanguage)); +                \
} +                                                        \
//eleinfo.setMinOccurs(elem.getMinOccrs()); +                                         \
//eleinfo.setMaxOccurs(elem.getMaxOccurs()); +                                        \
typedata.setTypeNameForElementName(eleinfo); +                                        \
} +                                        }
+                                }
+                        }
+                }
+                return typedata;
+        }
+
+        private void addFaultInfo(Map faults,MethodInfo methodinfo)throws \
WrapperFault{ +                if(faults == null)
+                        return;
+                Iterator faultIt = faults.values().iterator();
+                while(faultIt.hasNext()){
+                        Fault fault = (Fault)faultIt.next();
+                        FaultInfo faultinfo = new FaultInfo(fault.getName());
+                        Map parts = fault.getMessage().getParts();
+                        Iterator partIt = parts.values().iterator();
+                        while(partIt.hasNext()){
+                                \
faultinfo.addParam(createParameterInfo((Part)partIt.next())); +                       \
} +                }
+        }
+        
+        private ParameterInfo createParameterInfo(Part part)throws WrapperFault{
+                QName qname = part.getTypeName();
+                if(qname == null){
+                        Element element = \
symbolTable.getElement(part.getElementName()); +                        qname = \
element.getRefType().getQName(); +                }
+                TypeEntry tentry = symbolTable.getType(qname);
+                Type type = this.typeMap.getType(qname);
+                if(type == null)
+                        throw new WrapperFault("unregisterd type "+qname+" \
refered"); +                ParameterInfo parainfo =
+                        new ParameterInfo(type,part.getName());
+                parainfo.setElementName(part.getElementName());
+                return parainfo;
+        }
+
+        private MethodInfo getMethodInfoByName(String name)throws WrapperFault{
+                for(int i = 0; i < methods.size();i++){
+                        \
if(((MethodInfo)methods.get(i)).getMethodname().equals(name)) +                       \
return (MethodInfo)methods.get(i); +                }
+                throw new WrapperFault("binding and the port type do not match");
+        }
 
     /**
      * Usage
      * =====
      * java WSDL2ws <wsdlfile> -<optionChar><value>
-     * 
-     * Options and Values 
+     *
+     * Options and Values
      * ======= === ======
      * -o target output folder
      * -l target language(c|java|c++) default is java
      * --help (later ???? not emplemented)
      * -i implementation style (struct|order|simple) default is struct--- \
                (usergetvalue() with PP or use getTag() ect ....)
-     * -s (client|server|both)  
-     * 
+     * -s (client|server|both)
+     *
      * Note:  PP - pull parser
      * @param args
      * @throws Exception
Index: org/apache/axis/wsdl/wsdl2ws/WrapperFault.java
===================================================================
RCS file: /home/cvspublic/ws-axis/c/src/wsdl/org/apache/axis/wsdl/wsdl2ws/WrapperFault.java,v
 retrieving revision 1.2
diff -u -r1.2 WrapperFault.java
--- org/apache/axis/wsdl/wsdl2ws/WrapperFault.java	9 Apr 2004 08:49:31 -0000	1.2
+++ org/apache/axis/wsdl/wsdl2ws/WrapperFault.java	28 May 2004 16:16:44 -0000
@@ -16,7 +16,7 @@
  
 package org.apache.axis.wsdl.wsdl2ws;
 /**
- * This is specialized exceptions .... do need any optional information to carry .. \
to be decided???  + * This is specialized exceptions .... do need any optional \
                information to carry .. to be decided???
  * @author hemapani
  */
 public class WrapperFault extends Exception {
@@ -28,7 +28,7 @@
     }
 
     public WrapperFault(String message, Throwable cause) {
-        super(message);
+        super(message, cause);
     }
 
     public WrapperFault(Throwable cause) {



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic