if (fieldTypeMapBuilt) {
Trc.exit();
return;
}
TypeMapping typeMapping = null;
// Get the TypeMappings from the binding
Iterator bindingIterator =
fieldPortModel.getBinding().getExtensibilityElements().iterator();
/*
* Choose the first typeMap that has encoding=Java|EJB and style=Java.
* Ignore any other typeMap's that have other encodings and styles.
* We allow both encoding="Java" and encoding="EJB" because originally
* WSIF did not check the encoding and our samples assumed Java, whereas
* the tooling assumed EJB, and now because of backwards compatibility
* we end up supporting both.
*/
while (bindingIterator.hasNext()) {
Object next = bindingIterator.next();
if (next instanceof TypeMapping) {
typeMapping = (TypeMapping) next;
if (("Java".equals(typeMapping.getEncoding())
|| "EJB".equals(typeMapping.getEncoding()))
&& "Java".equals(typeMapping.getStyle()))
break;
Trc.event(this, "Silently ignoring typemapping", typeMapping);
typeMapping = null;
}
Trc.event(
this,
"Silently ignoring something that was not a typemapping",
next);
}
if (typeMapping == null) {
QName bindingName = fieldPortModel.getBinding().getQName();
throw new WSIFException(
"Binding "
+ (bindingName == null ? "<null>" : bindingName.toString())
+ " does not contain a typeMap with encoding=Java or encoding=EJB and style=Java");
}
// Build the hashmap
bindingIterator = typeMapping.getMaps().iterator();
while (bindingIterator.hasNext()) {
TypeMap typeMap = (TypeMap) bindingIterator.next();
///////////////////////////////////
QName typeName = typeMap.getTypeName();
if (typeName == null) typeName = typeMap.getElementName();