Using HTTP to transport web services requests for JAX-RPC applications

You can develop an HTTP accessible Java™ API for XML-based remote procedure call (JAX-RPC) web service when you already have a JavaBeans object to enable as a web service.

Before you begin

Run the Java2WSDL command to create a Web Services Description Language (WSDL) file. When you run the Java2WSDL command, use the -bindingsTypes option, along with http, to set the HTTP transport bindings. For example:
java2wsdl -bindingTypes http,jms -implClass my.pkg.MyEJBClass my.pkg.MySEI
To learn more about using the Java2WSDL command, see the Java2WSDL command for JAX-RPC applications documentation.

[z/OS]The Java2WSDL command-line tool is not supported on the z/OS® platform. This functionality is provided by the assembly tools provided with the z/OS version of the product. Read about the Java2WSDL command-line tool for Java API for XML-based Remote Procedure Call (JAX-RPC) applications to learn more about this tool.

About this task

The application server supports the use of HTTP to transport web services client requests. With HTTP, your web services clients and servers can communicate through SOAP messages. SOAP is the underlying communication protocol that is used in web services that support the Web Services for Java Platform, Enterprise Edition (Java EE) and the Java API for XML-based remote procedure call (JAX-RPC) specifications.

HTTP is the most commonly used transport for web services.

To develop an HTTP-accessible web service from an existing an existing JavaBeans object:

Procedure

  1. Add an HTTP binding and a SOAP address to the WSDL file.

    The WSDL file of a web service must include an HTTP binding and a SOAP address, which specifies an HTTP endpoint URL string, to be accessible on the HTTP transport. An HTTP binding is a wsdl:binding element that contains a wsdlsoap:binding element with a transport attribute that ends in soap/http.

    In addition to the HTTP binding, a wsdl:port element that references the HTTP binding must be included in the wsdl:service element within the WSDL file. The wsdl:port element contains a wsdlsoap:address element with a location attribute that specifies an HTTP endpoint URL string.

    When you develop the web service, a placeholder such as file:unspecified_location can be used for the endpoint URL string.

  2. Add the HTTP endpoints to your enterprise archive (EAR) file using the endptEnabler command, if your application includes enterprise beans.

    By default, the endptEnabler command adds only HTTP endpoints.

  3. Deploy the web services application.
  4. Configure security for the HTTP connection.

    For a secure HTTP connection, add the basicAuth assembly property to the ibm-webservicesclient-bnd.xmi deployment descriptor file. Set the user ID and the password attributes.

  5. Configure the endpoint URL information for HTTP bindings.

    The WSDL publisher uses this partial URL string to produce the actual HTTP URL for each port component defined in the EAR file. The published WSDL file can be used by clients, that need to invoke the web service.

Results

You have a JavaBeans object that uses HTTP to transport Web services client requests.

What to do next

Publish the WSDL file.