use of org.apache.hello_world.services.SOAPService in project cxf by apache.
the class CipherSuitesTest method testClientAESServerNULLAsync.
// Client does not allow NULL
@org.junit.Test
public void testClientAESServerNULLAsync() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = CipherSuitesTest.class.getResource("ciphersuites-client.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL url = SOAPService.WSDL_LOCATION;
SOAPService service = new SOAPService(url, SOAPService.SERVICE);
assertNotNull("Service is null", service);
final Greeter port = service.getHttpsPort();
assertNotNull("Port is null", port);
// Enable Async
((BindingProvider) port).getRequestContext().put("use.async.http.conduit", true);
updateAddressPort(port, PORT3);
try {
port.greetMe("Kitty");
fail("Failure expected on not being able to negotiate a cipher suite");
} catch (Exception ex) {
// expected
}
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.apache.hello_world.services.SOAPService in project cxf by apache.
the class ClientAuthTest method testChainTrust.
// Server trusts the issuer of the client cert
@org.junit.Test
public void testChainTrust() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = ClientAuthTest.class.getResource("client-auth-chain.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL url = SOAPService.WSDL_LOCATION;
SOAPService service = new SOAPService(url, SOAPService.SERVICE);
assertNotNull("Service is null", service);
final Greeter port = service.getHttpsPort();
assertNotNull("Port is null", port);
updateAddressPort(port, PORT2);
assertEquals(port.greetMe("Kitty"), "Hello Kitty");
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.apache.hello_world.services.SOAPService in project cxf by apache.
the class ClientAuthTest method testInvalidChainTrust.
// Server does not trust the issuer of the client cert
@org.junit.Test
public void testInvalidChainTrust() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = ClientAuthTest.class.getResource("client-auth-invalid2.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL url = SOAPService.WSDL_LOCATION;
SOAPService service = new SOAPService(url, SOAPService.SERVICE);
assertNotNull("Service is null", service);
final Greeter port = service.getHttpsPort();
assertNotNull("Port is null", port);
updateAddressPort(port, PORT2);
try {
port.greetMe("Kitty");
fail("Failure expected on no trusted cert");
} catch (Exception ex) {
// expected
}
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.apache.hello_world.services.SOAPService in project cxf by apache.
the class ClientAuthTest method testClientInvalidCertChain.
// Client does not trust the issuer of the server cert
@org.junit.Test
public void testClientInvalidCertChain() throws Exception {
SpringBusFactory bf = new SpringBusFactory();
URL busFile = ClientAuthTest.class.getResource("client-auth-invalid2.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);
BusFactory.setThreadDefaultBus(bus);
URL url = SOAPService.WSDL_LOCATION;
SOAPService service = new SOAPService(url, SOAPService.SERVICE);
assertNotNull("Service is null", service);
final Greeter port = service.getHttpsPort();
assertNotNull("Port is null", port);
updateAddressPort(port, PORT);
try {
port.greetMe("Kitty");
fail("Failure expected on no trusted cert");
} catch (Exception ex) {
// expected
}
((java.io.Closeable) port).close();
bus.shutdown(true);
}
use of org.apache.hello_world.services.SOAPService in project cxf by apache.
the class HTTPSClientTest method testSuccessfulCall.
public final void testSuccessfulCall(String configuration, String address, URL url, boolean dynamicClient) throws Exception {
setTheConfiguration(configuration);
startServers();
if (url == null) {
url = SOAPService.WSDL_LOCATION;
}
// CXF-4037 - dynamic client isn't using the conduit settings to resolve schemas
if (dynamicClient) {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
JaxWsDynamicClientFactory.newInstance(BusFactory.getDefaultBus()).createClient(url.toExternalForm());
Thread.currentThread().setContextClassLoader(loader);
}
SOAPService service = new SOAPService(url, SOAPService.SERVICE);
assertNotNull("Service is null", service);
final Greeter port = service.getHttpsPort();
assertNotNull("Port is null", port);
BindingProvider provider = (BindingProvider) port;
provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
// for (int x = 0; x < 100000; x++) {
assertEquals(port.greetMe("Kitty"), "Hello Kitty");
// }
stopServers();
}
Aggregations