Package org.apache.cxf.wsdl11

Examples of org.apache.cxf.wsdl11.ResourceManagerWSDLLocator


     * @throws WSDLException
     */
    public Definition getWSDLDefinition(Server server) throws WSDLException {
        Service service = server.getEndpoint().getService();

        ServiceWSDLBuilder wsdlBuilder = new ServiceWSDLBuilder(bus, service.getServiceInfos().get(0));
        wsdlBuilder.setUseSchemaImports(false);
        return wsdlBuilder.build();
    }
View Full Code Here


    public WSDLRefValidator(final String wsdl, final Document doc) {
        this(wsdl, doc, null);
    }

    public WSDLRefValidator(final String wsdl, final Document doc, final Bus b) {
        WSDLDefinitionBuilder wsdlBuilder = new WSDLDefinitionBuilder();
        if (b != null) {
            wsdlBuilder.setBus(b);
        }

        try {
            this.definition = wsdlBuilder.build(wsdl);
            if (wsdlBuilder.getImportedDefinitions().size() > 0) {
                importedDefinitions = new ArrayList<Definition>();
                importedDefinitions.addAll(wsdlBuilder.getImportedDefinitions());
            }
        } catch (Exception e) {
            if (e.getCause() instanceof WSDLException) {
                throw new ToolException(e.getCause().getMessage());
            }
View Full Code Here

            }
        }

        setTransportId(transportId);
       
        WSDLEndpointFactory wsdlEndpointFactory = getWSDLEndpointFactory();
        EndpointInfo ei;
        if (wsdlEndpointFactory != null) {
            ei = wsdlEndpointFactory.createEndpointInfo(service.getServiceInfos().get(0), bindingInfo, null);
            ei.setTransportId(transportId);
        } else {
            ei = new EndpointInfo(service.getServiceInfos().get(0), transportId);
        }
        int count = 1;
        while (service.getEndpointInfo(endpointName) != null) {
            endpointName = new QName(endpointName.getNamespaceURI(),
                                     endpointName.getLocalPart() + count);
            count++;
        }
        ei.setName(endpointName);
        ei.setAddress(getAddress());
        ei.setBinding(bindingInfo);
       
        if (wsdlEndpointFactory != null) {
            wsdlEndpointFactory.createPortExtensors(ei, service);
        }
        service.getServiceInfos().get(0).addEndpoint(ei);
       
        serviceFactory.sendEvent(FactoryBeanListener.Event.ENDPOINTINFO_CREATED, ei);
        return ei;
View Full Code Here

        if (publishedEndpointUrl != null && !"".equals(publishedEndpointUrl)) {
            ei.setProperty("publishedEndpointUrl", publishedEndpointUrl);
        }

        if (destinationFactory instanceof WSDLEndpointFactory) {
            WSDLEndpointFactory we = (WSDLEndpointFactory) destinationFactory;
           
            we.createPortExtensors(ei, service);
        } else {
            // ?
        }
        service.getServiceInfos().get(0).addEndpoint(ei);
        return ei;
View Full Code Here

        if (publishedEndpointUrl != null && !"".equals(publishedEndpointUrl)) {
            ei.setProperty("publishedEndpointUrl", publishedEndpointUrl);
        }

        if (destinationFactory instanceof WSDLEndpointFactory) {
            WSDLEndpointFactory we = (WSDLEndpointFactory) destinationFactory;
           
            we.createPortExtensors(ei, service);
        } else {
            // ?
        }
        service.getServiceInfos().get(0).addEndpoint(ei);
        return ei;
View Full Code Here

   
    protected void common(String wsdl, QName portName, Class... jaxbClasses) throws Exception {
        control = EasyMock.createNiceControl();
       
        bus = control.createMock(Bus.class);
        EasyMock.expect(bus.getExtension(WSDLManager.class)).andStubReturn(new WSDLManagerImpl());
       
        BindingFactoryManager bindingFactoryManager = control.createMock(BindingFactoryManager.class);
        EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andStubReturn(bindingFactoryManager);
        DestinationFactoryManager dfm = control.createMock(DestinationFactoryManager.class);
        EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
View Full Code Here

        extension.registerConduitInitiator("http://schemas.xmlsoap.org/soap/http", localTransport);
        extension.registerConduitInitiator("http://cxf.apache.org/transports/http", localTransport);
        extension.registerConduitInitiator("http://cxf.apache.org/transports/http/configuration",
                                           localTransport);
       
        WSDLManagerImpl manager = new WSDLManagerImpl();
        manager.setBus(bus);
        bus.setExtension(manager, WSDLManager.class);
    }
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

                context.put(Definition.class, definition);

                builder.validate(definition);

                WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
                String serviceName = (String)context.get(ToolConstants.CFG_SERVICENAME);

                if (serviceName != null) {
                    List<ServiceInfo> services = serviceBuilder.buildServices(definition,
                                                                              getServiceQName(definition));
                    serviceList.addAll(services);
                } else if (definition.getServices().size() > 0) {
                    serviceList = serviceBuilder.buildServices(definition);
                } else {
                    serviceList = serviceBuilder.buildMockServices(definition);
                }

            } else {
                // TODO: wsdl2.0 support
            }
View Full Code Here

                    context.put(Definition.class, definition);

                    builder.validate(definition);

                    WSDLServiceBuilder serviceBuilder = new WSDLServiceBuilder(getBus());
                    String serviceName = (String)context.get(ToolConstants.CFG_SERVICENAME);

                    if (serviceName != null) {
                        List<ServiceInfo> services = serviceBuilder
                            .buildServices(definition, getServiceQName(definition));
                        serviceList.addAll(services);
                    } else if (definition.getServices().size() > 0) {
                        serviceList = serviceBuilder.buildServices(definition);
                    } else {
                        serviceList = serviceBuilder.buildMockServices(definition);
                    }

                } else {
                    // TODO: wsdl2.0 support
                }
View Full Code Here

TOP

Related Classes of org.apache.cxf.wsdl11.ResourceManagerWSDLLocator

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.