Hendra Syailendra
Hendra Syailendra

Reputation: 71

how to stop this javax.xml.ws.Endpoint service

i have like this below code in order to start to publish wsdl

    package my.mimos.stp.MelodyWS.webservice;

import javax.xml.ws.Endpoint;



public class Server {

    public static void main(String[] args) {

        Endpoint.publish("http://localhost:8081/Melody/MelodyService", new MelodyWS());

        System.out.println("Melody service is ready");

    }

}

what should i do if i want to stop that service? i have a changes in MelodyWS and would like to republish it.

Upvotes: 6

Views: 4057

Answers (1)

Miljen Mikic
Miljen Mikic

Reputation: 15261

You have to keep a reference on the Endpoint object and call stop() method on it:

Endpoint ep = Endpoint.create(new MelodyWS());
ep.publish("http://localhost:8081/Melody/MelodyService");
..
ep.stop();

Upvotes: 7

Related Questions