Package org.apache.cxf.wsdl

Examples of org.apache.cxf.wsdl.WSDLManager


                service = new ServiceInfo();
                service.setDescription(description);
                description.getDescribed().add(service);
                service.setProperty(WSDL_DEFINITION, def);
                service.setProperty(WSDL_SERVICE, serv);
                WSDLManager wsdlManager = bus.getExtension(WSDLManager.class);
                ServiceSchemaInfo serviceSchemaInfo = null;
                if (wsdlManager != null) {
                    serviceSchemaInfo = wsdlManager.getSchemasForDefinition(def);
                }
               
                if (serviceSchemaInfo != null) {
                    service.setServiceSchemaInfo(serviceSchemaInfo);
                } else {
                    getSchemas(def, service);
                    if (wsdlManager != null) {
                        serviceSchemaInfo = new ServiceSchemaInfo();
                        serviceSchemaInfo.setSchemaCollection(service.getXmlSchemaCollection());
                        serviceSchemaInfo.setSchemaInfoList(service.getSchemas());
                        wsdlManager.putSchemasForDefinition(def, serviceSchemaInfo);
                    }
                }

                service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
                service.setTargetNamespace(def.getTargetNamespace());
View Full Code Here


        String wsdlURL = (String)context.get(ToolConstants.CFG_WSDLURL);
        return build(wsdlURL);
    }

    public Definition build(String wsdlURL) {
        WSDLManager mgr = bus.getExtension(WSDLManager.class);
        registerJaxwsExtension(mgr.getExtensionRegistry());
       
        WSDLDefinitionBuilder builder = new WSDLDefinitionBuilder(this.bus);
        wsdlDefinition = builder.build(wsdlURL);
        mgr.removeDefinition(wsdlDefinition);
        context.put(Bus.class, bus);
        context.put(ToolConstants.IMPORTED_DEFINITION, builder.getImportedDefinitions());
        checkSupported(wsdlDefinition);
        return wsdlDefinition;
    }
View Full Code Here

        Map<String, Element> eleMap = cusParser.getCustomizedWSDLElements();       
        String wsdlUrl = URIParserUtil.getAbsoluteURI((String)context.get(ToolConstants.CFG_WSDLURL));
        CustomizedWSDLLocator wsdlLocator = new CustomizedWSDLLocator(wsdlUrl, eleMap);
        wsdlLocator.setCatalogResolver(OASISCatalogManager.getCatalogManager(bus).getCatalog());
       
        WSDLManager mgr = bus.getExtension(WSDLManager.class);
        WSDLReader reader = mgr.getWSDLFactory().newWSDLReader();
        reader.setFeature("javax.wsdl.verbose", false);
        reader.setExtensionRegistry(mgr.getExtensionRegistry());      

        Definition def = reader.readWSDL(wsdlLocator);
        cataLogResolvedMap.putAll(wsdlLocator.getResolvedMap());
        return def;
View Full Code Here

    @Test
    public void testConstructionWithExtensions() throws BusException {
       
        IMocksControl control;
        BindingFactoryManager bindingFactoryManager;
        WSDLManager wsdlManager;
        InstrumentationManager instrumentationManager;
        PhaseManager phaseManager;
       
        control = EasyMock.createNiceControl();
       
View Full Code Here

    @Test
    public void testConstructionWithExtensions() throws BusException {
       
        IMocksControl control;
        BindingFactoryManager bindingFactoryManager;
        WSDLManager wsdlManager;
        InstrumentationManager instrumentationManager;
        PhaseManager phaseManager;
       
        control = EasyMock.createNiceControl();
       
View Full Code Here

    public void testEmptyWsdlAndNoServiceClass() throws Exception {
        final String dummyWsdl = "target/dummy.wsdl";
        ReflectionServiceFactoryBean bean = new ReflectionServiceFactoryBean();
        Bus bus = control.createMock(Bus.class);
       
        WSDLManager wsdlmanager = control.createMock(WSDLManager.class);
        EasyMock.expect(bus.getExtension(WSDLManager.class)).andReturn(wsdlmanager);
        EasyMock.expect(wsdlmanager.getDefinition(dummyWsdl))
            .andThrow(new WSDLException("PARSER_ERROR", "Problem parsing '" + dummyWsdl + "'."));
        EasyMock.expect(bus.getExtension(FactoryBeanListenerManager.class)).andReturn(null);
       
        control.replay();
       
View Full Code Here

   
    public void testConstructionWithExtensions() throws BusException {
       
        IMocksControl control;
        BindingFactoryManager bindingFactoryManager;
        WSDLManager wsdlManager;
        EventProcessor eventProcessor;
        InstrumentationManager instrumentationManager;
        PhaseManager phaseManager;
       
        control = EasyMock.createNiceControl();
View Full Code Here

    @BeforeClass
    public static void oneTimeSetUp() throws Exception {
       
        IMocksControl control = EasyMock.createNiceControl();
        Bus bus = control.createMock(Bus.class);
        WSDLManager manager = new WSDLManagerImpl();      
        WSDLServiceBuilder builder = new WSDLServiceBuilder(bus);
        DestinationFactoryManager dfm = control.createMock(DestinationFactoryManager.class);
        EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andReturn(dfm).anyTimes();
        EasyMock.expect(dfm.getDestinationFactory(EasyMock.isA(String.class))).andReturn(null).anyTimes();
        BindingFactoryManager bfm = control.createMock(BindingFactoryManager.class);
        EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bfm).anyTimes();
        EasyMock.expect(bfm.getBindingFactory(EasyMock.isA(String.class))).andReturn(null).anyTimes();
        control.replay();
       
        int n = 19;
        services = new ServiceInfo[n];
        endpoints = new EndpointInfo[n];
        for (int i = 0; i < n; i++) {
            String resourceName = "/attachment/wsdl11/test" + i + ".wsdl";
            URL url = Wsdl11AttachmentPolicyProviderTest.class.getResource(resourceName);      
            try {
                services[i] = builder.buildServices(manager.getDefinition(url)).get(0);
            } catch (WSDLException ex) {
                ex.printStackTrace();
                fail("Failed to build service from resource " + resourceName);
            }
            assertNotNull(services[i]);
View Full Code Here

        service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);

        buildInterface(service, p);

        WSDLManager wsdlManager = bus.getExtension(WSDLManager.class);
        if (wsdlManager != null) {
            ServiceSchemaInfo serviceSchemaInfo = new ServiceSchemaInfo();
            serviceSchemaInfo.setSchemaCollection(service.getXmlSchemaCollection());
            serviceSchemaInfo.setSchemaInfoList(service.getSchemas());
            wsdlManager.putSchemasForDefinition(def, serviceSchemaInfo);
        }
        return service;
    }
View Full Code Here

                service = new ServiceInfo();
                service.setDescription(description);
                description.getDescribed().add(service);
                service.setProperty(WSDL_DEFINITION, def);
                service.setProperty(WSDL_SERVICE, serv);
                WSDLManager wsdlManager = bus.getExtension(WSDLManager.class);
                ServiceSchemaInfo serviceSchemaInfo = null;
                if (wsdlManager != null) {
                    serviceSchemaInfo = wsdlManager.getSchemasForDefinition(def);
                }
               
                if (serviceSchemaInfo != null) {
                    service.setServiceSchemaInfo(serviceSchemaInfo);
                } else {
                    getSchemas(def, service);
                    if (wsdlManager != null) {
                        serviceSchemaInfo = new ServiceSchemaInfo();
                        serviceSchemaInfo.setSchemaCollection(service.getXmlSchemaCollection());
                        serviceSchemaInfo.setSchemaInfoList(service.getSchemas());
                        wsdlManager.putSchemasForDefinition(def, serviceSchemaInfo);
                    }
                }

                service.setProperty(WSDL_SCHEMA_ELEMENT_LIST, this.schemaList);
                service.setTargetNamespace(def.getTargetNamespace());
View Full Code Here

TOP

Related Classes of org.apache.cxf.wsdl.WSDLManager

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.