schemaInfo = s;
break;
}
}
XmlAccessorOrder xmlAccessorOrder = cls.getAnnotation(XmlAccessorOrder.class);
XmlType xmlTypeAnno = cls.getAnnotation(XmlType.class);
String[] propertyOrder = null;
boolean respectXmlTypeNS = false;
XmlSchema faultBeanSchema = null;
if (xmlTypeAnno != null && !StringUtils.isEmpty(xmlTypeAnno.namespace())
&& !xmlTypeAnno.namespace().equals(part.getElementQName().getNamespaceURI())) {
respectXmlTypeNS = true;
NamespaceMap nsMap = new NamespaceMap();
nsMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, xmlTypeAnno.namespace());
nsMap.add(WSDLConstants.NP_SCHEMA_XSD, WSDLConstants.NS_SCHEMA_XSD);
SchemaInfo faultBeanSchemaInfo = createSchemaIfNeeded(xmlTypeAnno.namespace(), nsMap);
faultBeanSchema = faultBeanSchemaInfo.getSchema();
}
if (xmlTypeAnno != null && xmlTypeAnno.propOrder().length > 0) {
propertyOrder = xmlTypeAnno.propOrder();
//TODO: handle @XmlAccessOrder
}
XmlSchema schema = null;
if (schemaInfo == null) {
NamespaceMap nsMap = new NamespaceMap();
nsMap.add(WSDLConstants.CONVENTIONAL_TNS_PREFIX, part.getElementQName().getNamespaceURI());
nsMap.add(WSDLConstants.NP_SCHEMA_XSD, WSDLConstants.NS_SCHEMA_XSD);
schemaInfo = createSchemaIfNeeded(part.getElementQName().getNamespaceURI(), nsMap);
}
schema = schemaInfo.getSchema();
// Before updating everything, make sure we haven't added this
// type yet. Multiple methods that throw the same exception
// types will cause duplicates.
String faultTypeName = xmlTypeAnno != null && !StringUtils.isEmpty(xmlTypeAnno.name())
? xmlTypeAnno.name() : part.getElementQName().getLocalPart();
XmlSchemaType existingType = schema.getTypeByName(faultTypeName);
if (existingType != null) {
return;
}