Creating a Web Service Client

See Also 

A web service can be consumed in a web application, a Java application, or a MIDP client (MIDlet). For information on consuming web services in a MIDlet, see the J2ME Mobility documentation.

For JAX-WS clients, all imported WSDL files and schemas are resolved automatically by the IDE. For JAX-RPC clients, before you begin, note that if the WSDL file that you want to use imports schemas, other WSDL files, or both, from the local file system, the web service client will only work if the imported schemas and WSDL files are copied beforehand into the WEB-INF/wsdl (or META-INF/wsdl) folder. If you do not do this, the Web Service Compiler will not be able to locate these imported files at the end of the procedure below.

To create a web service client:

  1. Create the project to contain the web service client. Depending on how you want to consume the web service, do one of the following:
  2. From the Projects window or Files window, right-click a node in the project and choose New > File/Folder. The New File wizard appears. Under Categories, select Web Services. Under File Types, select Web Service Client. Click Next.
  3. Access the WSDL file of the web service that the web service client is to consume. Depending on what the provider has distributed, do the following:
  4. Specify a package where the client files are to be generated. When you complete the wizard, you can find the generated client files in the Files window, within the build folder. See Exposing the Web Service Client in the Projects Window.
  5. For JAX-RPC (J2EE 1.4) clients, select the web service client type from the Client Type drop-down:

    For J2SE clients, use the JAX Version drop-down to specify whether you want to create a JAX-WS client or a JAX-RPC client.

  6. Click Finish.
See Also
About Web Service Clients
About Web Services

Legal Notices