Search in sources :

Example 1 with Operation1Response

use of org.apache.cxf.no_body_parts.types.Operation1Response in project cxf by apache.

the class JaxWsDynamicClientTest method testInvocation.

@Test
public void testInvocation() throws Exception {
    JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
    URL wsdlURL = new URL("http://localhost:" + PORT + "/NoBodyParts/NoBodyPartsService?wsdl");
    Client client = dcf.createClient(wsdlURL);
    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);
    rparts = callback.get();
    r = (Operation1Response) rparts[0];
    assertEquals(md5(bucketOfBytes), r.getStatus());
}
Also used : JaxWsDynamicClientFactory(org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory) ClientCallback(org.apache.cxf.endpoint.ClientCallback) Operation1Response(org.apache.cxf.no_body_parts.types.Operation1Response) Operation1(org.apache.cxf.no_body_parts.types.Operation1) Client(org.apache.cxf.endpoint.Client) URL(java.net.URL) Test(org.junit.Test)

Aggregations

URL (java.net.URL)1 Client (org.apache.cxf.endpoint.Client)1 ClientCallback (org.apache.cxf.endpoint.ClientCallback)1 JaxWsDynamicClientFactory (org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory)1 Operation1 (org.apache.cxf.no_body_parts.types.Operation1)1 Operation1Response (org.apache.cxf.no_body_parts.types.Operation1Response)1 Test (org.junit.Test)1