0

I am following a little tutorial for JAX-WS mkyong - jax-ws

I have published this little example with the following code on my Windows 7 machine. But how can I update or remove this webservice?

public class HelloWorldPublisher {
    public static void main(String[] args) {
        Endpoint.publish("http://localhost:9999/ws/hello", new HelloWorldImpl());
    }
}
sparkhee93
  • 1,381
  • 3
  • 21
  • 30
LStrike
  • 1,598
  • 4
  • 26
  • 58

1 Answers1

0

Remove : If you want to remove the web service, just use the Endpoint.stop() (read here) methods for stopping it accept the requests.

Update : Just change the code in the HelloWorldImpl class. It will automaticaly call the newly updated code.

Endpoint.publish() simply tells the server that the requests in the given URL should be processed using HelloWorldImpl

joergl
  • 2,850
  • 4
  • 36
  • 42
Jay
  • 690
  • 1
  • 10
  • 27
  • But if I update the code and run HelloWorldPublisher I get an exception: Exception in thread "main" com.sun.xml.internal.ws.server.ServerRtException: Server Runtime Error: java.net.BindException: Address already in use: bind – LStrike Feb 15 '13 at 15:10
  • Do not need to publish it everytime you update the method. Each time when you want to update the code. Just update the **HelloWorldImpl** class alone. This should work. – Jay Feb 15 '13 at 15:26
  • Hmm, I think I am not capable to think today anymore. Mybe I have to read a little bit more about jax. Ok, I have added a second method to HelloWorldImpl. But, if I make an update on the wsdl with soap ui, the second method does not appear. So I have to tell someone, that there is a new method. And that is the thing I don't understand at the moment. – LStrike Feb 15 '13 at 15:36
  • @LStrike The best way is to use a good IDE and try to read on generating Jav code from WSDL using an IDE. Both Eclipse and Netbeans are capable of generating webservice stub from a WSDL file. See this [thread] (http://stackoverflow.com/questions/3179229/generating-web-service-from-wsdl-file) – Jay Feb 15 '13 at 15:53
  • Thanks, will do it at the weekend. – LStrike Feb 15 '13 at 16:00