0

I want to deploy a java webservice from eclipse,to run on my localhost without eclipse

this is my webservice:

import javax.jws.WebMethod;

import javax.jws.WebService;

@WebService
public class HelloWeb {

@WebMethod
public String sayGreeting(String name) {

    return "Greeting " + name + "!";

}

}

i did the following: after writing this, i rightclicked on the helloweb file, and clicked "create web service" and got the following image:

enter image description here

after clicking finish the service begins running in the internal web explorer

but i want it to run when eclipse is closed

how do i do that? what am i missing?

Lena Bru
  • 13,521
  • 11
  • 61
  • 126

1 Answers1

1

it looks like your using Eclipse to manage your server (and so it shows in an internal browser). The IDE puts all the files in the correct directories relative to your server's root. You dont however need to use an IDE to use a web-server like Tomcat or whatever other webserver you wish to use. If the server is setup correctly (see here for Tomcat http://tomcat.apache.org/tomcat-7.0-doc/setup.html)and your running the app from the Terminal in mac or from command prompt in windows you just need to have the server started to run the app on this port.You can then access your service in a browser on the server's port (im assuming a service is just like a webapp).

jsky
  • 2,225
  • 5
  • 38
  • 54
  • i actually want to have a button on a webpage that goes to the webservice and gets the response from it, however, when i try to send an ajax request to the location localhost:8080/mywebservice/helloweb i get "resource not found" because the actual service is not deployed there by the ide, please explain it to me as if i don't know anything, because i can't understand what i need to do.... – Lena Bru Jul 20 '13 at 13:40
  • This page should help you – jsky Jul 20 '13 at 13:48