Validation of Web services annotations

When you are using annotations with Java™ code, the product validates the usage and values of the annotations. Through this validation, you can detect problems before deploying your Web service.

When developing Web services, you can benefit from two levels of validation. The first level involves validating syntax and Java-based default values. This level of validation is performed by the Eclipse Java Development Tools (JDT). The second level of validation involves implicit default checking, as well as verification of Web Services Description Language (WSDL) contracts. This second level is performed by a JAX-WS annotations processor.

When you select the WebSphere Web 7.0 or WebSphere® 6.1 Feature Pack for Web Services facet for a project, you enable the JAX-WS annotations processor. (This processor extends the Eclipse Annotations Processing Tool (APT) framework.) When you enable the annotations processor, warnings and errors for annotations are displayed like Java errors. You can work with these warnings and errors in various workbench locations, such as the Problems view.

For example, you can use the wsdlLocation of the @WebService annotation to enforce consistency between your WSDL contracts, Java Service Endpoint Interfaces (SEIs), and implementation beans. By using the annotations processor to detect problems at build time, you can prevent these problems from occurring at run time.

While you are annotating Java code for a Web service, your WSDL file might sometimes be slow or impossible to access from the workspace. In this case, you can disable verification of WSDL contracts in your project:

  1. Right-click your Web service project in the Enterprise Explorer; then click

    Properties in the menu.

  2. In the Properties window, click

    Java Compiler | Annotations Processing.

  3. Under

    Processor options, select the key com.ibm.ws.ast.jws.annotations.processor.validateWSDL.

  4. Click the

    Edit button.

  5. In the Edit Processor Option window, type off in the

    Value field.

  6. Click OK twice.