Package javax.xml.ws

Examples of javax.xml.ws.Dispatch


        URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
        assertNotNull(wsdl1);
       
        ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

        Dispatch dispatch = service.createDispatch(PORT_1, Source.class, Service.Mode.PAYLOAD);
        assertNotNull(dispatch);
    }
View Full Code Here


        URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
        assertNotNull(wsdl1);
       
        ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

        Dispatch dispatch = service.createDispatch(PORT_1, Source.class, Service.Mode.PAYLOAD);
        assertNotNull(dispatch);
    }
View Full Code Here

        TestLogger.logger.debug("test: " + getName());
       
        BookStoreService service = new BookStoreService();
       
        JAXBContext ctx = JAXBContext.newInstance("org.apache.axis2.jaxws.client.soapaction");
        Dispatch dispatch = service.createDispatch(new QName(targetNamespace, portName),
                ctx, Mode.PAYLOAD);
       
        Map<String, Object> requestCtx = dispatch.getRequestContext();
        requestCtx.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
        requestCtx.put(BindingProvider.SOAPACTION_URI_PROPERTY, "http://jaxws.axis2.apache.org/client/soapaction/getPrice");
       
        ObjectFactory of = new ObjectFactory();
        GetPriceType gpt = of.createGetPriceType();
        gpt.setItem("TEST");
       
        // The element that is sent should be <getPriceWithAction>
        // so it will resolve to the getPriceWithAction operation
        // defined in the WSDL.
        JAXBElement<GetPriceType> getPrice = of.createGetPriceWithAction(gpt);
        JAXBElement<GetPriceResponseType> getPriceResponse = (JAXBElement<GetPriceResponseType>) dispatch.invoke(getPrice);
       
        GetPriceResponseType value = getPriceResponse.getValue();
        assertNotNull("The response was null", value);
       
        float price = value.getPrice();
View Full Code Here

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
       
        Service svc = Service.create(url, new QName("http://jaxws.axis2.apache.org", "EchoService"));
        Dispatch dispatch = svc.createDispatch(new QName("http://jaxws.axis2.apache.org", "EchoPort"),
                String.class, Mode.PAYLOAD);
       
        try {
            dispatch.invoke("");
           
            // If an exception wasn't thrown, then it's an error.
            fail();
        } catch (WebServiceException e) {
            // We should only get a WebServiceException here.  Anything else
View Full Code Here

   
    public void testSetInvalidClientProperties() throws Exception {
        Service svc = Service.create(new QName("http://test", "TestService"));
        QName portQName = new QName("http://test", "TestPort");
        svc.addPort(portQName, null, null);
        Dispatch dispatch = svc.createDispatch(portQName, String.class, Mode.PAYLOAD);
       
        Map<String, Object> map = dispatch.getRequestContext();
       
        try {
            map.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, new Integer(4));
            fail();
        }
View Full Code Here

        URL wsdl1 = getClass().getResource("/wsdl/calculator.wsdl");
        assertNotNull(wsdl1);
       
        ServiceImpl service = new ServiceImpl(getBus(), wsdl1, SERVICE_1, ServiceImpl.class);

        Dispatch dispatch = service.createDispatch(PORT_1, Source.class, Service.Mode.PAYLOAD);
        assertNotNull(dispatch);
    }
View Full Code Here

        TestLogger.logger.debug("test: " + getName());
       
        BookStoreService service = new BookStoreService();
       
        JAXBContext ctx = JAXBContext.newInstance("org.apache.axis2.jaxws.client.soapaction");
        Dispatch dispatch = service.createDispatch(new QName(targetNamespace, portName),
                ctx, Mode.PAYLOAD);
       
        Map<String, Object> requestCtx = dispatch.getRequestContext();
        requestCtx.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
        requestCtx.put(BindingProvider.SOAPACTION_URI_PROPERTY, "http://jaxws.axis2.apache.org/client/soapaction/getPrice");
       
        ObjectFactory of = new ObjectFactory();
        GetPriceType gpt = of.createGetPriceType();
        gpt.setItem("TEST");
       
        // The element that is sent should be <getPriceWithAction>
        // so it will resolve to the getPriceWithAction operation
        // defined in the WSDL.
        JAXBElement<GetPriceType> getPrice = of.createGetPriceWithAction(gpt);
        JAXBElement<GetPriceResponseType> getPriceResponse = (JAXBElement<GetPriceResponseType>) dispatch.invoke(getPrice);
       
        GetPriceResponseType value = getPriceResponse.getValue();
        assertNotNull("The response was null", value);
       
        float price = value.getPrice();
View Full Code Here

        } catch (MalformedURLException e) {
            e.printStackTrace();
        }
       
        Service svc = Service.create(url, new QName("http://jaxws.axis2.apache.org", "EchoService"));
        Dispatch dispatch = svc.createDispatch(new QName("http://jaxws.axis2.apache.org", "EchoPort"),
                String.class, Mode.PAYLOAD);
       
        try {
            dispatch.invoke("");
           
            // If an exception wasn't thrown, then it's an error.
            fail();
        } catch (WebServiceException e) {
            // We should only get a WebServiceException here.  Anything else
View Full Code Here

     */
    public void testDisptachBindingProviderSPI() {
        Service svc = Service.create(serviceQName);
        svc.addPort(portQName, SOAPBinding.SOAP11HTTP_BINDING, "");
       
        Dispatch dsp = svc.createDispatch(portQName, Source.class, Service.Mode.MESSAGE);
       
        // Make sure we can cast the object to the right interfaces
        assertTrue("The Dispatch object should also be a javax.xml.ws.BindingProvider",
                (dsp instanceof javax.xml.ws.BindingProvider));
        assertTrue("The Dispatch object should also be a org.apache.axis2.jaxws.spi.BindingProvider",
View Full Code Here

   
    public void testSetInvalidClientProperties() throws Exception {
        Service svc = Service.create(new QName("http://test", "TestService"));
        QName portQName = new QName("http://test", "TestPort");
        svc.addPort(portQName, null, null);
        Dispatch dispatch = svc.createDispatch(portQName, String.class, Mode.PAYLOAD);
       
        Map<String, Object> map = dispatch.getRequestContext();
       
        try {
            map.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, new Integer(4));
            fail();
        }
View Full Code Here

TOP

Related Classes of javax.xml.ws.Dispatch

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.