/** Returns the simple schema type from the type name, */ public static QName getSimpleSchemaTypeName(TypeTable typeTable, String typeName) { if (typeName.equals("java.net.URI")) { return new QName(DBConstants.XSD_NAMESPACE, "anyURI"); } if (typeName.equals("java.sql.Struct")) { return new QName(DBConstants.XSD_NAMESPACE, "anyType"); } return typeTable.getSimpleSchemaTypeName(typeName); }
/** * Process the package name to QName mapping: * * <p><packageMapping> <mapping packageName="foo.bar" qname="http://foo/bar/xsd"%gt; * ...... ...... </packageMapping> * * @param packageMappingElement OMElement for the packageMappingElement */ private void processTypeMappings(OMElement packageMappingElement) { Iterator elementItr = packageMappingElement.getChildrenWithName(new QName(TAG_MAPPING)); TypeTable typeTable = service.getTypeTable(); if (typeTable == null) { typeTable = new TypeTable(); } while (elementItr.hasNext()) { OMElement mappingElement = (OMElement) elementItr.next(); String packageName = mappingElement.getAttributeValue(new QName(TAG_PACKAGE_NAME)); String qName = mappingElement.getAttributeValue(new QName(TAG_QNAME)); if (packageName == null || qName == null) { continue; } Iterator keys = service.getNamespaceMap().keySet().iterator(); while (keys.hasNext()) { String key = (String) keys.next(); if (qName.equals(service.getNamespaceMap().get(key))) { typeTable.addComplexSchema(packageName, new QName(qName, packageName, key)); } } } service.setTypeTable(typeTable); }