Examples of JaxWsServerFactoryBean


Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    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:9000/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

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

      doInit = false;
    }
  }

  protected void doPublish(String address) {
    JaxWsServerFactoryBean svrFactory = new NoInitJaxWsServerFactoryBean();
    svrFactory.setBus(bus);
    svrFactory.setAddress(address);
    svrFactory.setServiceFactory(serviceFactory);
    svrFactory.setStart(false);
    svrFactory.setServiceBean(implementor);
        svrFactory.setDestinationFactory(httpTransportFactory);

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

    server = svrFactory.create();

    init();

    // todo do we need to call this?
    getEndpoint();
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

        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

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

        protected void run() {
            SpringBusFactory bf = new SpringBusFactory();
            Bus bus = bf.createBus("org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/server.xml");

            JaxWsServerFactoryBean serviceFactory = new JaxWsServerFactoryBean();
            serviceFactory.setBus(bus);
            serviceFactory.setServiceClass(MessageProviderWithAddressingPolicy.class);
            serviceFactory.setWsdlLocation("wsdl_systest_wsspec/addr-jaxwsmm.wsdl");
            serviceFactory.setAddress(ADDRESS);
            org.apache.cxf.endpoint.Server provider = serviceFactory.create();
            EndpointInfo ei = provider.getEndpoint().getEndpointInfo();
            LOG.info("Started server at: " + ei.getAddress());

            testInterceptors(bus);
        }
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    public void setUp() {
        fb = new ServerFactoryBean();
        fb.setAddress("local://localhost");
        fb.setBus(getBus());
       
        jfb = new JaxWsServerFactoryBean();
        jfb.setAddress("local://localhost");
        jfb.setBus(getBus());
    }
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

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    {
        // create new instance of the service implmentation
        EmployeeService impl = new EmployeeServiceImpl(db, conn);

        // construct/configure factory to create our specific service
        svrFactory = new JaxWsServerFactoryBean();
        //svrFactory.getInInterceptors().add(new LoggingInInterceptor());
        //svrFactory.getOutInterceptors().add(new LoggingOutInterceptor());
        // specify our implementation class
        svrFactory.setServiceClass(EmployeeService.class);
        // specify the address
View Full Code Here

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

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    private Server serviceEndpoint;
   
    @Before
    public void setUp() throws Exception {       
        template = context.createProducerTemplate();
        JaxWsServerFactoryBean svrBean = new JaxWsServerFactoryBean();
        svrBean.setAddress("http://localhost:9001/SoapContext/SoapPort");
        svrBean.setServiceClass(Greeter.class);
        svrBean.setServiceBean(new GreeterImpl());
        SpringBusFactory bf = new SpringBusFactory();
        URL cxfConfig = null;

        if (getCxfServerConfig() != null) {
            cxfConfig = ClassLoaderUtils.getResource(getCxfServerConfig(), this.getClass());
        }
        svrBean.setBus(bf.createBus(cxfConfig));
        serviceEndpoint = svrBean.create();

    }
View Full Code Here

Examples of org.apache.cxf.jaxws.JaxWsServerFactoryBean

    protected ServerFactoryBean createServiceFactory(Class serviceClass,
                                                     Object serviceBean,
                                                     String address,
                                                     QName name,
                                                     XmlBeansDataBinding 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);
        setupXmlBeans(sf, binding);
        return sf;
    }
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.