1 package org.objectweb.hello_world_soap_http; 2 3 import javax.xml.ws.Endpoint; 4 5 import org.objectweb.celtix.Bus; 6 import org.objectweb.celtix.BusException; 7 8 public class GreeterServer implements Runnable { 9 10 Bus bus; 11 12 protected GreeterServer(String [] args) throws Exception { 13 System.out.println("Starting Server"); 14 15 19 20 bus = Bus.init(args); 21 Object implementor = new AnnotatedGreeterImpl(); 22 String address = "http://localhost:9000/SoapContext/SoapPort"; 23 Endpoint.publish(address, implementor); 24 } 25 26 public static void main(String args[]) throws Exception { 27 GreeterServer server = new GreeterServer(args); 28 Thread t = new Thread (server); 29 t.start(); 30 try { 31 Thread.sleep(100); 32 } catch (InterruptedException ex) { 33 } 35 System.out.print("Press any key to terminate the server ..."); 36 System.in.read(); 37 38 server.shutdown(true); 39 40 t.join(); 41 } 42 43 public void run() { 44 bus.run(); 45 } 46 47 void shutdown(boolean wait) throws BusException { 48 bus.shutdown(wait); 49 } 50 51 52 } 53 | Popular Tags |