Package org.apache.cxf.jaxws

Examples of org.apache.cxf.jaxws.JaxWsProxyFactoryBean


        server = sf.create();
        //        server.getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
//        server.getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
        server.start();
       
        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setAddress("local://MapTest");
        proxyFac.setServiceClass(MapTest.class);
        proxyFac.setBus(getBus());
        setupAegis(proxyFac.getClientFactoryBean());

        clientInterface = (MapTest)proxyFac.create();
    }
View Full Code Here


        sfbean.setAddress("local://ExceptionServiceJaxWs");
        Server server = sfbean.create();
        Service service = server.getEndpoint().getService();
        service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));

        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setAddress("local://ExceptionServiceJaxWs");
        proxyFac.setServiceClass(ExceptionService.class);
        proxyFac.setBus(getBus());
        proxyFac.getClientFactoryBean().getServiceFactory().setDataBinding(new AegisDatabinding());
        ExceptionService clientInterface = (ExceptionService)proxyFac.create();

        clientInterface.sayHiWithException();
    }
View Full Code Here

        sfbean.setAddress("local://ExceptionService4");
        Server server = sfbean.create();
        Service service = server.getEndpoint().getService();
        service.setInvoker(new BeanInvoker(new ExceptionServiceImpl()));

        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setAddress("local://ExceptionService4");
        proxyFac.setBus(getBus());
        setupAegis(proxyFac.getClientFactoryBean());
        ExceptionService clientInterface = proxyFac.create(ExceptionService.class);

        clientInterface.sayHiWithException();
    }
View Full Code Here

        wsOut.setProperty("password", "myAliasPassword");
        wsOut.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
        service.getOutInterceptors().add(wsOut);

        // Create the client
        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setServiceClass(Echo.class);
        proxyFac.setAddress("local://Echo");
        proxyFac.getClientFactoryBean().setTransportId(LocalTransportFactory.TRANSPORT_ID);
       
        echo = (Echo)proxyFac.create();

        client = ClientProxy.getClient(echo);
        client.getInInterceptors().add(new LoggingInInterceptor());
        client.getInInterceptors().add(wsIn);
        client.getInInterceptors().add(new SAAJInInterceptor());
View Full Code Here

    }
   

    @Test
    public void testEndpoint() throws Exception {
        JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
        pf.setServiceClass(Greeter.class);
        pf.setAddress(add11);
        pf.setBus(bus);
        Greeter greeter = (Greeter) pf.create();
       
        assertEquals("sayHi", greeter.sayHi("test"));
        assertEquals("sayHi2", greeter.sayHi2("test"));       
    }
View Full Code Here

    }
   
    @Test
    public void testSoap12Endpoint() throws Exception {

        JaxWsProxyFactoryBean pf = new JaxWsProxyFactoryBean();
        pf.setServiceClass(Greeter.class);
        pf.setAddress(add12);
        SoapBindingConfiguration config = new SoapBindingConfiguration();
        config.setVersion(Soap12.getInstance());
        pf.setBindingConfig(config);
        pf.setBus(bus);
       
        Greeter greeter = (Greeter) pf.create();
       
        assertEquals("sayHi", greeter.sayHi("test"));
        assertEquals("sayHi2", greeter.sayHi2("test"));
    }
View Full Code Here

        aegisBinding.setMtomEnabled(enableClientMTOM);
        ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
        proxyFac.setDataBinding(aegisBinding);
        proxyFac.setAddress("http://localhost:" + PORT + "/mtom");

        JaxWsProxyFactoryBean jaxwsFac = new JaxWsProxyFactoryBean();
        jaxwsFac.setDataBinding(new AegisDatabinding());
        jaxwsFac.setAddress("http://localhost:" + PORT + "/jaxWsMtom");

        Map<String, Object> props = new HashMap<String, Object>();
        if (enableClientMTOM) {
            props.put("mtom-enabled", Boolean.TRUE);
        }
        proxyFac.setProperties(props);

        client = (org.apache.cxf.systest.aegis.mtom.fortest.MtomTestService)
            proxyFac.create(MtomTestService.class);
        jaxwsClient = jaxwsFac.create(MtomTestService.class);
        impl = (MtomTestImpl)applicationContext.getBean("mtomImpl");
    }
View Full Code Here

    public AegisWSDLNSTest() {
    }
   
    private void setupForTest(boolean specifyWsdl) throws Exception {
       
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(AegisJaxWsWsdlNs.class);
        if (specifyWsdl) {
            factory.setServiceName(new QName("http://v1_1_2.rtf2pdf.doc.ws.daisy.marbes.cz",
                                             "AegisJaxWsWsdlNsImplService"));
            factory.setWsdlLocation("http://localhost:" + PORT + "/aegisJaxWsWSDLNS?wsdl");
        }
        factory.getServiceFactory().setDataBinding(new AegisDatabinding());
        factory.setAddress("http://localhost:" + PORT + "/aegisJaxWsWSDLNS");
        client = (AegisJaxWsWsdlNs)factory.create();
    }
View Full Code Here

        }
        wsOut.setProperty(WSHandlerConstants.PW_CALLBACK_CLASS, TestPwdCallback.class.getName());
        service.getOutInterceptors().add(wsOut);

        // Create the client
        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setServiceClass(Echo.class);
        proxyFac.setAddress("local://Echo");
        proxyFac.getClientFactoryBean().setTransportId(LocalTransportFactory.TRANSPORT_ID);
       
        echo = (Echo)proxyFac.create();

        ((BindingProvider)echo).getRequestContext().put(LocalConduit.DIRECT_DISPATCH, Boolean.TRUE);

       
        client = ClientProxy.getClient(echo);
View Full Code Here

        sf.setAddress("local://StudentService");
        setupAegis(sf);
        Server server = sf.create();
        server.start();

        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setAddress("local://StudentService");
        proxyFac.setBus(getBus());
        setupAegis(proxyFac.getClientFactoryBean());

        StudentService clientInterface = proxyFac.create(StudentService.class);
        Map<Long, Student> fullMap = clientInterface.getStudentsMap();
        assertNotNull(fullMap);
        Student one = fullMap.get(Long.valueOf(1));
        assertNotNull(one);
        assertEquals("Student1", one.getName());
View Full Code Here

TOP

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

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.