Package org.apache.hello_world_soap_http

Examples of org.apache.hello_world_soap_http.GreeterImpl


    @Test
    public void testServerFactory() {
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
    
        assert bus != null;
        sf.setServiceBean(new GreeterImpl());
        sf.setAddress("http://localhost:" + PORT + "/test");
        sf.setStart(false);
       
        Configurer c = getBus().getExtension(Configurer.class);
        c.configureBean("server", sf);
View Full Code Here


    static final String PORT = TestUtil.getPortNumber(WSAFeatureTest.class);
    @Test
    public void testServerFactory() {
        JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
        sf.getFeatures().add(new WSAddressingFeature());
        sf.setServiceBean(new GreeterImpl());
        sf.setAddress("http://localhost:" + PORT + "/test");
        sf.setStart(false);
        sf.setBus(getBus());
       
        Server server = sf.create();
View Full Code Here

        doTestDefaultServerEndpoint();
    }
    
    private void doTestDefaultServerEndpoint() {
       
        Object implementor = new GreeterImpl();
        EndpointImpl ei = (EndpointImpl)(javax.xml.ws.Endpoint.create(implementor));
        ei.publish("http://localhost/greeter");
       
        JaxWsEndpointImpl endpoint = (JaxWsEndpointImpl)ei.getEndpoint();
        assertEquals("Unexpected bean name", PORT_NAME.toString() + ".endpoint", endpoint.getBeanName());
View Full Code Here

        doTestConfiguredServerEndpoint();
    }
   
    private void doTestConfiguredServerEndpoint() {
       
        Object implementor = new GreeterImpl();
        EndpointImpl ei = (EndpointImpl)(javax.xml.ws.Endpoint.create(implementor));
        ei.publish("http://localhost/greeter");
       
        JaxWsEndpointImpl endpoint = (JaxWsEndpointImpl)ei.getEndpoint();
        assertEquals("Unexpected bean name", PORT_NAME.toString() + ".endpoint", endpoint.getBeanName());
View Full Code Here

    @Test
    public void testEndpoint() throws Exception {
        String address = "http://localhost:8080/test";
       
        GreeterImpl greeter = new GreeterImpl();
        EndpointImpl endpoint = new EndpointImpl(getBus(), greeter, (String)null);
        WebServiceContext ctx = greeter.getContext();
        assertNull(ctx);
        try {
            endpoint.publish(address);
        } catch (IllegalArgumentException ex) {
            assertTrue(ex.getCause() instanceof BusException);
            assertEquals("BINDING_INCOMPATIBLE_ADDRESS_EXC", ((BusException)ex.getCause()).getCode());
        }
        ctx = greeter.getContext();
       
        assertNotNull(ctx);
       
        // Test that we can't change settings through the JAX-WS API after publishing
       
View Full Code Here

   
    @Test
    public void testEndpointStop() throws Exception {  
        String address = "http://localhost:8080/test";
       
        GreeterImpl greeter = new GreeterImpl();
        EndpointImpl endpoint = new EndpointImpl(getBus(), greeter, (String)null);
        WebServiceContext ctx = greeter.getContext();
        assertNull(ctx);
        try {
            endpoint.publish(address);
        } catch (IllegalArgumentException ex) {
            assertTrue(ex.getCause() instanceof BusException);
            assertEquals("BINDING_INCOMPATIBLE_ADDRESS_EXC", ((BusException)ex.getCause()).getCode());
        }
        ctx = greeter.getContext();
       
        assertNotNull(ctx);
       
        // Test that calling stop on the Endpoint works
        assertTrue(endpoint.isPublished());
View Full Code Here

    }
   

    @Test
    public void testEndpointServiceConstructor() throws Exception {  
        GreeterImpl greeter = new GreeterImpl();
        JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
        serviceFactory.setBus(getBus());
        serviceFactory.setInvoker(new BeanInvoker(greeter));
        serviceFactory.setServiceClass(GreeterImpl.class);
       
        EndpointImpl endpoint = new EndpointImpl(getBus(), greeter,
                                                 new JaxWsServerFactoryBean(serviceFactory));
        WebServiceContext ctx = greeter.getContext();
        assertNull(ctx);
        try {
            String address = "http://localhost:8080/test";
            endpoint.publish(address);
        } catch (IllegalArgumentException ex) {
            assertTrue(ex.getCause() instanceof BusException);
            assertEquals("BINDING_INCOMPATIBLE_ADDRESS_EXC", ((BusException)ex.getCause()).getCode());
        }
        ctx = greeter.getContext();
       
        assertNotNull(ctx);
    }
View Full Code Here

        ep.publish("local://localhost:9090/hello");
    }

    @Test
    public void testAddWSAFeature() throws Exception {
        GreeterImpl greeter = new GreeterImpl();
        JaxWsServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
        serviceFactory.setBus(getBus());
        serviceFactory.setInvoker(new BeanInvoker(greeter));
        serviceFactory.setServiceClass(GreeterImpl.class);
       
View Full Code Here

        assertNotNull(resource);
        bean.setWsdlURL(resource.toString());
        bean.setBus(bus);
        bean.setServiceClass(GreeterImpl.class);

        GreeterImpl greeter = new GreeterImpl();
        BeanInvoker invoker = new BeanInvoker(greeter);
        bean.setInvoker(invoker);

        service = bean.create();
View Full Code Here

        URL resource = getClass().getResource("/wsdl/hello_world.wsdl");
        assertNotNull(resource);       
        bean.setWsdlURL(resource.toString());
        bean.setBus(bus);
        bean.setServiceClass(GreeterImpl.class);
        GreeterImpl greeter = new GreeterImpl();
        BeanInvoker invoker = new BeanInvoker(greeter);
       
       
        Service service = bean.create();

        assertEquals("SOAPService", service.getName().getLocalPart());
        assertEquals("http://apache.org/hello_world_soap_http", service.getName().getNamespaceURI());

        ServerFactoryBean svr = new ServerFactoryBean();
        svr.setBus(bus);
        svr.setServiceFactory(bean);
        svr.setInvoker(invoker);
       
        svr.create();

        Node response = invoke("http://localhost:9000/SoapContext/SoapPort",
                           LocalTransportFactory.TRANSPORT_ID,
                           "GreeterMessage.xml");
       
        assertEquals(1, greeter.getInvocationCount());
       
        assertNotNull(response);
       
        addNamespace("h", "http://apache.org/hello_world_soap_http/types");
       
View Full Code Here

TOP

Related Classes of org.apache.hello_world_soap_http.GreeterImpl

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.