Creating a web service from a Java bean and a WSDL file

You can use annotations to associate an implementation Java™ bean with an existing WSDL service contract.

Before you begin

  • Your workspace must contain a Java bean that has been annotated as a web service.
  • You must have an existing Web Services Description Language (WSDL) service contract.

About this task

To create a web service:

Procedure

  1. In the Enterprise Explorer view, double-click your Java bean to open the file in the Java editor.
  2. In the editor or Annotations view, specify a value for the wsdlLocation attribute of the @WebService annotation. This value should be the Web address of the WSDL service contract that you want to associate with your bean.
  3. Optional: Use annotations to associate other Java elements with WSDL elements. For example, you might associate a Java method name with a WSDL operation name, or a Java parameter with a WSDL schema element. For detailed information about these and other annotations, see the related reference.
  4. Save your Java file.

What to do next

Postrequisite: Now you can Create a web service from your annotated Java bean by publishing it to a server.

Note: As you use annotations to associate your Java bean with a WSDL service contract, the JAX-WS annotations processor ensures that your Java code is consistent with the WSDL contract as required by the JAX-WS and JSR-181 standards. If there are inconsistencies, you will see warnings or errors in the code, along with suggestions for correction.
Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: twsandoc003.html