}
}
javax.xml.stream.XMLOutputFactory fact = javax.xml.stream.XMLOutputFactory.newInstance();
XMLStreamWriter writer =
new PrettyPrintXMLStreamWriter(fact.createXMLStreamWriter(pw), 2, getIndentLevel(parent));
if (namespace != null && !namespace.equals(jaxbNamespace)) {
Map<String, String> outMap = new HashMap<String, String>();
outMap.put("{" + jaxbNamespace + "}*", "{" + namespace + "}*");
writer = new OutTransformWriter(writer,
outMap,
Collections.<String, String>emptyMap(),
Collections.<String>emptyList(),
false,
"");
}
Map<String, String> nspref = new HashMap<String, String>();
for (Object ent : wsdl.getNamespaces().entrySet()) {
Map.Entry<?, ?> entry = (Map.Entry<?, ?>)ent;
nspref.put((String)entry.getValue(), (String)entry.getKey());
}
JAXBUtils.setNamespaceMapper(nspref, u);
u.marshal(mObj, writer);
writer.flush();
} catch (Exception ex) {
throw new WSDLException(WSDLException.PARSER_ERROR,
"",
ex);
}