Package org.apache.cxf.wsdl11

Examples of org.apache.cxf.wsdl11.ServiceWSDLBuilder


    protected Definition getWSDLDefinition(String string) throws WSDLException {
        ServerRegistry svrMan = getBus().getExtension(ServerRegistry.class);
        for (Server s : svrMan.getServers()) {
            Service svc = s.getEndpoint().getService();
            if (svc.getName().getLocalPart().equals(string)) {
                ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, svc.getServiceInfos());
                return builder.build();
            }
        }
        String localString = "local://" + string;
        for (Server s : svrMan.getServers()) {
            String s2 = s.getDestination().getAddress().getAddress().getValue();
            if (localString.equals(s2)) {
                Service svc = s.getEndpoint().getService();
                ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, svc.getServiceInfos());
                return builder.build();
            }
        }
        return null;
       
    }
View Full Code Here


        svrFactory.create();
       
        Collection<BindingInfo> bindings = service.getServiceInfos().get(0).getBindings();
        assertEquals(1, bindings.size());
       
        ServiceWSDLBuilder wsdlBuilder =
            new ServiceWSDLBuilder(bus, service.getServiceInfos().get(0));
        return wsdlBuilder.build();
    }
View Full Code Here

        Bus bus = getBus();
        bean.setBus(bus);
        bean.setServiceClass(org.apache.cxf.test.TestInterfacePort.class);
        Service service = bean.create();
        ServiceInfo si = service.getServiceInfos().get(0);
        ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus, si);
        Definition def = builder.build();
       
        Document wsdl = WSDLFactory.newInstance().newWSDLWriter().getDocument(def);
        NodeList nodeList = assertValid("/wsdl:definitions/wsdl:types/xsd:schema"
                                        + "[@targetNamespace='http://cxf.apache.org/"
                                        + "org.apache.cxf.test.TestInterface/xsd']"
View Full Code Here

                smp = CastUtils.cast((Map<?, ?>)endpointInfo.getService()
                                    .getProperty(SCHEMAS_KEY));
            }
           
            if (!mp.containsKey("")) {
                ServiceWSDLBuilder builder =
                    new ServiceWSDLBuilder(bus, endpointInfo.getService());

                builder.setUseSchemaImports(
                     MessageUtils.getContextualBoolean(message, WSDL_CREATE_IMPORTS, false));
               
                // base file name is ignored if createSchemaImports == false!
                builder.setBaseFileName(endpointInfo.getService().getName().getLocalPart());
               
                Definition def = builder.build(new HashMap<String, SchemaInfo>());

                mp.put("", def);
                updateDefinition(bus, def, mp, smp, base, endpointInfo, "");
            }
           
View Full Code Here

                smp = CastUtils.cast((Map)endpointInfo.getService()
                                    .getProperty(SCHEMAS_KEY));
            }
           
            if (!mp.containsKey("")) {
                ServiceWSDLBuilder builder =
                    new ServiceWSDLBuilder(bus, endpointInfo.getService());

                builder.setUseSchemaImports(
                     MessageUtils.getContextualBoolean(message, WSDL_CREATE_IMPORTS, false));
               
                // base file name is ignored if createSchemaImports == false!
                builder.setBaseFileName(endpointInfo.getService().getName().getLocalPart());
               
                Definition def = builder.build(new HashMap<String, SchemaInfo>());

                mp.put("", def);
                updateDefinition(bus, def, mp, smp, base, endpointInfo);
            }
           
View Full Code Here

        svrFactory.create();
       
        Collection<BindingInfo> bindings = service.getServiceInfos().get(0).getBindings();
        assertEquals(1, bindings.size());
       
        ServiceWSDLBuilder wsdlBuilder =
            new ServiceWSDLBuilder(bus, service.getServiceInfos().get(0));
        return wsdlBuilder.build();
    }
View Full Code Here

   
    @Test
    public void testDocumentationOnSEI() throws Exception {
        //CXF-3093
        EndpointImpl ep = (EndpointImpl)Endpoint.publish("local://foo", new CXF3093Impl());
        ServiceWSDLBuilder wsdlBuilder =
            new ServiceWSDLBuilder(bus, ep.getService().getServiceInfos().get(0));
        Definition def = wsdlBuilder.build();
        Document d = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter().getDocument(def);
        //org.apache.cxf.helpers.XMLUtils.printDOM(d);
        assertXPathEquals("//wsdl:definitions/wsdl:documentation", "My top level documentation",
                          d.getDocumentElement());
        assertXPathEquals("//wsdl:definitions/wsdl:portType/wsdl:documentation", "My portType documentation",
                          d.getDocumentElement());
        assertXPathEquals("//wsdl:definitions/wsdl:binding/wsdl:documentation", "My binding doc",
                          d.getDocumentElement());
       
       
        JaxwsServiceBuilder builder = new JaxwsServiceBuilder();
        builder.setServiceClass(CXF3093Impl.class);
        ServiceInfo serviceInfo = builder.createService();
        wsdlBuilder = new ServiceWSDLBuilder(bus, serviceInfo);
       
        def = wsdlBuilder.build();
        d = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter().getDocument(def);
        //org.apache.cxf.helpers.XMLUtils.printDOM(d);
        assertXPathEquals("//wsdl:definitions/wsdl:documentation", "My top level documentation",
                          d.getDocumentElement());
        assertXPathEquals("//wsdl:definitions/wsdl:portType/wsdl:documentation", "My portType documentation",
View Full Code Here

   
    @Test
    public void testOnlyRootElementOnFaultBean() throws Exception {
        //CXF-4016
        EndpointImpl ep = (EndpointImpl)Endpoint.publish("local://foo4016", new CXF4016Impl());
        ServiceWSDLBuilder wsdlBuilder =
            new ServiceWSDLBuilder(bus, ep.getService().getServiceInfos().get(0));
        Definition def = wsdlBuilder.build();
        Document d = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter().getDocument(def);
        this.addNamespace("http://www.example.org/contract/DoubleIt", "tns");
        //org.apache.cxf.helpers.XMLUtils.printDOM(d);
        assertValid("//xsd:element[@ref='tns:CustomMessageBean']", d);
    }
View Full Code Here

   
    @Test
    public void testDocumentationOnImpl() throws Exception {
        //CXF-3092
        EndpointImpl ep = (EndpointImpl)Endpoint.publish("local://foo", new CXF3092Impl());
        ServiceWSDLBuilder wsdlBuilder =
            new ServiceWSDLBuilder(bus, ep.getService().getServiceInfos().get(0));
        Definition def = wsdlBuilder.build();
        Document d = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter().getDocument(def);
        //org.apache.cxf.helpers.XMLUtils.printDOM(d);
        assertXPathEquals("//wsdl:definitions/wsdl:documentation", "My top level documentation",
                          d.getDocumentElement());
        assertXPathEquals("//wsdl:definitions/wsdl:service/wsdl:documentation", "My Service documentation",
                          d.getDocumentElement());
        assertXPathEquals("//wsdl:definitions/wsdl:binding/wsdl:documentation", "My binding doc",
                          d.getDocumentElement());
       
        JaxwsServiceBuilder builder = new JaxwsServiceBuilder();
        builder.setServiceClass(CXF3092Impl.class);
        ServiceInfo serviceInfo = builder.createService();
        wsdlBuilder = new ServiceWSDLBuilder(bus, serviceInfo);
       
        def = wsdlBuilder.build();
        d = bus.getExtension(WSDLManager.class).getWSDLFactory().newWSDLWriter().getDocument(def);
        //org.apache.cxf.helpers.XMLUtils.printDOM(d);
        assertXPathEquals("//wsdl:definitions/wsdl:documentation", "My top level documentation",
                          d.getDocumentElement());
        assertXPathEquals("//wsdl:definitions/wsdl:service/wsdl:documentation", "My Service documentation",
View Full Code Here

                                    .getProperty(WSDLQueryHandler.class.getName()
                                                 + ".Schemas"));
            }
           
            if (!mp.containsKey("")) {
                Definition def = new ServiceWSDLBuilder(bus, endpointInfo.getService()).build();
                mp.put("", def);
                updateDefinition(def, mp, smp, base, endpointInfo);
            }
           
           
View Full Code Here

TOP

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

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.