}
col = new XmlSchemaCollection();
try {
TypeInfo typeInfo = serviceInfo.getTypeInfo();
if (typeInfo == null) {
typeInfo = new TypeInfo(serviceInfo);
serviceInfo.setTypeInfo(typeInfo);
}
for (DOMResult r : generateJaxbSchemas()) {
Document d = (Document)r.getNode();
String ns = d.getDocumentElement().getAttribute("targetNamespace");
if (ns == null) {
ns = "";
}
NodeList nodes = d.getDocumentElement().getChildNodes();
for (int i = 0; i < nodes.getLength(); i++) {
Node n = nodes.item(i);
if (n instanceof Element) {
Element e = (Element) n;
if (e.getLocalName().equals("import")) {
d.getDocumentElement().removeChild(e);
}
}
}
// Don't include WS-Addressing bits
if ("http://www.w3.org/2005/08/addressing/wsdl".equals(ns)) {
continue;
}
SchemaInfo schema = new SchemaInfo(typeInfo, ns);
schema.setElement(d.getDocumentElement());
typeInfo.addSchema(schema);
col.read(d.getDocumentElement());
}
} catch (IOException e) {
throw new ServiceConstructionException(new Message("SCHEMA_GEN_EXC", BUNDLE), e);
}