Author: djencks Date: Sun Feb 27 16:29:31 2005 New Revision: 155653 URL: http://svn.apache.org/viewcvs?view=rev&rev=155653 Log: Add soap-encoding schema to basic type system. Only analyze the schemas in one way. Construct type mapping info for lightweight jaxrpc mappings
Added: geronimo/trunk/modules/axis-builder/src/schema/ geronimo/trunk/modules/axis-builder/src/schema/soap_encoding_1_1.xsd Modified: geronimo/trunk/modules/axis-builder/project.xml geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java Modified: geronimo/trunk/modules/axis-builder/project.xml URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/project.xml?view=diff&r1=155652&r2=155653 ============================================================================== --- geronimo/trunk/modules/axis-builder/project.xml (original) +++ geronimo/trunk/modules/axis-builder/project.xml Sun Feb 27 16:29:31 2005 @@ -236,7 +236,7 @@ <build> <resources> <resource> - <directory>${basedir}/src/etc</directory> + <directory>${basedir}/src/schema</directory> </resource> <resource> <directory>${basedir}/target/xmlbeans</directory> Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&r1=155652&r2=155653 ============================================================================== --- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java (original) +++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java Sun Feb 27 16:29:31 2005 @@ -107,6 +107,7 @@ import org.apache.geronimo.xbeans.j2ee.WsdlReturnValueMappingType; import org.apache.geronimo.xbeans.j2ee.VariableMappingType; import org.apache.xmlbeans.SchemaType; +import org.apache.xmlbeans.SchemaProperty; import org.objectweb.asm.Type; import org.w3.x2001.xmlSchema.ComplexType; import org.w3.x2001.xmlSchema.ExplicitGroup; @@ -222,9 +223,9 @@ Map wsdlPortMap = service.getPorts(); - Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(definition); Map exceptionMap = WSDescriptorParser.getExceptionMap(mapping); Map schemaTypeKeyToSchemaTypeMap = WSDescriptorParser.buildSchemaTypeKeyToSchemaTypeMap(definition); + Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(schemaTypeKeyToSchemaTypeMap); for (Iterator iterator = wsdlPortMap.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); @@ -268,8 +269,9 @@ OperationInfo operationInfo = buildOperationInfoLightweight(method, bindingOperation, portStyle, soapVersion); operationInfos[i++] = operationInfo; } - List typeMappings = Collections.EMPTY_LIST; - Map typeDescriptors = Collections.EMPTY_MAP; + List typeMappings = new ArrayList(); + Map typeDescriptors = new HashMap(); + buildTypeInfoLightWeight(schemaTypeKeyToSchemaTypeMap, mapping, classLoader, typeMappings, typeDescriptors); seiFactory = createSEIFactory(portName, enhancedServiceEndpointClass, serviceImpl, typeMappings, typeDescriptors, location, operationInfos, handlerInfos, context, classLoader); } else { //complete jaxrpc mapping file supplied @@ -296,57 +298,7 @@ JavaXmlTypeMappingType[] javaXmlTypeMappings = mapping.getJavaXmlTypeMappingArray(); List typeMappings = new ArrayList(); Map typeDescriptors = new HashMap(); - for (int j = 0; j < javaXmlTypeMappings.length; j++) { - JavaXmlTypeMappingType javaXmlTypeMapping = javaXmlTypeMappings[j]; - //default settings - Class serializerFactoryClass = BeanSerializerFactory.class; - Class deserializerFactoryClass = BeanDeserializerFactory.class; - - String className = javaXmlTypeMapping.getJavaType().getStringValue().trim(); - - Class clazz = null; - try { - clazz = ClassLoading.loadClass(className, classLoader); - } catch (ClassNotFoundException e) { - throw new DeploymentException("Could not load java type", e); - } - if (clazz.isArray()) { - serializerFactoryClass = ArraySerializerFactory.class; - deserializerFactoryClass = ArrayDeserializerFactory.class; - } - - QName typeName; - SchemaTypeKey key; - TypeMappingInfo typeMappingInfo = null; - boolean isElement = javaXmlTypeMapping.getQnameScope().getStringValue().equals("element"); - boolean isSimpleType = javaXmlTypeMapping.getQnameScope().getStringValue().equals("simpleType"); - if (javaXmlTypeMapping.isSetRootTypeQname()) { - typeName = javaXmlTypeMapping.getRootTypeQname().getQNameValue(); - typeMappingInfo = new TypeMappingInfo(clazz, typeName, serializerFactoryClass, deserializerFactoryClass); - key = new SchemaTypeKey(typeName, isElement, isSimpleType, false); - } else if (javaXmlTypeMapping.isSetAnonymousTypeQname()) { - String anonTypeQNameString = javaXmlTypeMapping.getAnonymousTypeQname().getStringValue(); - int pos = anonTypeQNameString.lastIndexOf(":"); - if (pos == -1) { - throw new DeploymentException("anon QName is invalid, no final ':' " + anonTypeQNameString); - } - //this appears to be ignored... - typeName = new QName(anonTypeQNameString.substring(0, pos), anonTypeQNameString.substring(pos + 1)); - typeMappingInfo = new TypeMappingInfo(clazz, typeName, serializerFactoryClass, deserializerFactoryClass); - key = new SchemaTypeKey(typeName, isElement, isSimpleType, true); - } else { - throw new DeploymentException("either root type qname or anonymous type qname must be set"); - } - typeMappings.add(typeMappingInfo); - SchemaType schemaType = (SchemaType) schemaTypeKeyToSchemaTypeMap.get(key); - if (schemaType == null) { - throw new DeploymentException("Schema type key " + key + " not found in analyzed schema: " + schemaTypeKeyToSchemaTypeMap); - } - TypeDesc typeDesc = getTypeDescriptor(clazz, typeName, javaXmlTypeMapping, schemaType); - typeDescriptors.put(clazz, typeDesc); - - - } + buildTypeInfoHeavyweight(javaXmlTypeMappings, schemaTypeKeyToSchemaTypeMap, classLoader, typeMappings, typeDescriptors); seiFactory = createSEIFactory(portName, enhancedServiceEndpointClass, serviceImpl, typeMappings, typeDescriptors, location, operationInfos, handlerInfos, context, classLoader); } seiPortNameToFactoryMap.put(portName, seiFactory); @@ -354,6 +306,96 @@ } } + private void buildTypeInfoLightWeight(Map schemaTypeKeyToSchemaTypeMap, JavaWsdlMappingType mapping, ClassLoader classLoader, List typeMappings, Map typeDescriptors) throws DeploymentException { + for (Iterator iterator = schemaTypeKeyToSchemaTypeMap.entrySet().iterator(); iterator.hasNext();) { + Map.Entry entry = (Map.Entry) iterator.next(); + SchemaTypeKey key = (SchemaTypeKey) entry.getKey(); +// SchemaType schemaType = (SchemaType) entry.getValue(); + if (!key.isElement() && !key.isAnonymous()) { + //default settings + Class serializerFactoryClass = BeanSerializerFactory.class; + Class deserializerFactoryClass = BeanDeserializerFactory.class; + QName typeQName = key.getqName(); + String namespace = typeQName.getNamespaceURI(); + String packageName = WSDescriptorParser.getPackageFromNamespace(namespace, mapping); + String classShortName = typeQName.getLocalPart(); + String className = packageName + "." + classShortName; + + Class clazz = null; + try { + clazz = ClassLoading.loadClass(className, classLoader); + } catch (ClassNotFoundException e) { + throw new DeploymentException("Could not load java type", e); + } + if (clazz.isArray()) { + serializerFactoryClass = ArraySerializerFactory.class; + deserializerFactoryClass = ArrayDeserializerFactory.class; + } + + TypeMappingInfo typeMappingInfo = new TypeMappingInfo(clazz, typeQName, serializerFactoryClass, deserializerFactoryClass); + typeMappings.add(typeMappingInfo); + //TODO construct typedesc as well. +// TypeDesc typeDesc = getTypeDescriptor(clazz, typeQName, javaXmlTypeMapping, schemaType); +// typeDescriptors.put(clazz, typeDesc); + + } + } + } + + private void buildTypeInfoHeavyweight(JavaXmlTypeMappingType[] javaXmlTypeMappings, Map schemaTypeKeyToSchemaTypeMap, ClassLoader classLoader, List typeMappings, Map typeDescriptors) throws DeploymentException { + for (int j = 0; j < javaXmlTypeMappings.length; j++) { + JavaXmlTypeMappingType javaXmlTypeMapping = javaXmlTypeMappings[j]; + //default settings + Class serializerFactoryClass = BeanSerializerFactory.class; + Class deserializerFactoryClass = BeanDeserializerFactory.class; + + String className = javaXmlTypeMapping.getJavaType().getStringValue().trim(); + + Class clazz = null; + try { + clazz = ClassLoading.loadClass(className, classLoader); + } catch (ClassNotFoundException e) { + throw new DeploymentException("Could not load java type", e); + } + if (clazz.isArray()) { + serializerFactoryClass = ArraySerializerFactory.class; + deserializerFactoryClass = ArrayDeserializerFactory.class; + } + + QName typeName; + SchemaTypeKey key; + TypeMappingInfo typeMappingInfo = null; + boolean isElement = javaXmlTypeMapping.getQnameScope().getStringValue().equals("element"); + boolean isSimpleType = javaXmlTypeMapping.getQnameScope().getStringValue().equals("simpleType"); + if (javaXmlTypeMapping.isSetRootTypeQname()) { + typeName = javaXmlTypeMapping.getRootTypeQname().getQNameValue(); + typeMappingInfo = new TypeMappingInfo(clazz, typeName, serializerFactoryClass, deserializerFactoryClass); + key = new SchemaTypeKey(typeName, isElement, isSimpleType, false); + } else if (javaXmlTypeMapping.isSetAnonymousTypeQname()) { + String anonTypeQNameString = javaXmlTypeMapping.getAnonymousTypeQname().getStringValue(); + int pos = anonTypeQNameString.lastIndexOf(":"); + if (pos == -1) { + throw new DeploymentException("anon QName is invalid, no final ':' " + anonTypeQNameString); + } + //this appears to be ignored... + typeName = new QName(anonTypeQNameString.substring(0, pos), anonTypeQNameString.substring(pos + 1)); + typeMappingInfo = new TypeMappingInfo(clazz, typeName, serializerFactoryClass, deserializerFactoryClass); + key = new SchemaTypeKey(typeName, isElement, isSimpleType, true); + } else { + throw new DeploymentException("either root type qname or anonymous type qname must be set"); + } + typeMappings.add(typeMappingInfo); + SchemaType schemaType = (SchemaType) schemaTypeKeyToSchemaTypeMap.get(key); + if (schemaType == null) { + throw new DeploymentException("Schema type key " + key + " not found in analyzed schema: " + schemaTypeKeyToSchemaTypeMap); + } + TypeDesc typeDesc = getTypeDescriptor(clazz, typeName, javaXmlTypeMapping, schemaType); + typeDescriptors.put(clazz, typeDesc); + + + } + } + private TypeDesc getTypeDescriptor(Class javaClass, QName typeQName, JavaXmlTypeMappingType javaXmlTypeMapping, SchemaType schemaType) throws DeploymentException { boolean isRestriction = schemaType.getDerivationType() == SchemaType.DT_RESTRICTION; TypeDesc typeDesc = new TypeDesc(javaClass, !isRestriction); @@ -784,16 +826,23 @@ if (!isComplex) { throw new DeploymentException("ConstructorParameterOrder can only be set for complex types, not " + faultTypeQName); } - ComplexType complexType = (ComplexType) complexTypeMap.get(faultTypeQName); + SchemaType complexType = (SchemaType) complexTypeMap.get(faultTypeQName); Map elementMap = new HashMap(); - ExplicitGroup explicitGroup = complexType.getSequence(); - LocalElement[] elements = explicitGroup.getElementArray(); - for (int i = 0; i < elements.length; i++) { - LocalElement element = elements[i]; - String elementName = element.getName(); - QName elementType = element.getType(); - elementMap.put(elementName, elementType); - } + SchemaProperty[] properties = complexType.getProperties(); + for (int i = 0; i < properties.length; i++) { + SchemaProperty property = properties[i]; + QName elementName = property.getName(); + SchemaType elementType = property.getType(); + QName elementTypeQName = elementType.getName(); + elementMap.put(elementName.getLocalPart(), elementTypeQName); + } +// LocalElement[] elements = explicitGroup.getElementArray(); +// for (int i = 0; i < elements.length; i++) { +// LocalElement element = elements[i]; +// String elementName = element.getName(); +// QName elementType = element.getType(); +// elementMap.put(elementName, elementType); +// } ArrayList parameterTypes = new ArrayList(); ConstructorParameterOrderType constructorParameterOrder = exceptionMapping.getConstructorParameterOrder(); for (int i = 0; i < constructorParameterOrder.getElementNameArray().length; i++) { Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java?view=diff&r1=155652&r2=155653 ============================================================================== --- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java (original) +++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/WSDescriptorParser.java Sun Feb 27 16:29:31 2005 @@ -102,6 +102,29 @@ */ public class WSDescriptorParser { + private static SchemaTypeSystem basicTypeSystem; + + static { + URL url = WSDescriptorParser.class.getClassLoader().getResource("soap_encoding_1_1.xsd"); + if (url == null) { + throw new RuntimeException("Could not locate soap encoding schema"); + } + Collection errors = new ArrayList(); + XmlOptions xmlOptions = new XmlOptions(); + xmlOptions.setErrorListener(errors); + try { + XmlObject xmlObject = SchemaConversionUtils.parse(url); + basicTypeSystem = XmlBeans.compileXsd(new XmlObject[]{xmlObject}, XmlBeans.getBuiltinTypeSystem(), xmlOptions); + if (errors.size() > 0) { + throw new RuntimeException("Could not compile schema type system: errors: " + errors); + } + } catch (XmlException e) { + throw new RuntimeException("Could not compile schema type system", e); + } catch (IOException e) { + throw new RuntimeException("Could not compile schema type system", e); + } + } + public static Map parseWebServiceDescriptor(URL wsDDUrl, JarFile moduleFile, boolean isEJB) throws DeploymentException { try { WebservicesDocument webservicesDocument = WebservicesDocument.Factory.parse(wsDDUrl); @@ -213,7 +236,7 @@ xmlOptions.setErrorListener(errors); XmlObject[] schemas = (XmlObject[]) schemaList.toArray(new XmlObject[schemaList.size()]); try { - SchemaTypeSystem schemaTypeSystem = XmlBeans.compileXsd(schemas, XmlBeans.getBuiltinTypeSystem(), xmlOptions); + SchemaTypeSystem schemaTypeSystem = XmlBeans.compileXsd(schemas, basicTypeSystem, xmlOptions); if (errors.size() > 0) { throw new DeploymentException("Could not compile schema type system: errors: " + errors); } @@ -243,7 +266,7 @@ Element element = unknownExtensibilityElement.getElement(); String elementNamespace = element.getNamespaceURI(); String elementLocalName = element.getNodeName(); - if ("http://www.w3.org/2001/XMLSchema".equals(elementNamespace) && "schema".equals(elementLocalName)) { + if ("http://www.w3.org/2001/XMLSchema".equals(elementNamespace) && "schema".equals(elementLocalName)) { addSchemaElement(element, namespaceMap, schemaList); } } @@ -397,57 +420,20 @@ } /** - * Find all the top level complex types in the schemas in the definitions' types. + * Find all the complex types in the previously constructed schema analysis. * Put them in a map from complex type QName to schema fragment. - * TODO it is not clear what happens with included schemas. - * - * @param definition + * @param schemaTypeKeyToSchemaTypeMap * @return - * @throws DeploymentException */ - public static Map getComplexTypesInWsdl(Definition definition) throws DeploymentException { + public static Map getComplexTypesInWsdl(Map schemaTypeKeyToSchemaTypeMap) { Map complexTypeMap = new HashMap(); - Types types = definition.getTypes(); - Map namespaceMap = definition.getNamespaces(); - if (types != null) { - List schemas = types.getExtensibilityElements(); - for (Iterator iterator = schemas.iterator(); iterator.hasNext();) { - Object o = iterator.next(); - if (o instanceof Schema) { - Schema unknownExtensibilityElement = (Schema) o; - QName elementType = unknownExtensibilityElement.getElementType(); - if (new QName("http://www.w3.org/2001/XMLSchema", "schema").equals(elementType)) { - Element element = unknownExtensibilityElement.getElement(); - try { - XmlObject xmlObject = SchemaConversionUtils.parse(element); - XmlCursor cursor = xmlObject.newCursor(); - try { - cursor.toFirstContentToken(); - for (Iterator namespaces = namespaceMap.entrySet().iterator(); namespaces.hasNext();) { - Map.Entry entry = (Map.Entry) namespaces.next(); - cursor.insertNamespace((String) entry.getKey(), (String) entry.getValue()); - } - } finally { - cursor.dispose(); - } - SchemaDocument schemaDoc = (SchemaDocument) xmlObject.changeType(SchemaDocument.type); - SchemaConversionUtils.validateDD(schemaDoc); - SchemaDocument.Schema schema = schemaDoc.getSchema(); - String targetNamespace = schema.getTargetNamespace(); - ComplexType[] complexTypes = schema.getComplexTypeArray(); - for (int j = 0; j < complexTypes.length; j++) { - ComplexType complexType = complexTypes[j]; - String complexTypeName = complexType.getName(); - QName complexTypeQName = new QName(targetNamespace, complexTypeName); - complexTypeMap.put(complexTypeQName, complexType); - } - } catch (XmlException e) { - throw new DeploymentException("Invalid schema in wsdl", e); - } - } else { - //problems?? - } - } + for (Iterator iterator = schemaTypeKeyToSchemaTypeMap.entrySet().iterator(); iterator.hasNext();) { + Map.Entry entry = (Map.Entry) iterator.next(); + SchemaTypeKey key = (SchemaTypeKey) entry.getKey(); + if (!key.isSimpleType() && !key.isAnonymous()) { + QName qName = key.getqName(); + SchemaType schemaType = (SchemaType) entry.getValue(); + complexTypeMap.put(qName, schemaType); } } return complexTypeMap; Added: geronimo/trunk/modules/axis-builder/src/schema/soap_encoding_1_1.xsd URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/schema/soap_encoding_1_1.xsd?view=auto&rev=155653 ============================================================================== --- geronimo/trunk/modules/axis-builder/src/schema/soap_encoding_1_1.xsd (added) +++ geronimo/trunk/modules/axis-builder/src/schema/soap_encoding_1_1.xsd Sun Feb 27 16:29:31 2005 @@ -0,0 +1,536 @@ +<?xml version='1.0' encoding='UTF-8' ?> + +<!-- Schema for the SOAP/1.1 encoding + + This schema has been produced using W3C's SOAP Version 1.2 schema + found at: + + http://www.w3.org/2001/06/soap-encoding + + Copyright 2001 Martin Gudgin, Developmentor. + http://www.develop.co.uk + + Changes made are the following: + - reverted namespace to http://schemas.xmlsoap.org/soap/encoding/ + - reverted root to only allow 0 and 1 as lexical values + + Further changes: + + - removed default value from root attribute declaration - 20030314 + + Original copyright: + + Copyright 2001 W3C (Massachusetts Institute of Technology, + Institut National de Recherche en Informatique et en Automatique, + Keio University). All Rights Reserved. + http://www.w3.org/Consortium/Legal/ + + This document is governed by the W3C Software License [1] as + described in the FAQ [2]. + + [1] http://www.w3.org/Consortium/Legal/copyright-software-19980720 + [2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD +--> +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/" + targetNamespace="http://schemas.xmlsoap.org/soap/encoding/" > + + <xs:attribute name="root" > + <xs:annotation> + <xs:documentation> + 'root' can be used to distinguish serialization roots from other + elements that are present in a serialization but are not roots of + a serialized value graph + </xs:documentation> + </xs:annotation> + <xs:simpleType> + <xs:restriction base='xs:boolean'> + <xs:pattern value='0|1' /> + </xs:restriction> + </xs:simpleType> + </xs:attribute> + + <xs:attributeGroup name="commonAttributes" > + <xs:annotation> + <xs:documentation> + Attributes common to all elements that function as accessors or + represent independent (multi-ref) values. The href attribute is + intended to be used in a manner like CONREF. That is, the element + content should be empty iff the href attribute appears + </xs:documentation> + </xs:annotation> + <xs:attribute name="id" type="xs:ID" /> + <xs:attribute name="href" type="xs:anyURI" /> + <xs:anyAttribute namespace="##other" processContents="lax" /> + </xs:attributeGroup> + + <!-- Global Attributes. The following attributes are intended to be usable via qualified attribute names on any complex type referencing them. --> + + <!-- Array attributes. Needed to give the type and dimensions of an array's contents, and the offset for partially-transmitted arrays. --> + + <xs:simpleType name="arrayCoordinate" > + <xs:restriction base="xs:string" /> + </xs:simpleType> + + <xs:attribute name="arrayType" type="xs:string" /> + <xs:attribute name="offset" type="tns:arrayCoordinate" /> + + <xs:attributeGroup name="arrayAttributes" > + <xs:attribute ref="tns:arrayType" /> + <xs:attribute ref="tns:offset" /> + </xs:attributeGroup> + + <xs:attribute name="position" type="tns:arrayCoordinate" /> + + <xs:attributeGroup name="arrayMemberAttributes" > + <xs:attribute ref="tns:position" /> + </xs:attributeGroup> + + <xs:group name="Array" > + <xs:sequence> + <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" /> + </xs:sequence> + </xs:group> + + <xs:element name="Array" type="tns:Array" /> + <xs:complexType name="Array" > + <xs:annotation> + <xs:documentation> + 'Array' is a complex type for accessors identified by position + </xs:documentation> + </xs:annotation> + <xs:group ref="tns:Array" minOccurs="0" /> + <xs:attributeGroup ref="tns:arrayAttributes" /> + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:complexType> + + <!-- 'Struct' is a complex type for accessors identified by name. + Constraint: No element may be have the same name as any other, + nor may any element have a maxOccurs > 1. --> + + <xs:element name="Struct" type="tns:Struct" /> + + <xs:group name="Struct" > + <xs:sequence> + <xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" /> + </xs:sequence> + </xs:group> + + <xs:complexType name="Struct" > + <xs:group ref="tns:Struct" minOccurs="0" /> + <xs:attributeGroup ref="tns:commonAttributes"/> + </xs:complexType> + + <!-- 'Base64' can be used to serialize binary data using base64 encoding + as defined in RFC2045 but without the MIME line length limitation. --> + + <xs:simpleType name="base64" > + <xs:restriction base="xs:base64Binary" /> + </xs:simpleType> + + <!-- Element declarations corresponding to each of the simple types in the + XML Schemas Specification. --> + + <xs:element name="duration" type="tns:duration" /> + <xs:complexType name="duration" > + <xs:simpleContent> + <xs:extension base="xs:duration" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="dateTime" type="tns:dateTime" /> + <xs:complexType name="dateTime" > + <xs:simpleContent> + <xs:extension base="xs:dateTime" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + + + <xs:element name="NOTATION" type="tns:NOTATION" /> + <xs:complexType name="NOTATION" > + <xs:simpleContent> + <xs:extension base="xs:QName" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + + <xs:element name="time" type="tns:time" /> + <xs:complexType name="time" > + <xs:simpleContent> + <xs:extension base="xs:time" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="date" type="tns:date" /> + <xs:complexType name="date" > + <xs:simpleContent> + <xs:extension base="xs:date" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="gYearMonth" type="tns:gYearMonth" /> + <xs:complexType name="gYearMonth" > + <xs:simpleContent> + <xs:extension base="xs:gYearMonth" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="gYear" type="tns:gYear" /> + <xs:complexType name="gYear" > + <xs:simpleContent> + <xs:extension base="xs:gYear" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="gMonthDay" type="tns:gMonthDay" /> + <xs:complexType name="gMonthDay" > + <xs:simpleContent> + <xs:extension base="xs:gMonthDay" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="gDay" type="tns:gDay" /> + <xs:complexType name="gDay" > + <xs:simpleContent> + <xs:extension base="xs:gDay" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="gMonth" type="tns:gMonth" /> + <xs:complexType name="gMonth" > + <xs:simpleContent> + <xs:extension base="xs:gMonth" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="boolean" type="tns:boolean" /> + <xs:complexType name="boolean" > + <xs:simpleContent> + <xs:extension base="xs:boolean" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="base64Binary" type="tns:base64Binary" /> + <xs:complexType name="base64Binary" > + <xs:simpleContent> + <xs:extension base="xs:base64Binary" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="hexBinary" type="tns:hexBinary" /> + <xs:complexType name="hexBinary" > + <xs:simpleContent> + <xs:extension base="xs:hexBinary" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="float" type="tns:float" /> + <xs:complexType name="float" > + <xs:simpleContent> + <xs:extension base="xs:float" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="double" type="tns:double" /> + <xs:complexType name="double" > + <xs:simpleContent> + <xs:extension base="xs:double" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="anyURI" type="tns:anyURI" /> + <xs:complexType name="anyURI" > + <xs:simpleContent> + <xs:extension base="xs:anyURI" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="QName" type="tns:QName" /> + <xs:complexType name="QName" > + <xs:simpleContent> + <xs:extension base="xs:QName" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + + <xs:element name="string" type="tns:string" /> + <xs:complexType name="string" > + <xs:simpleContent> + <xs:extension base="xs:string" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="normalizedString" type="tns:normalizedString" /> + <xs:complexType name="normalizedString" > + <xs:simpleContent> + <xs:extension base="xs:normalizedString" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="token" type="tns:token" /> + <xs:complexType name="token" > + <xs:simpleContent> + <xs:extension base="xs:token" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="language" type="tns:language" /> + <xs:complexType name="language" > + <xs:simpleContent> + <xs:extension base="xs:language" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="Name" type="tns:Name" /> + <xs:complexType name="Name" > + <xs:simpleContent> + <xs:extension base="xs:Name" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="NMTOKEN" type="tns:NMTOKEN" /> + <xs:complexType name="NMTOKEN" > + <xs:simpleContent> + <xs:extension base="xs:NMTOKEN" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="NCName" type="tns:NCName" /> + <xs:complexType name="NCName" > + <xs:simpleContent> + <xs:extension base="xs:NCName" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="NMTOKENS" type="tns:NMTOKENS" /> + <xs:complexType name="NMTOKENS" > + <xs:simpleContent> + <xs:extension base="xs:NMTOKENS" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="ID" type="tns:ID" /> + <xs:complexType name="ID" > + <xs:simpleContent> + <xs:extension base="xs:ID" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="IDREF" type="tns:IDREF" /> + <xs:complexType name="IDREF" > + <xs:simpleContent> + <xs:extension base="xs:IDREF" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="ENTITY" type="tns:ENTITY" /> + <xs:complexType name="ENTITY" > + <xs:simpleContent> + <xs:extension base="xs:ENTITY" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="IDREFS" type="tns:IDREFS" /> + <xs:complexType name="IDREFS" > + <xs:simpleContent> + <xs:extension base="xs:IDREFS" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="ENTITIES" type="tns:ENTITIES" /> + <xs:complexType name="ENTITIES" > + <xs:simpleContent> + <xs:extension base="xs:ENTITIES" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="decimal" type="tns:decimal" /> + <xs:complexType name="decimal" > + <xs:simpleContent> + <xs:extension base="xs:decimal" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="integer" type="tns:integer" /> + <xs:complexType name="integer" > + <xs:simpleContent> + <xs:extension base="xs:integer" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="nonPositiveInteger" type="tns:nonPositiveInteger" /> + <xs:complexType name="nonPositiveInteger" > + <xs:simpleContent> + <xs:extension base="xs:nonPositiveInteger" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="negativeInteger" type="tns:negativeInteger" /> + <xs:complexType name="negativeInteger" > + <xs:simpleContent> + <xs:extension base="xs:negativeInteger" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="long" type="tns:long" /> + <xs:complexType name="long" > + <xs:simpleContent> + <xs:extension base="xs:long" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="int" type="tns:int" /> + <xs:complexType name="int" > + <xs:simpleContent> + <xs:extension base="xs:int" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="short" type="tns:short" /> + <xs:complexType name="short" > + <xs:simpleContent> + <xs:extension base="xs:short" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="byte" type="tns:byte" /> + <xs:complexType name="byte" > + <xs:simpleContent> + <xs:extension base="xs:byte" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="nonNegativeInteger" type="tns:nonNegativeInteger" /> + <xs:complexType name="nonNegativeInteger" > + <xs:simpleContent> + <xs:extension base="xs:nonNegativeInteger" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="unsignedLong" type="tns:unsignedLong" /> + <xs:complexType name="unsignedLong" > + <xs:simpleContent> + <xs:extension base="xs:unsignedLong" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="unsignedInt" type="tns:unsignedInt" /> + <xs:complexType name="unsignedInt" > + <xs:simpleContent> + <xs:extension base="xs:unsignedInt" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="unsignedShort" type="tns:unsignedShort" /> + <xs:complexType name="unsignedShort" > + <xs:simpleContent> + <xs:extension base="xs:unsignedShort" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="unsignedByte" type="tns:unsignedByte" /> + <xs:complexType name="unsignedByte" > + <xs:simpleContent> + <xs:extension base="xs:unsignedByte" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="positiveInteger" type="tns:positiveInteger" /> + <xs:complexType name="positiveInteger" > + <xs:simpleContent> + <xs:extension base="xs:positiveInteger" > + <xs:attributeGroup ref="tns:commonAttributes" /> + </xs:extension> + </xs:simpleContent> + </xs:complexType> + + <xs:element name="anyType" /> +</xs:schema> + Modified: geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?view=diff&r1=155652&r2=155653 ============================================================================== --- geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java (original) +++ geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java Sun Feb 27 16:29:31 2005 @@ -250,7 +250,8 @@ WSDLFactory factory = WSDLFactory.newInstance(); WSDLReader reader = factory.newWSDLReader(); Definition definition = reader.readWSDL(wsdlFile.toURI().toString()); - Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(definition); + Map schemaTypeKeyToSchemaTypeMap = WSDescriptorParser.buildSchemaTypeKeyToSchemaTypeMap(definition); + Map complexTypeMap = WSDescriptorParser.getComplexTypesInWsdl(schemaTypeKeyToSchemaTypeMap); assertEquals(7, complexTypeMap.size()); }