use of org.apache.cxf.systest.http.GreeterImpl in project cxf by apache.
the class Server method run.
protected void run() {
// We use a null binding id in the call to EndpointImpl
// constructor. Why?
final String nullBindingID = null;
// We need to specify to use defaults on constructing the
// bus, because our configuration file doesn't have
// everything needed.
final boolean useDefaults = true;
// We configure a new bus for this server.
setBus(new SpringBusFactory().createBus(configFileURL, useDefaults));
// This impl class must have the appropriate annotations
// to match the WSDL file that we are using.
Object implementor = new GreeterImpl(name);
// I don't know why this works.
ep = new EndpointImpl(getBus(), implementor, nullBindingID, this.getClass().getResource("greeting.wsdl").toString());
// How the hell do I know what the name of the
// http-destination is from using this call?
ep.setEndpointName(new QName("http://apache.org/hello_world", name));
ep.publish(address);
}
use of org.apache.cxf.systest.http.GreeterImpl in project cxf by apache.
the class TrustServerNoSpring method run.
protected void run() {
Bus busLocal = BusFactory.getDefaultBus(true);
setBus(busLocal);
String address = "https://localhost:" + TrustManagerTest.PORT3 + "/SoapContext/HttpsPort";
try {
KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
keyStore.load(ClassLoaderUtils.getResourceAsStream("keys/Bethal.jks", this.getClass()), "password".toCharArray());
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
kmf.init(keyStore, "password".toCharArray());
TLSServerParameters tlsParams = new TLSServerParameters();
tlsParams.setKeyManagers(kmf.getKeyManagers());
ClientAuthentication clientAuthentication = new ClientAuthentication();
clientAuthentication.setRequired(false);
clientAuthentication.setWant(true);
tlsParams.setClientAuthentication(clientAuthentication);
Map<String, TLSServerParameters> map = new HashMap<>();
map.put("tlsId", tlsParams);
JettyHTTPServerEngineFactory factory = busLocal.getExtension(JettyHTTPServerEngineFactory.class);
factory.setTlsServerParametersMap(map);
factory.createJettyHTTPServerEngine("localhost", Integer.parseInt(TrustManagerTest.PORT3), "https", "tlsId");
factory.initComplete();
} catch (Exception ex) {
ex.printStackTrace();
}
Endpoint.publish(address, new GreeterImpl());
}
Aggregations