Package org.apache.cxf.endpoint

Examples of org.apache.cxf.endpoint.Client.invoke()


        Client client = control.createMock(Client.class);
        EasyMock.expect(proxy.createClient(bus, endpoint, conduit, replyTo)).andReturn(client).anyTimes()
        Object[] args = new Object[] {};
        Map<String, Object> context = new HashMap<String, Object>();
        Object[] results = new Object[] {"a", "b", "c"};
        EasyMock.expect(client.invoke(boi, args, context)).andReturn(results).anyTimes();       
       
        control.replay();
        assertEquals("a", proxy.invoke(oi, args, context));
    }
   
View Full Code Here


        byte[] bucketOfBytes =
            IOUtils.readBytesFromStream(getClass().getResourceAsStream("/wsdl/no_body_parts.wsdl"));
        Operation1 parameters = new Operation1();
        parameters.setOptionString("opt-ion");
        parameters.setTargetType("tar-get");
        Object[] rparts = client.invoke("operation1", parameters, bucketOfBytes);
        Operation1Response r = (Operation1Response)rparts[0];
        assertEquals(md5(bucketOfBytes), r.getStatus());
       
        ClientCallback callback = new ClientCallback();
        client.invoke(callback, "operation1", parameters, bucketOfBytes);
View Full Code Here

        Object[] rparts = client.invoke("operation1", parameters, bucketOfBytes);
        Operation1Response r = (Operation1Response)rparts[0];
        assertEquals(md5(bucketOfBytes), r.getStatus());
       
        ClientCallback callback = new ClientCallback();
        client.invoke(callback, "operation1", parameters, bucketOfBytes);
        rparts = callback.get();
        r = (Operation1Response)rparts[0];
        assertEquals(md5(bucketOfBytes), r.getStatus());
    }
View Full Code Here

        wsdlUrl = wsdl.toURI().toString();

        //TODO test fault exceptions
        DynamicClientFactory dcf = DynamicClientFactory.newInstance();
        Client client = dcf.createClient(wsdlUrl, serviceName, portName);
        client.invoke("greetMe", "test");       
        Object[] result = client.invoke("sayHi");
        assertNotNull("no response received from service", result);
        assertEquals("Bonjour", result[0]);
        //TODO: the following isn't a real test. We need to test against a service
        // that would actually notice the difference. At least it ensures that
View Full Code Here

        //TODO test fault exceptions
        DynamicClientFactory dcf = DynamicClientFactory.newInstance();
        Client client = dcf.createClient(wsdlUrl, serviceName, portName);
        client.invoke("greetMe", "test");       
        Object[] result = client.invoke("sayHi");
        assertNotNull("no response received from service", result);
        assertEquals("Bonjour", result[0]);
        //TODO: the following isn't a real test. We need to test against a service
        // that would actually notice the difference. At least it ensures that
        // specifying the property does not explode.
View Full Code Here

        // specifying the property does not explode.
        Map<String, Object> jaxbContextProperties = new HashMap<String, Object>();
        jaxbContextProperties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, "uri:ultima:thule");
        dcf.setJaxbContextProperties(jaxbContextProperties);
        client = dcf.createClient(wsdlUrl, serviceName, portName);
        client.invoke("greetMe", "test");       
        result = client.invoke("sayHi");
        assertNotNull("no response received from service", result);
        assertEquals("Bonjour", result[0]);
    }
   
View Full Code Here

        Map<String, Object> jaxbContextProperties = new HashMap<String, Object>();
        jaxbContextProperties.put(JAXBRIContext.DEFAULT_NAMESPACE_REMAP, "uri:ultima:thule");
        dcf.setJaxbContextProperties(jaxbContextProperties);
        client = dcf.createClient(wsdlUrl, serviceName, portName);
        client.invoke("greetMe", "test");       
        result = client.invoke("sayHi");
        assertNotNull("no response received from service", result);
        assertEquals("Bonjour", result[0]);
    }
   
    @Test
View Full Code Here

        JaxWsDynamicClientFactory dcf =
            JaxWsDynamicClientFactory.newInstance();
        URL wsdlURL = new URL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl");
        Client client = dcf.createClient(wsdlURL);
        try {
            client.invoke("throwException", -2);
        } catch (Exception ex) {
            Object o = ex.getClass().getMethod("getFaultInfo").invoke(ex);
            assertNotNull(o);
        }
       
View Full Code Here

            assertNotNull(o);
        }
       
        try {
            client.getRequestContext().put("disable-fault-mapping", true);
            client.invoke("throwException", -2);
        } catch (SoapFault ex) {
            //expected
        }
      
    }
View Full Code Here

        JaxWsDynamicClientFactory dcf =
            JaxWsDynamicClientFactory.newInstance();
        URL wsdlURL = new URL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl");
        Client client = dcf.createClient(wsdlURL);
        try {
            client.invoke("throwException", -2);
        } catch (Exception ex) {
            Object o = ex.getClass().getMethod("getFaultInfo").invoke(ex);
            assertNotNull(o);
        }
       
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.