Working with Web Services

The following table shows how to work with web services.
Number 1
Create the web service
  1. Make implementation decisions for your web service.
  2. Do one of the following:

To use JAX-RPC web services, get the "JAX-RPC Web Services" plugin from the Plugins manager.


Number 2
Develop the web service
  1. In the Projects window or Files window, double-click the files that you would like to edit.
  2. Use the Source Editor to develop the web service. When you right-click in the Source Editor, you can use the IDE to generate skeleton code for one or more of the following:

Number 3
Build the web service
  1. Do one of the following:
    • If the module within which the web service is implemented is part of a J2EE application, make sure the J2EE application is set as the main project and choose Build > Build Main Project (F11).
    • If the project is a stand-alone module, or if you want to build the module without building the other modules in the J2EE application, right-click the project's node in the Projects window and choose Build.
  2. Analyze the result and, if necessary, customize the related tool's features. For a JAX-WS web service that is created from a WSDL file, you can use the Web Service Attributes editor to customize XML to Java (JAXB) mappings, WS Security, or other WS* features. For JAX-RPC web services, customize the wscompile tool's features in the Project Properties dialog box, depending on your needs.

Number 4
Deploy the web service

You can deploy a web service as a stand-alone module or as a part of a J2EE application.

  1. To deploy it as part of a J2EE application, right-click the J2EE application's J2EE Modules node, choose Add J2EE Module, select the module that contains the web service, and click OK.
  2. Make sure the appropriate server is targeted.
  3. Choose Run > Run Main Project or right-click the project and choose Run.

Number 5
Test the web service

Number 6
Consume a web service
  1. Create the web service client from a local WSDL or a WSDL that is on-line.
  2. Test JAX-WS web services by using the Glassfish Tester application; test JAX-RPC web services from the IDE.
  3. Once you are sure that the web service is useful to you, use the Source Editor to develop the web service client. When you right-click in the Source Editor, you can use the IDE to generate skeleton code for calling a web service operation.
  4. Build the web service client.
  5. Make sure the appropriate server is targeted.
  6. Choose Run > Run Main Project or right-click the project and choose Run.

Legal Notices