+

Search Tips   |   Advanced Search

Use HTTP to transport Web services requests for JAX-RPC applications


We can develop an HTTP accessible JAX-RPC Web service when you already have a Java Beansobject to enable as a Web service.

Run the Java 2WSDL command to create a WSDL file. When you run the Java 2WSDL 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 Java 2WSDL command, see the Java 2WSDL command for JAX-RPC applications documentation.

The appserver supports the use of HTTP to transport Web services client requests. With HTTP, the Web services clients and servers can communicate through SOAP messages. SOAP is the underlying communication protocol used in Web services that support the Web Services for Java EE and the 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 Java Bean object:

 

  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 the EAR file using the endptEnabler command, if the application includes enterprise beans.

    By default, the endptEnabler command adds only HTTP endpoints.

  3. Deploy the Web services application.

  4. Set 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

we have a Java Bean object that uses HTTP to transport Web services client requests.

 

Next steps

Publish the WSDL file.


Assembly tools
Web Services transactions, high availability, firewalls and intermediary nodes

 

Related


Java 2WSDL command for JAX-RPC applications