WebLogic Server 6.1 Code Examples, BEA Systems, Inc.

Package examples.wireless.phoneBook

This example illustrates serving up static Wireless Markup Language (WML) documents via the PhoneServlet.

See:
          Description

phoneBook Example Summary
phone This file is accessed by the mobile client (the Nokia WAP simulation client) and presents the user with choices for looking up phone numbers via the PhoneServlet.
 

Package wireless.phoneBook Description

This example illustrates:

In this example, phone.wml is accessed by the mobile client (the Nokia WAP simulation client) and presents the user with choices for looking up phone numbers via the PhoneServlet. (PhoneServlet is part of the servlets examples package.) Based on the user's input, a request for a phone number is presented to the PhoneServlet in the form of query parameters added to the servlet URL. The Nokia WAP Server is used as a gateway which receives WML requests from the client and converts them to HTTP servlet requests that are forwarded to PhoneServlet running on WebLogic Server. The HTTP response from the servlet is then sent back to the Nokia WAP Server and then returned to the client.

You will need to install the following software to run this example:

Perform the following steps in order to build and run the examples:

  1. Build the example
  2. Configure the server
  3. Run the example

Build the Example

  1. Set up your development shell as described in Setting up your environment.

    We provide a build script for you to build the example, called build.xml.

  2. Run the build script using the following Java ant command:
            $ ant
  3. The script will build the example and place the files in the correct locations in your WebLogic Server distribution.

    Note: This example uses PhoneServlet from the servlets examples package.

Configure the Server

  1. The following MIME types are already registered with the Examples Web Application and are included here for information only.

    File ExtensionMIME Type
    wmltext/vnd.wap.wml
    wmlcapplication/vnd.wap.wmlc
    wmlstext/vnd.wap.wmlscript
    wmlscapplication/vnd.wap.wmlscriptc
    wbmpimage/vnd.wap.wbmp

  2. If you are not going to run the WAP simulation client on the same machine running WebLogic Server, you need to edit the phone.wml located in your document root so that the URL used in the <go href="http..../> tag is pointing to the correct hostname and listen port of your WebLogic Server.

Run the Example

Refer to the Nokia documentation for details on starting and administering the WAP Server and for using the WAP tookit.
  1. Start the WebLogic Server with the examples configuration.
  2. Start the Nokia WAP Server. You must have the /bin directory of JRE 1.3.0 in your PATH to start the Nokia WAP Server.
  3. Start and log in to the Nokia WAP Server Manager (username="admin", password=""). Ensure that UDP bearer adapter has been started.
  4. Start the Nokia WAP toolkit.
  5. Verfiy that the Nokia WAP toolkit is configured to pass all communication through the WAP gateway. In the toolkit menu, select Preferences. Select the Use WAP Gateway radio button. Under Gateway Settings, select Use Connectionless Mode. Hit OK.
  6. From the Nokia Active Server manager general menu, select Start Traffic
  7. From the toolkit's Browser menu, select Load location...
  8. In the Open Location dialog box, enter:
    http://hostname:7001/examplesWebApp/phone.wml
    where:
    hostname
    Host name of the WebLogic Server.
    port
    Port where the WebLogic Server is listening for connections (weblogic.system.ListenPort).
  9. From the toolkit's simulation phone handset, select Options.
  10. Scroll to Select name and hit Select.
  11. Scroll to one of names listed and hit Select, then hit OK.
  12. Select Options.
  13. Scroll to Get Number, then hit Select. The simulated mobile client will contact PhoneServelt to obtain the phone number and display the results in the handset.

There's More...

Read more about:


Documentation is available at
http://e-docs.bea.com/wls/docs61/

Copyright © 2000-2001 BEA Systems, Inc. All rights reserved.