01: package org.objectweb.celtix.systest.routing.passthrough;
02:
03: import java.util.HashMap;
04: import java.util.Map;
05:
06: import javax.xml.namespace.QName;
07: import javax.xml.ws.Endpoint;
08:
09: 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(
16: "http://objectweb.org/hello_world_doc_lit",
17: "SOAPService");
18: QName portName = new QName(
19: "http://objectweb.org/hello_world_doc_lit", "SOAPPort");
20:
21: String address = "http://localhost:9002/HTTPSoapServiceDestination/HTTPSoapPortDestination";
22: createAndpublishEndpoint(address, serviceName, portName);
23:
24: serviceName = new QName(
25: "http://objectweb.org/hello_world_doc_lit",
26: "SOAPService4");
27: portName = new QName(
28: "http://objectweb.org/hello_world_doc_lit", "SOAPPort4");
29: address = new String("http://localhost:0/JMSService/JMSPort");
30: createAndpublishEndpoint(address, serviceName, portName);
31: }
32:
33: private void createAndpublishEndpoint(String address,
34: QName serviceName, QName portName) {
35: Object implementor = new DocLitWrappedImpl();
36: Map<String, Object> props = new HashMap<String, Object>();
37: props.put(Endpoint.WSDL_SERVICE, serviceName);
38: props.put(Endpoint.WSDL_PORT, portName);
39:
40: Endpoint ep = Endpoint.create(implementor);
41: ep.setProperties(props);
42: ep.publish(address);
43: }
44:
45: public static void main(String[] args) {
46: try {
47: Server s = new Server();
48: s.start();
49: //s.run();
50: } catch (Exception ex) {
51: ex.printStackTrace();
52: System.exit(-1);
53: } finally {
54: System.out.println("done!");
55: }
56: }
57: }
|