1 package org.objectweb.celtix.systest.routing.passthrough; 2 3 import java.util.HashMap ; 4 import java.util.Map ; 5 6 import javax.xml.namespace.QName ; 7 import javax.xml.ws.Endpoint; 8 9 import org.objectweb.celtix.systest.common.TestServerBase; 10 import org.objectweb.celtix.systest.routing.DocLitWrappedImpl; 11 12 public class Server extends TestServerBase { 13 14 protected void run() { 15 QName serviceName = new QName ("http://objectweb.org/hello_world_doc_lit", "SOAPService"); 16 QName portName = new QName ("http://objectweb.org/hello_world_doc_lit", "SOAPPort"); 17 18 String address = "http://localhost:9002/HTTPSoapServiceDestination/HTTPSoapPortDestination"; 19 createAndpublishEndpoint(address, serviceName, portName); 20 21 serviceName = new QName ("http://objectweb.org/hello_world_doc_lit", "SOAPService4"); 22 portName = new QName ("http://objectweb.org/hello_world_doc_lit", "SOAPPort4"); 23 address = new String ("http://localhost:0/JMSService/JMSPort"); 24 createAndpublishEndpoint(address, serviceName, portName); 25 } 26 27 private void createAndpublishEndpoint(String address, 28 QName serviceName, 29 QName portName) { 30 Object implementor = new DocLitWrappedImpl(); 31 Map <String , Object > props = new HashMap <String , Object >(); 32 props.put(Endpoint.WSDL_SERVICE, serviceName); 33 props.put(Endpoint.WSDL_PORT, portName); 34 35 Endpoint ep = Endpoint.create(implementor); 36 ep.setProperties(props); 37 ep.publish(address); 38 } 39 40 public static void main(String [] args) { 41 try { 42 Server s = new Server(); 43 s.start(); 44 } catch (Exception ex) { 46 ex.printStackTrace(); 47 System.exit(-1); 48 } finally { 49 System.out.println("done!"); 50 } 51 } 52 } 53 | Popular Tags |