All Examples WAP Examples
Wireless Application Protocol (WAP) phone book example
about this example
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 WAP server before being returned to the client.
You will need to install the following software to run this example:
how to use this example
Build the example:
This examples uses PhoneServlet
from the servlets examples package.
You need to build and deploy this servlet before running this example.
Configure the server:
- Verify that the following WAP MIME types are registered
in your weblogic.properties
file.
weblogic.httpd.mimeType.text/vnd.wap.wml=wml
weblogic.httpd.mimeType.application/vnd.wap.wmlc=wmlc
weblogic.httpd.mimeType.text/vnd.wap.wmlscript=wmls
weblogic.httpd.mimeType.application/vnd.wap.wmlscriptc=wmlsc
weblogic.httpd.mimeType.image/vnd.wap.wbmp=wbmp
- Copy phone.wml from this
directory into to your document root.
The document root is the root directory for files that are publically available
on your WebLogic Server. By default it is set to the
/myserver/public_html
directory in your WebLogic installation directory. For more details,
see Setting up a document
root.
- If you are not going to the running 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 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.
- 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 into the Nokia WAP Server Manager (username="admin",
password=""). Ensure that UDP bearer adapter has been started.
- Start the Nokia WAP Toolkit.
- From the Tookit's "Go" menu, select "Load location..."
- In the Open Location dialog, enter:
http://hostname:7001/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 hand set, 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 WAP in
Using
WAP with WebLogic Server.
Read more about Servlets in the Developer Guide,
Using
WebLogic HTTP Servlets.
Copyright © 2000 BEA Systems, Inc.
All rights reserved.