Examples of JaxWsServerFactoryBean


Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    private Client client;

    public void setUpService(String expectedRoles,
                             boolean digest,
                             boolean encryptUsernameTokenOnly) throws Exception {
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setServiceBean(new EchoImpl());
        factory.setAddress("local://Echo");
        factory.setTransportId(LocalTransportFactory.TRANSPORT_ID);
        Server server = factory.create();
        Service service = server.getEndpoint().getService();
       
        service.getInInterceptors().add(new SAAJInInterceptor());
        service.getInInterceptors().add(new LoggingInInterceptor());
        service.getOutInterceptors().add(new SAAJOutInterceptor());
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

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();
        f.getUriPrefixes().add("http");
        f.setTransportIds(tp);       
       
        Server s = factory.create();

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

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

        }
    }
    @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();
        f.getUriPrefixes().add("http");
        f.setTransportIds(tp);
       
       
        Server s = factory.create();

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

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    private static final String SERVICE_ADDRESS = "jms:queue:test.cxf.jmstransport.queue3?receivetTimeOut=5000";

    @BeforeClass
    public static void startServer() {
        startBusAndJMS(JavaFirstNoWsdlTest.class);
        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setBus(bus);
        svrFactory.getFeatures().add(cff);
        svrFactory.setServiceClass(Hello.class);
        svrFactory.setAddress(SERVICE_ADDRESS);
        svrFactory.setTransportId(JMSSpecConstants.SOAP_JMS_SPECIFICATION_TRANSPORTID);
        svrFactory.setServiceBean(new HelloImpl());
        svrFactory.create();
    }
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

        if (cls == null) {
            ObjectHelper.notNull(portName, "Please provide endpoint/port name");
            ObjectHelper.notNull(serviceName, "Please provide service name");
            answer = new ServerFactoryBean(new WSDLServiceFactoryBean());
        } else if (CxfEndpointUtils.hasWebServiceAnnotation(cls)) {
            answer = new JaxWsServerFactoryBean();
        } else {
            answer = new ServerFactoryBean();
        }
       
        // setup server factory bean
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

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();
        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

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    private Client client;

    public void setUpService(String expectedRoles,
                             boolean digest,
                             boolean encryptUsernameTokenOnly) throws Exception {
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setServiceBean(new EchoImpl());
        factory.setAddress("local://Echo");
        factory.setTransportId(LocalTransportFactory.TRANSPORT_ID);
        Server server = factory.create();
        Service service = server.getEndpoint().getService();
       
        service.getInInterceptors().add(new SAAJInInterceptor());
        service.getInInterceptors().add(new LoggingInInterceptor());
        service.getOutInterceptors().add(new SAAJOutInterceptor());
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

        }
       
        // create server bean factory
        ServerFactoryBean factory = null;
        if (serviceClass != null && EndpointUtils.hasWebServiceAnnotation(serviceClass)) {
            factory = new JaxWsServerFactoryBean();
        } else {
            factory = new ServerFactoryBean();
        }
       
        if (serviceClass != null) {
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    }

    // Isolated so that it can be substituted for testing
    ServerFactoryBean createServerFactoryBean(String frontEndImpl) {
      if("jaxws".equals(frontEndImpl)) {
        return new JaxWsServerFactoryBean();
      } else {
        return new ServerFactoryBean();
      }
    }
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    @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
TOP
Copyright © 2018 www.massapi.com. 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.