WebLogic Server 6.0.0 Code Examples, BEA Systems, Inc.

Package examples.wap.phoneBook

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

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 wap.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. See the servlets examples package documentation for instructions on how to build and deploy this servlet.) 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 and converts WML requests received from the client to HTTP servlet requests that are forwarded to PhoneServlet running on WebLogic Server. The HTTP response from the servlet is then converted back to WML by the Nokia WAP Server before being 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

This example uses PhoneServlet from the servlets examples package. You need to build and deploy this servlet before running this example.

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. Copy phone.wml from the samples/examples/source/wap/phonebook directory of your WebLogic distribution to the config/examples/applications/examplesWebApp directory. This directory is the location for publically-available files associated with the Examples Web Application.
  3. 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.2.2 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 toolkit's 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 Edit 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/docs60/

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