To add a @WebService annotation to a class:
-
In the Package Explorer, expand the package and then the Java file where the class is located.
-
Select the class.
-
Select from the menu bar.
- If you selected the Generate default annotations ... option in JAX-WS Preferences, the @Webservice annotation will be added to the code with default values
- If you selected Use wizards to overwrite defaults in JAX-WS Preferences, the Create Web Service wizard displays. Complete the fields in the wizard and click Finish.
Once you save the annotated Java class, a WSDL file is automatically generated and added to a wsdl directory in your project. Your project will also be JAX-WS enabled.