Package org.apache.cxf.jaxws

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean


                serverFactory = new ServerFactoryBean();
                serverFactory.setServiceFactory(new WSDLSoapServiceFactoryBean());

            } else {
                boolean isJSR181SEnabled = CxfEndpointUtils.hasWebServiceAnnotation(cls);
                serverFactory = isJSR181SEnabled ? new JaxWsServerFactoryBean()
                            : new ServerFactoryBean();
            }
            return serverFactory;
        } catch (Exception e) {
            throw new CamelException(e);
View Full Code Here


        } else {
            throw new JSDOMProviderException(ILLEGAL_INVOKE_TYPE);
        }
       
        Bus bus = BusFactory.getThreadDefaultBus();
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setWsdlLocation(wsdlLoc);
        factory.setBindingId(binding);
        factory.setServiceName(new QName(tgtNmspc, svcNm));
        factory.setEndpointName(new QName(tgtNmspc, portNm));
        Endpoint ep = new EndpointImpl(bus, this, factory);
        ep.publish(addr);
    }
View Full Code Here

    protected void doPublish(String baseAddress) {
        // XXX: assume port 8080 by default since we don't know the actual port at startup
        String address = (baseAddress == null) ? "http://localhost:8080" : baseAddress;

        JaxWsServerFactoryBean svrFactory = new GeronimoJaxWsServerFactoryBean();
        svrFactory.setBus(bus);
        svrFactory.setAddress(address + this.portInfo.getLocation());
        svrFactory.setServiceFactory(serviceFactory);
        svrFactory.setStart(false);
        svrFactory.setServiceBean(implementor);

        if (HTTPBinding.HTTP_BINDING.equals(implInfo.getBindingType())) {
            svrFactory.setTransportId("http://cxf.apache.org/bindings/xformat");
        }

        server = svrFactory.create();

        init();

        //org.apache.cxf.endpoint.Endpoint endpoint = getEndpoint();
View Full Code Here

    @Test
    public void testServers() throws Exception {
        ClassPathXmlApplicationContext ctx =
            new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/servers.xml"});

        JaxWsServerFactoryBean bean;
        BindingConfiguration bc;
        SoapBindingConfiguration sbc;

        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineSoapBindingRPC");
        assertNotNull(bean);

        bc = bean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        sbc = (SoapBindingConfiguration) bc;
        assertEquals("rpc", sbc.getStyle());

        WSDLQueryHandler handler = new WSDLQueryHandler((Bus)ctx.getBean("cxf"));
        ByteArrayOutputStream bout = new ByteArrayOutputStream();
        handler.writeResponse("http://localhost/test?wsdl", "/test",
                              bean.create().getEndpoint().getEndpointInfo(),
                              bout);
        String wsdl = bout.toString();
        assertTrue(wsdl.contains("name=\"stringArray\""));
        assertTrue(wsdl.contains("name=\"stringArray\""));

        bean = (JaxWsServerFactoryBean) ctx.getBean("simple");
        assertNotNull(bean);

        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineWsdlLocation");
        assertNotNull(bean);
        assertEquals(bean.getWsdlLocation(), "wsdl/hello_world_doc_lit.wsdl");

        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineSoapBinding");
        assertNotNull(bean);

        bc = bean.getBindingConfig();
        assertTrue(bc instanceof SoapBindingConfiguration);
        sbc = (SoapBindingConfiguration) bc;
        assertTrue("Not soap version 1.2: " + sbc.getVersion(),  sbc.getVersion() instanceof Soap12);

        bean = (JaxWsServerFactoryBean) ctx.getBean("inlineDataBinding");
View Full Code Here

public class PolicyAnnotationTest extends Assert {

    @org.junit.Test
    public void testAnnotations() throws Exception {
        Bus bus = BusFactory.getDefaultBus();
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setBus(bus);
        factory.setServiceBean(new TestImpl());
        factory.setStart(false);
        List<String> tp = Arrays.asList(
            "http://schemas.xmlsoap.org/soap/http",
            "http://schemas.xmlsoap.org/wsdl/http/",
            "http://schemas.xmlsoap.org/wsdl/soap/http",
            "http://www.w3.org/2003/05/soap/bindings/HTTP/",
            "http://cxf.apache.org/transports/http/configuration",
            "http://cxf.apache.org/bindings/xformat");
       
        LocalTransportFactory f = new LocalTransportFactory(bus);
        f.getUriPrefixes().add("http");
        f.setTransportIds(tp);
        f.setBus(bus);
        f.register();
       
       
        Server s = factory.create();

        try {
            ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus,
                                                                s.getEndpoint().getService()
                                                                    .getServiceInfos());
View Full Code Here

        }
    }
    @org.junit.Test
    public void testAnnotationsInterfaceAsClass() throws Exception {
        Bus bus = BusFactory.getDefaultBus();
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setBus(bus);
        factory.setServiceBean(new TestImpl());
        factory.setServiceClass(TestInterface.class);
        factory.setStart(false);
        List<String> tp = Arrays.asList(
            "http://schemas.xmlsoap.org/soap/http",
            "http://schemas.xmlsoap.org/wsdl/http/",
            "http://schemas.xmlsoap.org/wsdl/soap/http",
            "http://www.w3.org/2003/05/soap/bindings/HTTP/",
            "http://cxf.apache.org/transports/http/configuration",
            "http://cxf.apache.org/bindings/xformat");
       
        LocalTransportFactory f = new LocalTransportFactory(bus);
        f.getUriPrefixes().add("http");
        f.setTransportIds(tp);
        f.setBus(bus);
        f.register();
       
       
        Server s = factory.create();

        try {
            ServiceWSDLBuilder builder = new ServiceWSDLBuilder(bus,
                                                                s.getEndpoint().getService()
                                                                    .getServiceInfos());
View Full Code Here

    protected ServerFactoryBean createServiceFactory(Class serviceClass,
                                                     Object serviceBean,
                                                     String address,
                                                     QName name,
                                                     SDODataBinding binding) {
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceClass(serviceClass);
        if (serviceBean != null) {
            sf.setServiceBean(serviceBean);
        }   
        sf.getServiceFactory().setServiceName(name);
        sf.setAddress("local://" + address);
        sf.getServiceFactory().setQualifyWrapperSchema(true);
        setupSDO(sf, binding);
        return sf;
    }
View Full Code Here

            + "?jndiInitialContextFactory"
            + "=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
            + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:"
            + EmbeddedJMSBrokerLauncher.PORT;
        Hello implementor = new HelloImpl();
        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setServiceClass(Hello.class);
        svrFactory.setAddress(address);
        svrFactory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
        svrFactory.setServiceBean(implementor);
        svrFactory.create();
    }
View Full Code Here

        if (address == null) {
            address = serviceClass.getSimpleName();
        }
        JaxWsServiceFactoryBean sf = new JaxWsServiceFactoryBean();
        sf.setDataBinding(new AegisDatabinding());
        JaxWsServerFactoryBean serverFactoryBean = new JaxWsServerFactoryBean();
        serverFactoryBean.setServiceClass(serviceClass);
       
        if (serviceBean != null) {
            serverFactoryBean.setServiceBean(serviceBean);
        }

        serverFactoryBean.setAddress("local://" + address);
           
        serverFactoryBean.setServiceFactory(sf);
        if (name != null) {
            serverFactoryBean.setEndpointName(name);
        }
        return serverFactoryBean.create();
    }
View Full Code Here

*/
public class AegisJaxwsGetTest extends AbstractCXFTest {
   
    @Before
    public void before() throws Exception {
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setAddress("http://localhost:9167/Echo");
        sf.setDataBinding(new AegisDatabinding());
        sf.setServiceBean(new Echo());
        Server server = sf.create();
        // turn off nanny in URIMappingInterceptor
        server.getEndpoint()
            .getService().put(AbstractInDatabindingInterceptor.NO_VALIDATE_PARTS, Boolean.TRUE);
       
        ServerFactoryBean sf2 = new ServerFactoryBean();
View Full Code Here

TOP

Related Classes of org.apache.cxf.jaxws.JaxWsServerFactoryBean

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.