ContributionFactory contributionFactory = modelFactories.getFactory(ContributionFactory.class);
final org.apache.tuscany.sca.contribution.Contribution contribution = contributionFactory.createContribution();
ProcessorContext processorContext = new ProcessorContext();
ExtensibleModelResolver extensibleResolver = new ExtensibleModelResolver(contribution, registry.getExtensionPoint(ModelResolverExtensionPoint.class), modelFactories);
WSDLModelResolver wsdlResolver = (WSDLModelResolver)extensibleResolver.getModelResolverInstance(WSDLDefinition.class);
XSDModelResolver xsdResolver = (XSDModelResolver)extensibleResolver.getModelResolverInstance(XSDefinition.class);
contribution.setURI("temp");
contribution.setLocation(topWSDLLocation);
contribution.setModelResolver(extensibleResolver);
// read
for (XMLString xmlString : xmlMap.values()){
if (xmlString instanceof WSDLInfo){
WSDLReader reader = WSDLFactory.newInstance().newWSDLReader();
reader.setFeature("javax.wsdl.verbose", false);
reader.setFeature("javax.wsdl.importDocuments", true);
WSDLLocatorImpl locator = new WSDLLocatorImpl(xmlString.getBaseURI(), xmlMap);
Definition readDefinition = reader.readWSDL(locator);
wsdlDefinition = wsdlFactory.createWSDLDefinition();
wsdlDefinition.setDefinition(readDefinition);
wsdlDefinition.setLocation(new URI(xmlString.getBaseURI()));
((WSDLInfo)xmlString).setWsdlDefintion(wsdlDefinition);
wsdlResolver.addModel(wsdlDefinition, processorContext);
} else {
InputStream inputStream = new ByteArrayInputStream(xmlString.getXmlString().getBytes());
InputSource inputSource = new InputSource(inputStream);
inputSource.setSystemId(xmlString.getBaseURI());