private final Map<String, SDDocumentSource> wsdls = new HashMap<String, SDDocumentSource>();
public MexEntityResolver(List<? extends Source> wsdls) throws IOException {
Transformer transformer = XmlUtil.newTransformer();
for (Source source : wsdls) {
XMLStreamBufferResult xsbr = new XMLStreamBufferResult();
try {
transformer.transform(source, xsbr);
} catch (TransformerException e) {
throw new WebServiceException(e);
}
String systemId = source.getSystemId();
//TODO: can we do anything if the given mex Source has no systemId?
if(systemId != null){
SDDocumentSource doc = SDDocumentSource.create(JAXWSUtils.getFileOrURL(systemId), xsbr.getXMLStreamBuffer());
this.wsdls.put(systemId, doc);
}
}
}