summaryrefslogtreecommitdiffstats
path: root/src/main/java/derms/replica1/DERMSServerPublisher.java
blob: 9b5ba9167bf35dc5d5529bfd84e22e6410f3be3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package derms.replica1;

import javax.xml.ws.Endpoint;

import derms.frontend.DERMSServerImpl;

public class DERMSServerPublisher {

    private static Endpoint endpoint;

    public static void main(String[] args) {
        // Publish the web service
        endpoint = Endpoint.publish("http://127.0.0.1:8387/ws/derms", new DERMSServerImpl());
        System.out.println("DERMS Server is published at http://127.0.0.1:8387/ws/derms");
    }

    public static void stop() {
        if (endpoint != null && endpoint.isPublished()) {
            endpoint.stop();
            System.out.println("DERMS Server is stopped.");
        }
    }
}