|
| 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:
- Connectivity between WebLogic Server and a mobile terminal through a
Wireless Application Protocol (WAP) gateway
- Serving up static Wireless Markup Language (WML) documents via the FileServlet
- Configuring WAP MIME types within WebLogic Server
- Making interactive requests to a servlet from a mobile client
- Using Nokia WAP Server as a gateway between WebLogic Server and mobile clients
- Converting HTML documents to WML using the Nokia WAP Server
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:
- Build the example
- Configure the server
- Run the example
This example uses PhoneServlet
from the servlets examples package.
You need to build and deploy this servlet before running this example.
- The following MIME types are already registered with the
Examples Web Application and
are included here for information only.
File Extension | MIME Type |
wml | text/vnd.wap.wml |
wmlc | application/vnd.wap.wmlc |
wmls | text/vnd.wap.wmlscript |
wmlsc | application/vnd.wap.wmlscriptc |
wbmp | image/vnd.wap.wbmp |
- 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.
- 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.
- Start the WebLogic Server with
the examples configuration.
- 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.
- Start and log in to the Nokia WAP Server Manager (username="admin",
password=""). Ensure that UDP bearer adapter has been started.
- Start the Nokia WAP toolkit.
- 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.
- From the toolkit's General menu, select Start Traffic
- From the toolkit's Browser menu, select Load location...
- 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).
- From the toolkit's simulation phone handset, select Options.
- Scroll to Edit name and hit Select.
- Scroll to one of names listed and hit Select, then hit OK.
- Select Options.
- 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:
Copyright © 2000 BEA Systems, Inc.
All rights reserved.