} else {
// For remote interfaces where the target is represented with WSDL
// the source will have been converted to WSDL so we rely on JAXB mappings
// being the same in both cases and just compare the type names directly.
// TODO - is this right?
XMLType sourceLogicalType = null;
// There is some nesting of data types (when GeneratedDataTypes or arrays are used) so
// dig a bit deeper to find the real data type. Use a loop since for a multidimensional
// array, we might need to go more than one level deep.
while (source.getLogical() instanceof DataType<?>) {
source = (DataType<?>)source.getLogical();
}
sourceLogicalType = (XMLType)source.getLogical();
XMLType targetLogicalType = null;
while (target.getLogical() instanceof DataType<?>) {
target = (DataType<?>)target.getLogical();
}
targetLogicalType = (XMLType)target.getLogical();
// The logical type seems to be null in some cases, e.g. when the
// argument or return type is something like a Map.
// TODO - check when some type give rise to a null logical type
if (sourceLogicalType.getTypeName() == null ||
targetLogicalType.getTypeName() == null) {
return true;
}
boolean match = sourceLogicalType.getTypeName().equals(targetLogicalType.getTypeName());
if (!match){
QName anyType = new QName("http://www.w3.org/2001/XMLSchema", "anyType");
if (sourceLogicalType.getTypeName().equals(anyType) ||
targetLogicalType.getTypeName().equals(anyType)){
// special case where a Java interface uses a generic type, e.g.
// public OMElement getGreetings(OMElement om)
// while the provided WSDL uses a specific type. So we assume
// that xsd:anyType matched anything
match = true;
} else {
if (audit != null){
audit.append("Operation argument types source = " +
sourceLogicalType.getTypeName() +
" target = " +
targetLogicalType.getTypeName() +
" don't match for");
}
}
}