Examples of ServiceImpl


Examples of org.apache.cxf.jaxws.ServiceImpl

        }
        ReflectionUtils.doWithFields(getPojo().getClass(), new FieldCallback() {
            public void doWith(Field field) throws IllegalArgumentException,
                    IllegalAccessException {
                if (field.getAnnotation(WebServiceRef.class) != null) {
                    ServiceImpl s = new ServiceImpl(getBus(), null, null, field
                            .getType());
                    s.addPort(new QName("port"),
                            JBITransportFactory.TRANSPORT_ID, "jbi://"
                                    + ID_GENERATOR.generateSanitizedId());
                    Object o = s.getPort(new QName("port"), field.getType());
                    field.setAccessible(true);
                    field.set(getPojo(), o);
                }
            }
        });
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

        assertTrue(response instanceof SayHiResponse);
    }

    @Test
    public void testDOMSource() throws Exception {
        ServiceImpl service =
            new ServiceImpl(getBus(), getClass().getResource("/wsdl/hello_world.wsdl"), serviceName, null);

        Dispatch<Source> disp = service.createDispatch(portName, Source.class, Service.Mode.MESSAGE);
        disp.getRequestContext().put(Dispatch.ENDPOINT_ADDRESS_PROPERTY, address);

        d.setMessageObserver(new MessageReplayObserver("/org/apache/cxf/jaxws/sayHiResponse.xml"));

        Document doc = StaxUtils.read(getResourceAsStream("/org/apache/cxf/jaxws/sayHi2.xml"));
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

    }

    @Test
    public void testHTTPBinding() throws Exception {
        ServiceImpl service = new ServiceImpl(getBus(), null, serviceName, null);
        service.addPort(portName, HTTPBinding.HTTP_BINDING, "local://foobar");
        Dispatch<Source> disp = service.createDispatch(portName, Source.class, Service.Mode.MESSAGE);
        assertTrue(disp.getBinding() instanceof HTTPBinding);
    }
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

        assertTrue(disp.getBinding() instanceof HTTPBinding);
    }

    @Test
    public void testSOAPPBinding() throws Exception {
        ServiceImpl service = new ServiceImpl(getBus(), null, serviceName, null);
        service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, "local://foobar");
        Dispatch<Source> disp = service.createDispatch(portName, Source.class, Service.Mode.MESSAGE);
        assertTrue(disp.getBinding() instanceof SOAPBinding);
    }
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

    @Test
    // CXF-2822
    public void testInterceptorsConfiguration() throws Exception {
        String cfgFile = "org/apache/cxf/jaxws/dispatch/bus-dispatch.xml";
        Bus bus = new SpringBusFactory().createBus(cfgFile, true);
        ServiceImpl service = new ServiceImpl(bus, getClass().getResource("/wsdl/hello_world.wsdl"),
                                              serviceName, null);

        Dispatch<Source> disp = service.createDispatch(portName, Source.class, Service.Mode.MESSAGE);
        List<Interceptor<? extends Message>> interceptors = ((DispatchImpl<?>)disp).getClient()
            .getInInterceptors();
        boolean exists = false;
        for (Interceptor<? extends Message> interceptor : interceptors) {
            if (interceptor instanceof LoggingInInterceptor) {
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

        assertTrue("The LoggingInInterceptor is not configured to dispatch client", exists);
    }

    @Test
    public void testFindOperationWithSource() throws Exception {
        ServiceImpl service =
            new ServiceImpl(getBus(), getClass().getResource("/wsdl/hello_world.wsdl"), serviceName, null);

        Dispatch<Source> disp = service.createDispatch(portName, Source.class, Service.Mode.MESSAGE);
        disp.getRequestContext().put(Dispatch.ENDPOINT_ADDRESS_PROPERTY, address);
        disp.getRequestContext().put("find.dispatch.operation", Boolean.TRUE);
       
        d.setMessageObserver(new MessageReplayObserver("/org/apache/cxf/jaxws/sayHiResponse.xml"));
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

   
    @Override
    public ServiceDelegate createServiceDelegate(URL url, QName qname,
                                                 @SuppressWarnings("rawtypes") Class cls) {
        Bus bus = BusFactory.getThreadDefaultBus();
        return new ServiceImpl(bus, url, qname, cls);
    }
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

        for (WebServiceFeature f : features) {
            if (!f.getClass().getName().startsWith("javax.xml.ws")) {
                throw new WebServiceException("Unknown feature error: " + f.getClass().getName());
            }
        }
        return new ServiceImpl(bus, wsdlDocumentLocation,
                               serviceName, serviceClass, features);
       
    }
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

        NumberFactoryService service = new NumberFactoryService();
        NumberFactory factory = service.getNumberFactoryPort();
        updateAddressPort(factory, PORT);
       
        NumberService numService = new NumberService();
        ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);
       
        W3CEndpointReference numberTwoRef = factory.create("20");
        assertNotNull("reference", numberTwoRef);
          
        Number num =  (Number)serviceImpl.getPort(numberTwoRef, Number.class);
        assertTrue("20 is even", num.isEven().isEven());
       
        ClientProxy.getClient(num).getConduit().close();
       
        W3CEndpointReference numberTwentyThreeRef = factory.create("23");
        num =  (Number)serviceImpl.getPort(numberTwentyThreeRef, Number.class);
        assertTrue("23 is not even", !num.isEven().isEven());
       
        ClientProxy.getClient(num).getConduit().close();
        ClientProxy.getClient(factory).getConduit().close();
    }
View Full Code Here

Examples of org.apache.cxf.jaxws.ServiceImpl

        String s = NumberService.WSDL_LOCATION.toString();
        EmbeddedJMSBrokerLauncher.updateWsdlExtensors(BusFactory.getDefaultBus(), s);
        NumberService numService = new NumberService();

        assertNotNull("reference", ref);
        ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);   
        Number num =  (Number)serviceImpl.getPort(ref, Number.class);
        try {
            num.isEven().isEven();
            fail("there should be a fault on val 999");
        } catch (Exception expected) {
            assertTrue("match on exception message " + expected.getMessage(),
                       expected.getMessage().indexOf("999") != -1);
        }
        ClientProxy.getClient(num).getConduit().close();
       
        ref = factory.create("37");
        assertNotNull("reference", ref);
        num =  (Number)serviceImpl.getPort(ref, Number.class);
        assertTrue("37 is not even", !num.isEven().isEven());
       
        ClientProxy.getClient(num).getConduit().close();
        ClientProxy.getClient(factory).getConduit().close();
    }
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.