Network Deployment (Distributed operating systems), v8.0 > End-to-end paths > Web services


Use WSDL EJB bindings to invoke an EJB from a JAX-RPC Web services client

WAS supports directly accessing an EJB as a web service, as an alternative to using HTTP or JMS to transport requests between the server and the client.

You need an EJB that you can directly access as a web service.

We can achieve this task because of a multiprotocol technology that uses Java API for XML-based remote procedure call (JAX-RPC) and Remote Method Invocation over Internet Inter-ORB Protocol (RMI/-IIOP) together.

RMI-IIOP with JAX-RPC supports WebSphere Java clients to invoke enterprise beans with a WSDL file and the JAX-RPC programming model instead of the standard Java EE programming model. When a web service is implemented by an enterprise bean, multiprotocol JAX-RPC permits the web service invocation path to be optimized for WebSphere Java clients.

This method yields better performance and enables you to get support for client transactions, which are not standard for web services.

To use EJB bindings of WSDL files to transport web services requests:


Procedure

  1. (Optional) Create a WSDL file that contains non-SOAP protocol bindings.

    We can use the -bindingTypes option of the Java2WSDL command to create a WSDL file that contains non-SOAP protocol bindings. The -bindingTypes option specifies the binding types to write to the output of the WSDL document. Review the Java2WSDL article for more information on using the -bindingTypes option. The following command is an example that you can use to generate SOAP over HTTP, and EJB bindings for a service endpoint interface, my.pkg.MySEI and an EJB implementation, my.pkg.MyEJBClass:

    java2wsdl -bindingTypes //publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/  ,ejb -implClass my.pkg.MyEJBClass my.pkg.MySEI
    
  2. (Optional) Obtain an existing WSDL file to add the EJB binding to.

  3. Add an EJB binding to the WSDL file.

  4. Add a port address that contains an endpoint using the wsejb prefix.
  5. Deploy the web services application.
  6. Configure the endpoint URL information for EJB bindings.

    The WSDL publisher uses this partial web address string to produce the actual enterprise bean web address for each port component that is defined in the enterprise bean JAR file. The published WSDL file can be used by clients that need to invoke the web service.


Results

You have an EJB that can be accessed by a web services client that uses JAX-RPC. The RMI-IIOP protocol is used instead of SOAP over HTTP


What to do next

Publish the WSDL file. See the making deployed web services applications available to clients information to learn more about publishing the WSDL file.


Related


EJB endpoint URL syntax
RMI-IIOP using JAX-RPC
Implement web services applications with JAX-RPC
Configure endpoint URL information to directly access enterprise beans
Task overview: Implementing web services applications
Make deployed web services applications available to clients


Related


Java2WSDL command for JAX-RPC applications
Web services specifications and APIs

+

Search Tips   |   Advanced Search