serviceInfo.addSchema(schemaInfo);
} else {
schema = schemaInfo.getSchema();
}
XmlSchemaComplexType ct = new XmlSchemaComplexType(schema);
ct.setName(part.getElementQName().getLocalPart());
// Before updating everything, make sure we haven't added this
// type yet. Multiple methods that throw the same exception
// types will cause duplicates.
if (schema.getTypeByName(ct.getQName()) != null) {
return;
}
XmlSchemaElement el = new XmlSchemaElement();
XmlSchemaUtils.setElementQName(el, part.getElementQName());
schema.getItems().add(el);
schema.getElements().add(el.getQName(), el);
part.setXmlSchema(el);
schema.getItems().add(ct);
schema.addType(ct);
schemaInfo.setElement(null);
el.setSchemaTypeName(part.getElementQName());
XmlSchemaSequence seq = new XmlSchemaSequence();
ct.setParticle(seq);
String namespace = part.getElementQName().getNamespaceURI();
XmlAccessorType accessorType = cls.getAnnotation(XmlAccessorType.class);
if (accessorType == null && cls.getPackage() != null) {
accessorType = cls.getPackage().getAnnotation(XmlAccessorType.class);