use of org.apache.cxf.endpoint.dynamic.DynamicClientFactory in project cxf by apache.
the class ClientServerTest method testBase64.
@Test
public void testBase64() throws Exception {
URL wsdl = getClass().getResource("/wsdl/others/dynamic_client_base64.wsdl");
assertNotNull(wsdl);
String wsdlUrl = null;
wsdlUrl = wsdl.toURI().toString();
CXFBusFactory busFactory = new CXFBusFactory();
Bus bus = busFactory.createBus();
DynamicClientFactory dynamicClientFactory = DynamicClientFactory.newInstance(bus);
Client client = dynamicClientFactory.createClient(wsdlUrl);
assertNotNull(client);
}
use of org.apache.cxf.endpoint.dynamic.DynamicClientFactory in project cxf by apache.
the class ClientServerTest method testDynamicClientFactory.
@Test
public void testDynamicClientFactory() throws Exception {
URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
assertNotNull(wsdl);
String wsdlUrl = null;
wsdlUrl = wsdl.toURI().toString();
DynamicClientFactory dcf = DynamicClientFactory.newInstance();
Client client = dcf.createClient(wsdlUrl, serviceName, portName);
updateAddressPort(client, PORT);
client.invoke("greetMe", "test");
Object[] result = client.invoke("sayHi");
assertNotNull("no response received from service", result);
assertEquals("Bonjour", result[0]);
client = dcf.createClient(wsdlUrl, serviceName, portName);
new LoggingFeature().initialize(client, client.getBus());
updateAddressPort(client, PORT);
client.invoke("greetMe", "test");
result = client.invoke("sayHi");
assertNotNull("no response received from service", result);
assertEquals("Bonjour", result[0]);
}
use of org.apache.cxf.endpoint.dynamic.DynamicClientFactory in project cxf by apache.
the class ClientServerPartialWsdlTest method testCXF4676Partial1.
@Test
public void testCXF4676Partial1() throws Exception {
DynamicClientFactory dcf = DynamicClientFactory.newInstance();
Client client = dcf.createClient("http://localhost:" + PORT + "/AddNumbersImplPartial1Service?wsdl", serviceName1, portName1);
updateAddressPort(client, PORT);
Object[] result = client.invoke("addTwoNumbers", 10, 20);
assertNotNull("no response received from service", result);
assertEquals(30, result[0]);
}
use of org.apache.cxf.endpoint.dynamic.DynamicClientFactory in project cxf by apache.
the class AegisClientServerTest method testDynamicClient.
@Test
public void testDynamicClient() throws Exception {
DynamicClientFactory dcf = DynamicClientFactory.newInstance();
Client client = dcf.createClient("http://localhost:" + PORT + "/jaxwsAndAegisSports?wsdl&dynamic");
Object r = client.invoke("getAttributeBean")[0];
Method getAddrPlainString = r.getClass().getMethod("getAttrPlainString");
String s = (String) getAddrPlainString.invoke(r);
assertEquals("attrPlain", s);
}
use of org.apache.cxf.endpoint.dynamic.DynamicClientFactory in project cxf by apache.
the class DynamicClientEndpointCreationLoop method iteration.
private void iteration() throws URISyntaxException {
URL wsdl = getClass().getResource("/wsdl/others/dynamic_client_base64.wsdl");
String wsdlUrl = null;
wsdlUrl = wsdl.toURI().toString();
DynamicClientFactory dynamicClientFactory = DynamicClientFactory.newInstance(bus);
Client client = dynamicClientFactory.createClient(wsdlUrl);
client.destroy();
}
Aggregations