Package org.apache.tuscany.sca.interfacedef.wsdl.xml

Examples of org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver


            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());
View Full Code Here


        factories.addFactory(wsdl4jFactory);
        registry = new WSDLDocumentProcessor(factories);
        resolver = new TestModelResolver();
        URL url = getClass().getResource("../xml/stockquote.wsdl");
        definition = registry.read(null, new URI("stockquote.wsdl"), url);
        WSDLModelResolver wsdlResolver = new WSDLModelResolver(null, factories);
        wsdlResolver.addModel(definition);
        definition = wsdlResolver.resolveModel(WSDLDefinition.class, definition);        portType = definition.getDefinition().getPortType(PORTTYPE_NAME);
    }
View Full Code Here

        factories.addFactory(wsdlFactory);
        javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance();
        factories.addFactory(wsdl4jFactory);
        registry = new WSDLDocumentProcessor(factories);
        resolver = new TestModelResolver();
        wsdlResolver = new WSDLModelResolver(null, factories);
    }
View Full Code Here

        ModelFactoryExtensionPoint factories = new DefaultModelFactoryExtensionPoint();
        factories.addFactory(wsdlFactory);
        javax.wsdl.factory.WSDLFactory wsdl4jFactory = javax.wsdl.factory.WSDLFactory.newInstance();
        factories.addFactory(wsdl4jFactory);
        processor = new WSDLDocumentProcessor(factories);
        wsdlResolver = new WSDLModelResolver(null, factories);
        resolver = new TestModelResolver();
    }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.interfacedef.wsdl.xml.WSDLModelResolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.