Package org.apache.cxf.jaxws

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean


        String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
        // enable the options of stack trace and the exception cause message
        Map<String, Object> properties = new HashMap<String, Object>();
        properties.put("exceptionMessageCauseEnabled", "true");
        properties.put("faultStackTraceEnabled", "true");
        JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
        factory.setAddress(address);
        factory.setServiceBean(implementor);
        factory.setProperties(properties);
        factory.create();
    }
View Full Code Here



    @BeforeClass
    public static void createServers() throws Exception {
        bus = BusFactory.getDefaultBus();
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceBean(new SoapActionGreeterImpl());
        sf.setAddress(add11);
        sf.setBus(bus);
        sf.create();
       
        sf = new JaxWsServerFactoryBean();
        sf.setServiceBean(new SoapActionGreeterImpl());
        sf.setAddress(add12);
        sf.setBus(bus);
        SoapBindingConfiguration config = new SoapBindingConfiguration();
        config.setVersion(Soap12.getInstance());
        sf.setBindingConfig(config);
        sf.create();
    }
View Full Code Here

    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

        return sf.create();
    }

    protected ServerFactoryBean createServiceFactory(Class serviceClass, Object serviceBean, String address,
                                                     QName name, JibxDataBinding 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);
        setupJibxBinding(sf, binding);
        return sf;
    }
View Full Code Here

public class StudentTest extends AbstractAegisTest {

    @Test
    public void testWSDL() throws Exception {
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceClass(StudentService.class);
        sf.setServiceBean(new StudentServiceImpl());
        sf.setAddress("local://StudentService");
        setupAegis(sf);
        Server server = sf.create();
        Document wsdl = getWSDLDocument(server);

        assertValid("//*[@name='string2stringMap']", wsdl);
    }
View Full Code Here

    }

    @Test
    public void testReturnMap() throws Exception {

        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceClass(StudentService.class);
        sf.setServiceBean(new StudentServiceImpl());
        sf.setAddress("local://StudentService");
        setupAegis(sf);
        Server server = sf.create();
        server.start();

        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
        proxyFac.setAddress("local://StudentService");
        proxyFac.setBus(getBus());
View Full Code Here

    }

    @Test
    public void testReturnMapDocLiteral() throws Exception {

        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceClass(StudentServiceDocLiteral.class);
        sf.setServiceBean(new StudentServiceDocLiteralImpl());
        sf.setAddress("local://StudentServiceDocLiteral");
        setupAegis(sf);
        Server server = sf.create();
        server.getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
        server.getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
        server.start();

        JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
View Full Code Here

    public void testPublishedEndpointUrl() throws Exception {
       
        Greeter implementor = new org.apache.hello_world_soap_http.GreeterImpl();
        String publishedEndpointUrl = "http://cxf.apache.org/publishedEndpointUrl";
       
        JaxWsServerFactoryBean svrFactory = new JaxWsServerFactoryBean();
        svrFactory.setServiceClass(Greeter.class);
        svrFactory.setAddress("http://localhost:" + PORT + "/publishedEndpointUrl");
        svrFactory.setPublishedEndpointUrl(publishedEndpointUrl);
        svrFactory.setServiceBean(implementor);
       
        Server server = svrFactory.create();

        WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader();
        wsdlReader.setFeature("javax.wsdl.verbose", false);
       
        URL url = new URL(svrFactory.getAddress() + "?wsdl=1");
        HttpURLConnection connect = (HttpURLConnection)url.openConnection();
        assertEquals(500, connect.getResponseCode());
       
        Definition wsdl = wsdlReader.readWSDL(svrFactory.getAddress() + "?wsdl");
        assertNotNull(wsdl);
       
        Collection<Service> services = CastUtils.cast(wsdl.getAllServices().values());
        final String failMesg = "WSDL provided incorrect soap:address location";
       
View Full Code Here

            serverFactory = (ServerFactoryBean)
                             beanFactory.getBean(prototypeServerFactoryBeanName,
                                                 ServerFactoryBean.class);
            customizedServerFactory = true;
        } else {
            serverFactory = new JaxWsServerFactoryBean();
        }

        serverFactory.setServiceBean(implementor);
        serverFactory.setServiceClass(ClassHelper.getRealClass(implementor));
        serverFactory.setAddress(url);
View Full Code Here

    }
   
    public void setupServer(boolean mtomRequired) throws Exception {
        getBus().getExtension(PolicyEngine.class).setAlternativeSelector(
            new FirstAlternativeSelector());
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.setServiceBean(new EchoService());
        sf.setBus(getBus());
        sf.setAddress(address);
       
        WSPolicyFeature policyFeature = new WSPolicyFeature();
        List<Element> policyElements = new ArrayList<Element>();
        if (mtomRequired) {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy.xml"))
                           .getDocumentElement());
        } else {
            policyElements.add(DOMUtils.readXml(
                getClass().getResourceAsStream("mtom-policy-optional.xml"))
                           .getDocumentElement());
        }
        policyFeature.setPolicyElements(policyElements);      
       
        sf.getFeatures().add(policyFeature);
       
        sf.create();
    }
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.