1 package org.objectweb.celtix.systest.securebasic; 2 3 import javax.xml.ws.Endpoint; 4 5 import org.objectweb.celtix.systest.common.TestServerBase; 6 7 8 9 public class WantAndNeedClientAuthServer extends TestServerBase { 10 private static boolean launchingServer; 11 12 13 private String url; 14 15 public WantAndNeedClientAuthServer(String urlParam) { 16 String configFile = getClass().getResource(".") + "WantAndNeedClientAuthServer.xml"; 17 System.setProperty("celtix.config.file", configFile); 18 url = urlParam; 19 } 20 21 protected void run() { 22 Object implementor = new GreeterImpl(); 23 String address = url; 24 Endpoint.publish(address, implementor); 25 launchingServer = false; 26 } 27 28 29 public static void main(String [] args) { 30 31 try { 32 WantAndNeedClientAuthServer requireClientAuth = 33 new WantAndNeedClientAuthServer("https://localhost:9001/SoapContext/SoapPort"); 34 35 36 ServerThread st1 = new ServerThread(requireClientAuth); 37 launchingServer = true; 38 st1.start(); 39 40 while (launchingServer) { 41 Thread.sleep(2000); 42 } 43 WantAndNeedClientAuthServer requireClientAuthDiffernetCiphersuite = 44 new WantAndNeedClientAuthServer("https://localhost:9011/SoapContext/SoapPort"); 45 ServerThread st2 = new ServerThread(requireClientAuthDiffernetCiphersuite); 46 st2.start(); 47 } catch (Exception ex) { 48 ex.printStackTrace(); 49 System.exit(-1); 50 } finally { 51 System.out.println("done!"); 52 } 53 } 54 } 55 56 class ServerThread extends Thread { 57 TestServerBase server; 58 public ServerThread(TestServerBase t) { 59 server = t; 60 } 61 62 public void run() { 63 server.start(); 64 } 65 } 66 | Popular Tags |