return;
}
List typesArray = typesList.getExtensibilityElements();
WSDLExtensibilityElement extensiblityElt;
SchemaTypeSystem sts = null;
Vector xmlObjectsVector= new Vector();
//create the type mapper
JavaTypeMapper mapper = new JavaTypeMapper();
for (int i = 0; i < typesArray.size(); i++) {
extensiblityElt = (WSDLExtensibilityElement) typesArray.get(i);
Schema schema;
if (ExtensionConstants.SCHEMA.equals(extensiblityElt.getType())) {
schema = (Schema) extensiblityElt;
XmlOptions options = new XmlOptions();
options.setLoadAdditionalNamespaces(
configuration.getWom().getNamespaces()); //add the namespaces
Stack importedSchemaStack = schema.getImportedSchemaStack();
//compile these schemas
while (!importedSchemaStack.isEmpty()){
javax.wsdl.extensions.schema.Schema tempSchema = (javax.wsdl.extensions.schema.Schema) importedSchemaStack.pop();
Element element = tempSchema.getElement();
xmlObjectsVector.add(
XmlObject.Factory.parse(
element
,options));
}
}
}
// add the third party schemas
//todo pehaps checking the namespaces would be a good idea to
//make the generated code work efficiently
for (int i = 0; i < additionalSchemas.length; i++) {
xmlObjectsVector.add(XmlObject.Factory.parse(
additionalSchemas[i]
,null));
}
// //////////////////////////////////////////////////////////////////////////
// for (int i = 0; i < xmlObjectsVector.size(); i++) {
// XmlObject xmlObject = (XmlObject) xmlObjectsVector.get(i);
// //System.out.println("xmlObject = " + xmlObject.toString());
// System.out.println("xmlObject = " + xmlObject.getClass().getName());
//
// }
// //System.out.println("xmlObjectsVector = " + xmlObjectsVector);
//////////////////////////////////////////////////////////////////////////
//compile the type system
XmlObject[] objeArray = convertToXMLObjectArray(xmlObjectsVector);
BindingConfig config = new Axis2BindingConfig();
//set the STS name to null. it makes the generated class include a unique (but random) STS name
sts = XmlBeans.compileXmlBeans(null, null,
objeArray,
config, XmlBeans.getContextTypeLoader(),
new Axis2Filer(),
null);
// prune the generated schema type system and add the list of base64 types
FindBase64Types(sts);
//get the schematypes and add the document types to the type mapper
SchemaType[] schemaType = sts.documentTypes();
SchemaType type;
for (int j = 0; j < schemaType.length; j++) {
type = schemaType[j];
mapper.addTypeMapping(type.getDocumentElementName(),
type.getFullJavaName());