JavaXmlTypeMappingType[] javaXmlTypeMappings = mapping.getJavaXmlTypeMappingArray();
for (int j = 0; j < javaXmlTypeMappings.length; j++) {
JavaXmlTypeMappingType javaXmlTypeMapping = javaXmlTypeMappings[j];
SchemaTypeKey key;
boolean isElement = javaXmlTypeMapping.getQnameScope().getStringValue().equals("element");
boolean isSimpleType = javaXmlTypeMapping.getQnameScope().getStringValue().equals("simpleType");
if (javaXmlTypeMapping.isSetRootTypeQname()) {
QName typeQName = javaXmlTypeMapping.getRootTypeQname().getQNameValue();
key = new SchemaTypeKey(typeQName, isElement, isSimpleType, false, null);
// Skip the wrapper elements.
if (wrapperElementQNames.contains(typeQName)) {
continue;
}
} 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...
QName typeQName = new QName(anonTypeQNameString.substring(0, pos), anonTypeQNameString.substring(pos + 1));
key = new SchemaTypeKey(typeQName, isElement, isSimpleType, true, null);
// Skip the wrapper elements.
if (wrapperElementQNames.contains(new QName(anonTypeQNameString.substring(0, pos), anonTypeQNameString.substring(pos + 2)))) {
continue;
}
} else {
throw new DeploymentException("either root type qname or anonymous type qname must be set");
}
SchemaType schemaType = (SchemaType) schemaTypeKeyToSchemaTypeMap.get(key);
if (schemaType == null) {
// if it is a built-in type, then one assumes a redundant mapping.
if (null != TypeMappingLookup.getFactoryPair(key.getqName())) {
continue;
}
// throw new DeploymentException("Schema type key " + key + " not found in analyzed schema: " + schemaTypeKeyToSchemaTypeMap);
log.warn("Schema type key " + key + " not found in analyzed schema: " + schemaTypeKeyToSchemaTypeMap);
continue;
}
mappedTypeQNames.add(key.getqName());
String className = javaXmlTypeMapping.getJavaType().getStringValue().trim();
Class clazz = null;
try {
clazz = ClassLoading.loadClass(className, cl);
} catch (ClassNotFoundException e2) {
throw new DeploymentException("Could not load java type", e2);
}
TypeInfo.UpdatableTypeInfo internalTypeInfo = defineSerializerPair(schemaType, clazz);
populateInternalTypeInfo(clazz, key, schemaType, javaXmlTypeMapping, internalTypeInfo);
typeInfoList.add(internalTypeInfo.buildTypeInfo());
}
Map qNameToKey = new HashMap();
for (Iterator iter = schemaTypeKeyToSchemaTypeMap.keySet().iterator(); iter.hasNext();) {
SchemaTypeKey key = (SchemaTypeKey) iter.next();
qNameToKey.put(key.getqName(), key);
}
for (Iterator iter = operations.iterator(); iter.hasNext();) {
OperationDesc operationDesc = (OperationDesc) iter.next();
ArrayList parameters = new ArrayList(operationDesc.getParameters());
ParameterDesc returnParameterDesc = operationDesc.getReturnParamDesc();
if (null != returnParameterDesc.getTypeQName() &&
false == returnParameterDesc.getTypeQName().equals(XMLType.AXIS_VOID)) {
parameters.add(returnParameterDesc);
}
for (Iterator iterator = parameters.iterator(); iterator.hasNext();) {
ParameterDesc parameterDesc = (ParameterDesc) iterator.next();
QName typeQName = parameterDesc.getTypeQName();
if (null == typeQName) {
continue;
} else if (mappedTypeQNames.contains(typeQName)) {
continue;
} else if (typeQName.getNamespaceURI().equals(XML_SCHEMA_NS) ||
typeQName.getNamespaceURI().equals(SOAP_ENCODING_NS)) {
continue;
}
SchemaTypeKey key = (SchemaTypeKey) qNameToKey.get(typeQName);
if (null == key) {
log.warn("Type QName [" + typeQName + "] defined by operation [" +
operationDesc + "] has not been found in schema: " + schemaTypeKeyToSchemaTypeMap);
continue;
}
SchemaType schemaType = (SchemaType) schemaTypeKeyToSchemaTypeMap.get(key);
mappedTypeQNames.add(key.getqName());
if (false == schemaType.isSimpleType()) {
if (false == parameterDesc.getJavaType().isArray()) {
if (false == mappedTypeQNames.contains(schemaType.getName())) {
// TODO: this lookup is not enough: the jaxrpc mapping file may define an anonymous