Client using a Web service

We only create a simple client that uses the Web service we created from the Banking session EJB. We already have a client project for Web service clients, ItsoBank5WebClient.

We mirror the servlet banking client from ItsoBank5Web, but instead of using the session bean, we use the Web service through the proxy:

  • In the ItsoBank5WebClient project, create a package named itso.bank5.servlet.client.
  • Create a servlet named BankingServletClient. In the editor, copy the code from the BankingServlet, and make these changes:
    								import itso.bank5.session.*;
    								import itso.bank5.exception.InsufficientFundException;
    								import itso.bank5.utility.*;
    import java.io.PrintWriter;
    import javax.ejb.EJBException;
    								import javax.naming.*;
    								import javax.rmi.PortableRemoteObject; ...

Get EJB 2.0 Development with WebSphere Studio Application Developer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.