diff options
| author | BMatajsz <90217645+BMatajsz@users.noreply.github.com> | 2024-12-03 03:30:34 -0500 |
|---|---|---|
| committer | BMatajsz <90217645+BMatajsz@users.noreply.github.com> | 2024-12-03 03:30:34 -0500 |
| commit | d6067d28ce2a22c64cb595af6bca48c81b1664da (patch) | |
| tree | 76761ebbccca0e5c1fdcfee48a0bc7a235a8150f /src/main/java/derms/replica1/DERMSServerPublisher.java | |
| parent | d6bef622a2bb1c7f16941ef067fd878bbc05caa5 (diff) | |
| download | soen423-d6067d28ce2a22c64cb595af6bca48c81b1664da.zip | |
Test progress
Diffstat (limited to 'src/main/java/derms/replica1/DERMSServerPublisher.java')
| -rw-r--r-- | src/main/java/derms/replica1/DERMSServerPublisher.java | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/main/java/derms/replica1/DERMSServerPublisher.java b/src/main/java/derms/replica1/DERMSServerPublisher.java index df175b6..9b5ba91 100644 --- a/src/main/java/derms/replica1/DERMSServerPublisher.java +++ b/src/main/java/derms/replica1/DERMSServerPublisher.java @@ -2,15 +2,22 @@ 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) {
- try {
- Endpoint.publish("http://localhost:8387/ws/derms", new DERMSServer("MTL"));
-// Endpoint.publish("http://localhost:8081/ws/derms", new DERMSServer("QUE"));
-// Endpoint.publish("http://localhost:8082/ws/derms", new DERMSServer("SHE"));
- } catch (InterruptedException e) {
- throw new RuntimeException(e);
+ // 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.");
}
- System.out.println("DERMS Web Service is published at http://localhost:8387/ws/derms");
}
}
\ No newline at end of file |