Creating a Three-Tier Mobile Web Services Client

See Also

With the Mobile Client to Web Application Generator, you create a MIDP client, a servlet and supporting files to enable a MIDlet to communicate with a Web service. This type of connection utilizes three "tiers": client, web application containing servlet, and server. The client communicates with the generated middleware servlet using a proprietary communication protocol. The servlet and server communicate using standard Simple Object Access Protocol (SOAP) messages.

To create a mobile client to Web service application:

  1. Right-click on a project node (or create a new Mobile application project that is not a Hello MIDlet application) and choose New File/Folder.
  2. In the New File wizard, choose MIDP under Categories. Under File Types, choose Mobile Client to Web Application.
  3. In the Servlet and Client Type Selection page, select the desired Web application (if more than one is available) .
    The drop-down menu lists all open Web Applications. If you do not see the Web Application you want, choose Open Web Application and navigate to the project folder you want to open.
  4. Enter a name for the generated servlet, then choose a location and package for the servlet from the drop-down menus.
  5. Specify whether the mobile client will connect through methods in the Web application or a Web service client in the Web application. Click Next to continue.
  6. If you choose Methods in Web Application, the next page is the Methods in Web Project page.
    If you choose Web Service Client in Web Application, the next page is the Web Service Operations page.
  7. Click Next.

  8. Then select from the following generation options:
  9. Click the Finish button.
    The settings file is opened in the Editor. Client stubs are generated in the background.
  10. Build and deploy the server application. Note that new files were created in the Web project.
  11. After the server application is deployed, you can run your Mobile project and test the generated client.
See Also
Creating a MIDP Client/Server Application
Updating Java ME Web Services Client Files
 

Legal Notices