# Annotating a class

To add a `@WebService` annotation to a class:

1. In the Package Explorer, expand the package and then the Java file where the class is located.
2. Select the class.
3. Select JAX-WS > Create Web Service 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.
Related tasks
Setting annotation preferences
Annotating a method