|
|
| 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:
- 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 PhoneServlet
- 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
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:
- Build the example
- Configure the server
- Run the example
- 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.
- Run the build script using the following Java ant command:
$
ant
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.
- 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 |
- 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.3.0 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 Nokia Active Server manager 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 Select 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-2001 BEA Systems, Inc.
All rights reserved.