Package org.apache.cxf.jaxws

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());
       
        W3CEndpointReference numberTwentyThreeRef = factory.create("23");
        num =  (Number)serviceImpl.getPort(numberTwentyThreeRef, Number.class);
        assertTrue("23 is not even", !num.isEven().isEven());
    }
View Full Code Here


        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());
       
        close(num);
       
        W3CEndpointReference numberTwentyThreeRef = factory.create("23");
        num =  (Number)serviceImpl.getPort(numberTwentyThreeRef, Number.class);
        assertTrue("23 is not even", !num.isEven().isEven());
       
        close(num);
        close(factory);
    }
View Full Code Here

        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

        EndpointReferenceType numberTwoRef = VersionTransformer.convertToInternal(w3cEpr);
        assertNotNull("reference", numberTwoRef);
       
        // use getPort with epr api on service
        NumberService numService = new NumberService();
        ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);
       
        Number num =  (Number)serviceImpl.getPort(numberTwoRef, Number.class);
        assertTrue("20 is even", num.isEven().isEven());
        w3cEpr = factory.create("23");
        EndpointReferenceType numberTwentyThreeRef = VersionTransformer.convertToInternal(w3cEpr);
        num =  (Number)serviceImpl.getPort(numberTwentyThreeRef, Number.class);
        assertTrue("23 is not even", !num.isEven().isEven());
    }
View Full Code Here

        d = localTransport.getDestination(ei);
    }

    @Test
    public void testResolveOperationWithSource() throws Exception {
        ServiceImpl service =
            new ServiceImpl(getBus(), getClass().getResource(wsdlResource), serviceName, null);

        Dispatch<Source> disp = service.createDispatch(
                portName, Source.class, Service.Mode.PAYLOAD);
        disp.getRequestContext().put(MessageContext.WSDL_OPERATION, operationName);
        disp.getRequestContext().put(Dispatch.ENDPOINT_ADDRESS_PROPERTY, address);
       
        d.setMessageObserver(new MessageReplayObserver(responseResource));
View Full Code Here

        assertEquals(operationName, boi.getName());
    }
   
    @Test
    public void testResolveOperationWithSourceAndWSA() throws Exception {
        ServiceImpl service =
            new ServiceImpl(getBus(), getClass().getResource(wsdlResource),
                    serviceName, null, new AddressingFeature());

        Dispatch<Source> disp = service.createDispatch(
                portName, Source.class, Service.Mode.PAYLOAD);
        disp.getRequestContext().put(MessageContext.WSDL_OPERATION, operationName);
        disp.getRequestContext().put(Dispatch.ENDPOINT_ADDRESS_PROPERTY, address);
       
        d.setMessageObserver(new MessageReplayObserver(responseResource));
View Full Code Here

   
    @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

        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

        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 = DOMUtils.readXml(getResourceAsStream("/org/apache/cxf/jaxws/sayHi2.xml"));
View Full Code Here

    }

    @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

TOP

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

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.