3
我有這樣下面的代碼,以便開始發佈WSDL如何制止這種javax.xml.ws.Endpoint服務
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");
}
}
如果我想停止該服務我應該怎麼辦?我對MelodyWS有所改變,並且想重新發布它。
我想你的解決方案,但我得到一個錯誤:「使用地址已:綁定」。我相信這是因爲「發佈()」方法。任何提示如何解決這個問題? – BustedSanta 2014-10-08 15:11:17
@BustedSanta停止服務不會立即發生。當'ep.stop()'完成時,先前綁定的端口(在本例中爲8081)應該是空閒的。您可以使用telnet命令(例如'telnet localhost 8081')來檢查。只有在端口空閒後,您才能重新發布服務。 – 2014-10-09 10:18:41