Oracle Application Server Wireless Developer's Guide 10g (9.0.4) Part Number B10948-01 |
|
Each section of this document presents a different topic. These sections include:
Section 3.1, "Wireless Developer Kit Overview"
Section 3.2, "WDK Installation and Configuration"
Section 3.4, "Running a Wireless Application with the WDK Tutorial"
OracleAS Wireless includes a developer's kit to enable development and testing of wireless applications without the full installation of Oracle Application Server. The kit provides support for developing applications in the following areas:
OracleAS Wireless Developer Kit is tightly integrated with Oracle JDeveloper Wireless Edition, offering such features as wizards, code templates, and device simulators. Because OracleAS Wireless Developer Kit is offered in a standalone mode, any IDE or development tool can leverage the development functionality of OracleAS Wireless.
Oracle Application Server WDK is a part of the Oracle Application Server Developer CD. Also, it is embedded in Oracle JDeveloper Wireless Edition. The WDK is very easy to install and use and in normal situations does not require any post-installation configuration. For advanced configuration, see the WDK component-specific configuration in the corresponding sections of this document.
After installing the WDK, you will have the following directory structure:
This section describes how developers can take advantage of the MCSLite component of the WDK to develop and test their Multi-Channel applications.
MCSLite is a J2EE web application containing servlets and a servlet filter. It has a small memory footprint, yet provides all the content adaptation functionality of a full-fledged MCS Server. Its purpose is to help developers to completely test their applications before deploying on OracleAS Wireless Server.
The main goal of the MCSLite is testing; it provides information to developers to help them better understand the execution of their application. The MCSLite log file contains the following important information:
MCSLite can be deployed in two ways:
The key features of MCSLite are:
This is the process that occurs during a single cycle of adaptation:
web.xml
. When debugging a wireless application, the log level should be set to debug as this will produce the most information. See the next section on how to change the default MCSLite configuration.
MCSLite was designed to be extremely easy to use. To use it, you must first create and deploy your web application. You can use any web technology to develop your application. You can use either static or dynamic pages. Also, you can use either MobileXML or XHTML+XForms or XHTML MP markup languages. The only requirement is that the application is accessible through HTTP protocol.
The usage depends on the current deployment, either local or remote.
[ORACLE_HOME]
/wireless/wdk/server/applications/wdk/wdk-web
directory. Use this method if you have a simple application that you want to test and do not want to go through the trouble of creating and deploying your own web application. Here is an example of how to use MCSLite in this deployment scenario:
The application to be tested is deployed, and the URL to it is: http://apphost:port/myApp.jsp
.
If MCSLite is deployed on a machine with hostname MCSLitehost, the URL to the MCSLite content retriever servlet is http://MCSLitehost:port/wdk/MCSLite
.
The two web applications may or may not be deployed on the same machine. Using this deployment scenario, developers can share a single MCSLite instance. Then accessing the application from a device or simulator is a matter of entering a special URL in the browser. That special URL is: http://MCSLitehost:port/wdk/MCSLite/http/apphost/port/myApp.jsp
(using the above examples).
Here are the steps to create that special URL:
http://MCSLitehost:port/wdk/MCSLite
http://apphost:port/myApp.jsp
). The result of that is: http://MCSLitehost:port/wdk/MCSLite/http://apphost:port/myApp.jsp
http://MCSLitehost:port/wdk/MCSLite/http/apphost/port/myApp.jsp
Regardless of the MCSLite deployment scenario, sending parameters to a back-end application is the same; it is no different than sending such parameters from a regular browser. Just add those parameters in the query part of the URL. For example, to send two parameters to your application:
fname=John and lname=Doe
then you add to the URL as follows:
http:// ... /myApp.jsp?fname=John&lname=Doe
MCSLite uses the same URL rewriting and caching mechanism as MCS except that it uses a configuration parameter indicating whether the long or the short form of URL rewriting should be used.
See Also: For more information on URL rewriting and caching, see Chapter 9, "Using Multi-Channel Server". |
See: For information on National Language Support, see Section 9.4.6, "Globalization (NLS) Support". |
The log file contains information crucial for developers; it is a good source for debug information when testing applications. There are four types of messages that can be found in the log file:
You can view the log file in one of two ways:
[ORACLE_HOME]/wireless/wdk/server/applications/wdk/wdk-web/logs
directory. This requires direct access to the machine on which MCSLite is running (usually the developer's own machine).
http://MCSLitehost:port/wdk/log
. The web-based log viewer is useful when a group of developers share a single MCSLite server (such as in a remote MCSLite deployment).
For each message in the log file, the IP address and session information for the device request is provided. This is useful when you want to find requests coming from your device versus requests from someone else's device.
Note: Error messages in the log.xml file, of the format XFM-xxxx, are generated by the XForms processor. |
One of the advantages of MCSLite is that it works out of the box without any configuration. You can optionally perform advanced configuration actions. MCSLite allows configuration of: log file location and name, logging level, XML validation mode, enabling or disabling auto-reload of devices and transformers, and more. To perform these configuration actions, edit the MCSLite web.xml
file. web.xml
is located in [ORACLE_HOME]/wireless/wdk/server/applications/wdk/wdk-web/WEB-INF
Here are the configuration properties in MCSLite web.xml
:
wdk.log.file
--Absolute path to the log file (directory and file name). For example: D:\wdk\logs\wdk.log
. You can also specify System.out
or System.err
to use the standard output or standard error. If no value is specified, then the default log file location is used: [ORACLE_HOME]/wireless/wdk/server/applications/wdk/wdk-web/logs/wdk.log
wdk.log.level
--Specifies how much information is written to the log file. The permissible values are debug, info, warning, and error. Debug yields the most information, info second, and so on. The default value of this property is info.
xml.validation.mode
--Sets the validation mode of the XML parser. Permissible values are true or false. Default value is false.
autoreload.transformers
--Specifies whether changes to the transformer should be detected and reloaded automatically. Permissible values are true or false. Default value is true.
autoreload.devices
--Specifies whether changes to the devices should be detected and reloaded automatically. Permissible values are true or false. Default value is true.
long.url.format
--Specifies whether long or short URL format should be used to rewrite embedded URLs. Permissible values are true or false. Default value is true.
See Also: For explanation and comparison between long and short URL formats, see Section 3.2.2.4, "MCSLite URL Rewriting and Caching". |
In OracleAS Wireless server, all device descriptions are stored in the database. However, to simplify MCSLite, database connections are not necessary; each device description is stored in an XML file. The device XML files are located in [ORACLE_HOME]/wireless/wdk/server/applications/wdk/wdk-web/repository
. Each XML file contains the metadata that describes attributes and characteristics of a single device.
Some of the important device properties required by the MCSLite are:
See Also: For more information on device properties, see Chapter 9, "Using Multi-Channel Server". |
MCSLite uses the same sophisticated device detection algorithm as OracleAS Wireless server.
See Also: For more information on device properties, see Chapter 9, "Using Multi-Channel Server". |
The multimedia adaptation supported by MCSLite is the same as in OracleAS Wireless server, except that MCSLite multimedia adaptation does not provide the extensible framework for plugging-in your own implementation of the multimedia adaptation interfaces.
See Also: For more information on multimedia adaptation, see Chapter 9, "Using Multi-Channel Server". |
Application developers can build exciting new location services, or enhance their existing applications with location information. To do that they need specialized services:
OracleAS Wireless WDK provides an application programming interface (API) to access these location services components. Developers can access OracleAS Wireless Web Services from these APIs to develop, debug and test their applications without setting up the complete OracleAS Wireless environment together with the relevant content service providers.
The following sections briefly describe some of the important API calls along with some examples. API details can be found in the Javadoc provided with the WDK.
The mobile positioning service allows you to get and set a mobile user's current location. This service is implemented as a web service in OracleAS Wireless WDK. It enables applications to get and set a mobile user's current location from anywhere on the Internet using any programming model.
The oracle.panama.mp.soap.MPSoapClient
class wraps the client SOAP calls and exposes the services in the Java programming interface. A client Java program must first construct an object of this class using the web service URL and the service ID before getting and setting a mobile user's location. The web service URL is the SOAP router of the location web service on an OracleAS Wireless server; for example, http://myaswserver.oracle.com:7777/location/web services
. The service ID is the SOAP service ID, for example: urn:MobilePositionServer
.
Two methods can be used to get a mobile user's location:
getPositionSimple(String username, String password, String msid)
getPosition(String username, String password, String msid, boolean getLatestLocationOnly)
In method getPositionSimple, parameters username and password are used for authentication purposes. The third parameter MSID is the mobile station ID of the user whose location is being requested. An MSID is usually a user's mobile phone number. If the request succeeds, this function returns an array of two double precision numbers representing the longitude and the latitude.
In method getPosition
, the first three parameters are the same as in method getPositionSimple
. The last parameter is a Boolean value indicating whether the caller wants to get the last known location of the mobile station. If this is set to true, OracleAS Wireless server will return the latest known location of the mobile station without performing any positioning operation. If there is no location cached in the OracleAS Wireless server, an exception is raised. If it is set to false, then OracleAS Wireless server returns the cached location (if its age has not exceeded the default quality of service of the system). Otherwise OracleAS Wireless server performs a mobile positioning operation to get this mobile station's current location. The return value of method getPosition
is a string containing the user's location (in XML format) with the following schema:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" elementFormDefault="qualified"> <xsd:element name="RESPONSE "> <xsd:complexType> <xsd:sequence> <xsd:element ref="TIMESTAMP"/> <xsd:element ref="POS"/> <xsd:element ref="VELOCITY" minOccurs="0"/> <xsd:element ref="BEARING" minOccurs="0"/> <xsd:element ref="ALTITUDE" minOccurs="0"/> <xsd:element ref="ALT_UNCERTAINTY" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="ALTITUDE" type="xsd:string"/> <xsd:element name="ALT_UNCERTAINTY" type="xsd:string"/> <xsd:element name="BEARING" type="xsd:string"/> <xsd:element name="LAT" type="xsd:string"/> <xsd:element name="LONG" type="xsd:string"/> <xsd:element name="POS"> <xsd:complexType> <xsd:sequence> <xsd:element ref="LONG"/> <xsd:element ref="LAT"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="TIMESTAMP" type="xsd:string"/> <xsd:element name="VELOCITY" type="xsd:string"/> </xsd:schema>
<POS>
element contains the longitude and latitude of the location.
<TIMESTAMP>
element contains the time stamp when the location was acquired. The time always uses Greenwich Mean Time. For example 2003-03-12 20:01:06 GMT.
<VELOCITY>
element specifies the velocity of the mobile device, in meters per second.
<BEARING>
element specifies the bearing angle, in degrees, clockwise from North.
<ALTITUDE>
element specifies the altitude of the mobile device, in meters, above sea level.
The caller, identified by the username and the password parameters, must be a valid OracleAS Wireless user, and must have been granted the location authorization to access the location of the user associated with the MSID. An exception will be raised if the username and password cannot authenticate the caller, or the caller is not authorized to access the location information.
A mobile device can send its current location, usually provided through a global positioning system (GPS), to OracleAS Wireless server. The current location can then be cached in the server and queried using mobile positioning and privacy APIs. You must create a client application program that posts the device's current location to OracleAS Wireless server. A Java client can call method setPosition(String xmlReq)
in class oracle.panama.mp.soap.MPSoapClient
. This function takes one String parameter representing the position data. The data must be in XML format, and it must conform to the following schema:
<?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema" elementFormDefault="qualified"> <xsd:element name="MP_GPS"> <xsd:complexType> <xsd:sequence> <xsd:element ref="USERNAME"/> <xsd:element ref="PASSWORD"/> <xsd:element ref="MSID"/> <xsd:element ref="TIME" minOccurs="0"/> <xsd:element ref="GMT" minOccurs="0"/> <xsd:element ref="POS"/> <xsd:element ref="ALTITUDE" minOccurs="0"/> <xsd:element ref="ALT_UNCERTAINTY" minOccurs="0"/> <xsd:element ref="VELOCITY" minOccurs="0"/> <xsd:element ref="BEARING" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="ALTITUDE" type="xsd:string"/> <xsd:element name="ALT_UNCERTAINTY" type="xsd:string"/> <xsd:element name="BEARING" type="xsd:string"/> <xsd:element name="GMT" type="xsd:string"/> <xsd:element name="LAT" type="xsd:string"/> <xsd:element name="LONG" type="xsd:string"/> <xsd:element name="MSID" type="xsd:string"/> <xsd:element name="PASSWORD" type="xsd:string"/> <xsd:element name="POS"> <xsd:complexType> <xsd:sequence> <xsd:element ref="LAT"/> <xsd:element ref="LONG"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="TIME" type="xsd:string"/> <xsd:element name="USERNAME" type="xsd:string"/> <xsd:element name="VELOCITY" type="xsd:string"/> </xsd:schema>
<USERNAME>
and <PASSWORD>
elements are used by OracleAS Wireless server to authorize the request.
<MSID>
element is the mobile station ID of the mobile device or user.
<TIME>
element indicates the time when this location is generated by a GPS. If this value is missing, the time when the data arrives at the OracleAS Wireless server is used.
<VELOCITY>
element specifies the velocity of the mobile device, in meters per second.
<BEARING>
element specifies the bearing angle, in degrees, clockwise from North.
<ALTITUDE>
element specifies the altitude of the mobile device, in meters, above sea level.
Here is an example showing how to set and get a position to OracleAS Wireless server using the SOAP client:
MPSoapClient mpsc = new MPSoapClient("http://usunnab16.us.oracle.com:5555/location/webservices", "urn:MobilePositionServer"); String xmlReq = "<?xml version= '1.0' encoding='ISO-8859-1' standalone='yes'?>\n" + "<MP_GPS>\n" + "<MSID>6038973096</MSID>\n" + "<POS>\n" + "<LAT>42.1576</LAT>\n" + "<LONG>-122.34</LONG>\n" + "</POS>\n"+ "</MP_GPS>"; System.out.println(mpsc.setPosition(xmlReq)); // NOTE: Need to change getPosition call// double[] ret = mpsc.getPositionSimple("", "", "6038973096"); System.out.println(ret[0] + "," + ret[1]);
The LBS web services API on the client side is virtually identical to the API within OracleAS Wireless server. The following examples demonstrate this. The most relevant difference is that a set()
function must specify the server. Within OracleAS Wireless server, an application would not be required to specify such a target server.
Geocoding supports these functions:
The following example shows the geocoding operation:
... public static void main(String args[]) { SpatialManager.set( "http://mhorhamm-us.us.oracle.com:9000/studio/soap/servlet/soaprouter", "your username", "your password"); Location locs[] = SpatialManager.getGeocoder().geocodeAddress( new LocationImpl( new PointImpl(0, 0), "Oracle", "1", new String[] { "Oracle Dr" }, "", "Nashua", "NH", "03062", "", "US"), ""); if(locs != null) { for(int i = 0; i < locs.length; i++) System.out.println(i + ": " + locs[i]); } else System.out.println("null"); }
Mapping supports these functions:
The following example shows the mapping with one marked point:
... public static void main(String args[]) { SpatialManager.set( "http://mhorhamm-us.us.oracle.com:9000/studio/soap/servlet/soaprouter", "your username", "your password"); Location adr1[] = SpatialManager.getGeocoder().geocodeAddress( new LocationImpl( new PointImpl(0, 0), "NEDC", "1", new String[] { "Oracle Dr" }, "", "Nashua", "NH", "03062", "", "US"), ""), adr2[] = SpatialManager.getGeocoder().geocodeAddress( new LocationImpl( new PointImpl(0, 0), "HQ", "500", new String[] { "Oracle Parkway" }, "", "Redwood City", "CA", "94065", "", "US"), ""); System.out.println( SpatialManager.getMapper().getMapURL( adr1[0], ImageFormats.GIF, 800, 600, false)); ... } ...
The Driving Directions component supports these functions:
The following example shows the driving direction between two addresses:
... public static void main(String args[]) { SpatialManager.set( "http://mhorhamm-us.us.oracle.com:9000/studio/soap/servlet/soaprouter", "your username", "your password"); Location adr1[] = SpatialManager.getGeocoder().geocodeAddress( new LocationImpl( new PointImpl(0, 0), "NEDC", "1", new String[] { "Oracle Dr" }, "", "Nashua", "NH", "03062", "", "US"), ""), adr2[] = SpatialManager.getGeocoder().geocodeAddress( new LocationImpl( new PointImpl(0, 0), "HQ", "500", new String[] { "Oracle Parkway" }, "", "Redwood City", "CA", "94065", "", "US"), ""); ////////////////////////////////////////////////////////////////// RoutingSettings settings = new RoutingSettings(true, false); settings.setSecondaryOption(RoutingOption.maneuverMapWidth, "800"); settings.setSecondaryOption(RoutingOption.maneuverMapHeight, "600"); settings.setSecondaryOption(RoutingOption.overviewMapWidth, "800"); settings.setSecondaryOption(RoutingOption.overviewMapHeight, "600"); System.out.println( SpatialManager.getRouter().computeRoute( adr1[0], adr2[0], null, settings, Locale.US)); }
The Business Directory component supports these functions:
The following example shows several categories and businesses with a given name:
public static void main(String args[]) { SpatialManager.set( "http://mhorhamm-us.us.oracle.com:9000/studio/soap/servlet/soaprouter", "your username", "your password"); ////////////////////////////////////////////////////////////////// System.out.println(SpatialManager.getYPFinder().getCategoryAtRoot()); System.out.println(SpatialManager.getYPFinder().getCategoryAtPath(new String[0])); YPCategory cats[] = SpatialManager.getYPFinder().getCategoryAtRoot().getSubCategories(); if(cats != null) for(int i = 0; i < cats.length; i++) System.out.println(i + ": " + cats[i]); ////////////////////////////////////////////////////////////////// YPBusiness b[] = SpatialManager.getYPFinder().getBusinessesAnywhere( "Border", Locale.US); for(int i = 0; i < b.length; i++) System.out.println(i + ": " + b[i]); }
OracleAS Wireless WDK provides a log file to help you develop wireless applications. This section provides a detailed explanation of the information logged in the WDK log file.
The amount of information that is logged in the log file can be configured by changing the wdk.log.level parameter in WEB-INF/web.xml. The possible values for this parameter, with the amount of information being most to least, are: debug, info, warning, and error. The default value of this parameter is info. At this level, the kinds of information that are logged to the log file are:
When debug log level is used, more log messages are produced. The debug messages are:
The following excerpt from the WDK log file in debug log level is for a single successful request-response cycle using UP Simulator 4.1.1.
The header includes:
127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] **************** Start of serving request *************** 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] Request URL: http://localhost:9010/wdk/mcslite/ 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] Request HTTP headers received from client: user-agent: OWG1 UP/4.1.20a UP.Browser/4.1.20a-XXXX UP.Link/4.1.HTTP-DIRECT x-upfax-accepts: none x-up-devcap-max-pdu: 2984 x-up-devcap-iscolor: 0 x-up-devcap-numsoftkeys: 2 accept: application/x-hdmlc, application/x-up-alert, application/x-up-cacheop, application/x-up-device, application/x-up-digestentry, application/vnd.wap.wml, text/x-wap.wml, text/vnd.wap.wml, application/vnd.wap.wmlscript, text/vnd.wap.wmlscript, application/vnd.uplanet.channel, application/vnd.uplanet.list, text/x-hdml, text/plain, image/vnd.wap.wbmp, image/bmp, application/remote-printing text/x-hdml;version=3.1, text/x-hdml;version=3.0, text/x-hdml;version=2.0, image/bmp, text/html x-up-devcap-smartdialing: 1 x-up-devcap-msize: 8,18 accept-charset: ISO-8859-1, UTF-8, * x-up-devcap-screenpixels: 171,108 host: localhost:9010 accept-language: en x-up-devcap-screendepth: 1 content-type: application/x-www-form-urlencoded x-up-devcap-charset: ISO-8859-1 x-up-subno: rhalimma_st3010pc cookie: JSESSIONID=fe88712959d4470794599b62102e61df x-up-devcap-immed-alert: 1 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] Request HTTP headers sent to back end application: x-oracle-user.location.addresslastline: Room 200 x-oracle-service.home.url: http://localhost:9000/omsdk/rm x-up-devcap-screendepth: 1 host: localhost:9010 x-up-devcap-numsoftkeys: 2 x-oracle-user.deviceid: 1234 x-oracle-orig-user-agent: OWG1 UP/4.1.20a UP.Browser/4.1.20a-XXXX UP.Link/4.1.HTTP-DIRECT accept: application/vnd.oracle.xhtml+xforms, text/vnd.oracle.mobilexml, application/vnd.wap.xhtml+xml, application/xhtml+xml;profile="http://xmlns.oracle.com/ias/dtds/xhtml+xforms", application/xhtml+xml;profile="http://www.wapforum.org/xhtml", application/xhtml+xml, application/xml, text/xml, application/vnd.oracle.xad, */*, */* x-oracle-service.parent.url: http://localhost:9000/omsdk/rm x-oracle-user.location.addressline2: Apt# 1004 x-oracle-user.location.addressline1: 1007 Broadway St x-oracle-user.location.block: Block A x-oracle-user.locale: US x-oracle-user.authkind: unauthenticated x-oracle-user.displayname: Jon Smith x-oracle-user.location.type: profile x-up-devcap-max-pdu: 2984 x-oracle-user.userkind: registered x-up-devcap-iscolor: 0 x-up-devcap-screenpixels: 171,108 x-oracle-mcs.character.encoding: UTF-8 x-oracle-user.location.postalcodeext: 3158 accept-charset: ISO-8859-1, UTF-8, * accept-charset: UTF-8, * x-oracle-user.location.companyname: Company XYZ x-oracle-home.url: http://localhost:9000/omsdk/rm cookie: JSESSIONID=fe88712959d4470794599b62102e61df x-up-devcap-immed-alert: 1 x-oracle-module.callback.url: http://localhost:9000/omsdk/rm x-upfax-accepts: none x-up-devcap-smartdialing: 1 user-agent: PTG/2.0 (Oracle9iAS Wireless 9.0.4.0; media="handheld"; paged="1") x-oracle-user.location.postalcode: 94104 x-up-devcap-msize: 8,18 x-oracle-user.location.city: San Francisco x-oracle-user.location.country: USA content-type: application/x-www-form-urlencoded x-oracle-user.name: jsmith x-oracle-user.location.y: 200.8 x-oracle-user.location.x: 135.9 x-oracle-user.location.county: San Francisco x-oracle-orig-accept: application/x-hdmlc, application/x-up-alert, application/x-up-cacheop, application/x-up-device, application/x-up-digestentry, application/vnd.wap.wml, text/x-wap.wml, text/vnd.wap.wml, application/vnd.wap.wmlscript, text/vnd.wap.wmlscript, application/vnd.uplanet.channel, application/vnd.uplanet.list, text/x-hdml, text/plain, image/vnd.wap.wbmp, image/bmp, application/remote-printing text/x-hdml;version=3.1, text/x-hdml;version=3.0, text/x-hdml;version=2.0, image/bmp, text/html x-up-subno: rhalimma_st3010pc accept-language: en x-up-devcap-charset: ISO-8859-1 x-oracle-module.callback.label: Home x-oracle-user.location.state: CA 127.0.0.1 - - fe88712959d4470794599b62102e61df - - DEBUG : [Fri, 23 May 2003 10:41:11 PDT] Back end URL: http://localhost:9010/mcs/examples/index.jsp 127.0.0.1 - - fe88712959d4470794599b62102e61df - - DEBUG : [Fri, 23 May 2003 10:41:11 PDT] Back end response code: 200 ; response message: OK 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] Response HTTP headers received from back end application: x-oracle-wireless.referer.url: http://localhost:9010/mcs/examples/index.jsp content-type: application/vnd.oracle.xhtml+xforms; charset=UTF-8 x-oracle-wireless.base.url: http://localhost:9010/mcs/examples/index.jsp connection: Close date: Fri, 23 May 2003 17:41:10 GMT server: Oracle9iAS (9.0.3.0.0) Containers for J2EE content-length: 994 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] XML Result from backend: <?xml version = "1.0" encoding = "UTF-8" standalone="yes" ?> <html profile="http://xmlns.oracle.com/ias/dtds/xhtml+xforms/0.9.0/1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:style="urn:oracle:iasw-internal:style.1.0" xmlns:extra="urn:oracle:iasw-internal:mxml.1.0"> <head> <title>Oracle9iAS Wireless Examples</title> <style type="text/css"> .title {font-style: italic; color: blue; font-size: xx-large} .menu {font-style: italic; color: blue; font-size: x-large} li {font-weight: bold; color: blue} </style> </head> <body> <nl style="list-style-type: decimal"> <label class="title">Oracle9iAS Wireless Examples</label> <li class="menu" href="xhtml%2Bxforms/index.jsp">XHTML+XFroms Examples</li> <li class="menu" href="xhtml%2Bmp/index.jsp">XHTML MP Examples</li> <li class="menu" href="mobile-xml/index.jsp">MobileXML Examples</li> </nl> </body> </html> 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] XML content info - Type: XHTML, version: 0.9.0 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] Transformer that will be used: xforms-wml11-openwave 127.0.0.1 - - fe88712959d4470794599b62102e61df - - DEBUG : [Fri, 23 May 2003 10:41:11 PDT] The XML passed to transformer: <html profile="http://xmlns.oracle.com/ias/dtds/xhtml+xforms/0.9.0/1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:style="urn:oracle:iasw-internal:style.1.0" xmlns:extra="urn:oracle:iasw-internal:mxml.1.0" xmlns:mxml="http://xmlns.oracle.com/2002/MobileXML" style:mheight="0mm" style:mwidth="0mm" style:word-spacing="normal" style:padding-top="0" style:text-align="justify" style:border-top-color="#000000" style:border-right-style="none" style:font-size="medium" style:padding-bottom="0" style:margin-right="0" style:list-style-type="disc" style:vertical-align="baseline" style:border-bottom-color="#000000" style:pause-after="none" style:width="0px" style:speech-rate="default" style:border-left-width="medium" style:speak="normal" style:float="none" style:text-decoration="none" style:padding-right="0" style:border-right-color="#000000" style:list-style-image="none" style:background-attachment="scroll" style:clear="none" style:stress="none" style:font-family="serif,san-serif" style:margin-top="0" style:letter-spacing="normal" style:font-variant="normal" style:border-top-width="medium" style:margin-bottom="0" style:border-left-style="none" style:speak-numeral="none" style:background-image="none" style:pause-before="none" style:volume="default" style:border-bottom-width="medium" style:pitch="default" style:text-transform="none" style:list-style-position="outside" style:padding-left="0" style:margin-left="0" style:border-right-width="medium" style:color="#000000" style:text-indent="0" style:border-top-style="none" style:border-left-color="#000000" style:height="0px" style:font-weight="400" style:background-repeat="repeat" style:font-style="normal" style:pitch-range="default" style:border-bottom-style="none" style:voice-family="neutral" style:speak-header="once" style:display="inline" extra:iaswhref="http://localhost:9010/wdk/mcslite/?PAckey=4!" extra:newdoc="true"><extra:param extra:name="PAckey" extra:value="4!" extra:hidden="true"/> <head style:border-left-width="medium" style:border-left-style="none" style:border-left-color="#000000" style:display="inline"><extra:messages/><extra:patparams/> <title style:border-left-width="medium" style:border-left-style="none" style:border-left-color="#000000" style:display="inline">Oracle9iAS Wireless Examples</title> <style type="text/css" style:border-left-width="medium" style:border-left-style="none" style:border-left-color="#000000" style:display="inline"> .title {font-style: italic; color: blue; font-size: xx-large} .menu {font-style: italic; color: blue; font-size: x-large} li {font-weight: bold; color: blue} </style> <extra:displaypage page="1" deck="1"/></head> <body __length__="13" style:border-left-width="medium" style:border-left-style="none" style:border-left-color="#000000" style:display="block" extra:emwidth="0" extra:pxwidth="0" extra:emheight="0" extra:pxheight="0" extra:random="30274" extra:softkeys="2" extra:paged="true"><extra:page page="1" pagelength="342" deck="1" extra:expand="true"> <nl style="list-style-type: decimal" __length__="70" style:white-space="nowrap" style:list-style-type="decimal" style:border-left-width="medium" style:margin-top="0.5em" style:margin-bottom="0.5em" style:border-left-style="none" style:border-left-color="#000000" style:display="block" extra:uid="XF1" extra:expand="true"> <label class="title" __length__="53" style:border-top-color="#0000ff" style:font-size="xx-large" style:border-bottom-color="#0000ff" style:border-left-width="medium" style:border-right-color="#0000ff" style:margin-top="0" style:margin-bottom="0" style:border-left-style="none" style:color="#0000ff" style:border-left-color="#0000ff" style:font-style="italic" style:display="inline">Oracle9iAS Wireless Examples</label> <li class="menu" href="xhtml%2Bxforms/index.jsp" __length__="78" extra:abshref="http://localhost:9010/mcs/examples/xhtml%2Bxforms/index.jsp" extra:iaswhref="/wdk/mcslite?PAckey=5!" extra:iaswphref="/wdk/mcslite?PAckey=%PAckey!" extra:iaswpkhref="5" style:border-top-color="#0000ff" style:font-size="x-large" style:border-bottom-color="#0000ff" style:border-left-width="medium" style:text-decoration="underline" style:border-right-color="#0000ff" style:margin-top="0" style:margin-bottom="0" style:border-left-style="none" style:color="#0000ff" style:border-left-color="#0000ff" style:font-weight="700" style:font-style="italic" style:display="list-item">XHTML+XFroms Examples</li> <li class="menu" href="xhtml%2Bmp/index.jsp" __length__="70" extra:abshref="http://localhost:9010/mcs/examples/xhtml%2Bmp/index.jsp" extra:iaswhref="/wdk/mcslite?PAckey=6!" extra:iaswphref="/wdk/mcslite?PAckey=%PAckey!" extra:iaswpkhref="6" style:border-top-color="#0000ff" style:font-size="x-large" style:border-bottom-color="#0000ff" style:border-left-width="medium" style:text-decoration="underline" style:border-right-color="#0000ff" style:margin-top="0" style:margin-bottom="0" style:border-left-style="none" style:color="#0000ff" style:border-left-color="#0000ff" style:font-weight="700" style:font-style="italic" style:display="list-item">XHTML MP Examples</li> <li class="menu" href="mobile-xml/index.jsp" __length__="71" extra:abshref="http://localhost:9010/mcs/examples/mobile-xml/index.jsp" extra:iaswhref="/wdk/mcslite?PAckey=7!" extra:iaswphref="/wdk/mcslite?PAckey=%PAckey!" extra:iaswpkhref="7" style:border-top-color="#0000ff" style:font-size="x-large" style:border-bottom-color="#0000ff" style:border-left-width="medium" style:text-decoration="underline" style:border-right-color="#0000ff" style:margin-top="0" style:margin-bottom="0" style:border-left-style="none" style:color="#0000ff" style:border-left-color="#0000ff" style:font-weight="700" style:font-style="italic" style:display="list-item">MobileXML Examples</li> </nl> </extra:page></body> </html> 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] Mobile WDK Response: Content-Type: text/vnd.wap.wml; charset=UTF-8 Content-Length: 1384 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE wml PUBLIC "-//PHONE.COM//DTD WML 1.1//EN" "http://www.phone.com/dtd/wml11.dtd"> <wml><head><meta http-equiv="Cache-Control" forua="true" content="max-age=10"/></head><template><do type="accept" name="do_accept" label="Ok"><refresh/></do></template><card><onevent type="onenterforward"><go href="#ID117"/></onevent><onevent type="onenterbackward"><prev/></onevent></card><card id="ID117" title="Oracle9iAS Wireless Examples"><p mode="nowrap"><big><i>Oracle9iAS Wireless Examples</i></big><select name="mID117"><option value="5">XHTML+XFroms Examples</option><option value="6">XHTML MP Examples</option><option value="7">MobileXML Examples</option><option title="Ok">[Back]<onevent type="onpick"><prev/></onevent></option></select><do type="accept" name="do_accept" label="Ok"><go href="#_ nav"><setvar name="_h" value="$(mID117)"/></go></do></p></card><card id="_nav" onenterforward="/wdk/mcslite?PAckey=$(_h)!"><onevent type="onenterbackward"><prev/></onevent></card><card id="_form"><onevent type="onenterforward"><go method="post" href="http://localhost:9010/wdk/mcslite/?r=30274"><postfield name="PAckey" value="4!"/><postfield name="$(_ sb)" value="$(_sv)"/><postfield name="PATpage" value="$(PATpage)"/><postfield name="PATdeck" value="$(PATdeck)"/></go></onevent><onevent type="onenterbackward"><prev/></onevent></card></wml> 127.0.0.1 - - fe88712959d4470794599b62102e61df - - INFO : [Fri, 23 May 2003 10:41:11 PDT] **************** End of serving request ***************
This section explains some of the common mistakes encountered in the WDK:
Correct: http://localhost:9010/wdk/mcslite/http/somehost/9090/myapp/first.jsp
Incorrect: http://localhost:9010/wdk/mcslite/http/somehost/9090/myap/first.jsp
When an incorrect URL is used, the user will get an error page with a detailed explanation of the cause (in this case, 404 Not Found).
The value of back-end URL can be checked in the log file under Back end URL.
Sample log entries:
127.0.0.1 - - 3b34912b68474bc1b1defa87e74dbd1e - - DEBUG : [Fri, 23 May 2003 11:06:45 PDT] Back end URL: http://localhost:9010/mcs/examples/mobile-xmll/index.jsp 127.0.0.1 - - 3b34912b68474bc1b1defa87e74dbd1e - - DEBUG : [Fri, 23 May 2003 11:06:45 PDT] Back end response code: 404 ; response message: Not Found 127.0.0.1 - - 3b34912b68474bc1b1defa87e74dbd1e - - ERROR : [Fri, 23 May 2003 11:06:45 PDT] javax.servlet.ServletException: HTTP(S) Error: 404 : Not Found
The value of content type that is received from the back-end application can be checked from the log file under Response HTTP headers received from back-end application.
Sample log entries:
127.0.0.1 - - 3b34912b68474bc1b1defa87e74dbd1e - - INFO : [Fri, 23 May 2003 10:59:27 PDT] Response HTTP headers received from back end application: x-oracle-wireless.referer.url: http://localhost:9010/mcs/examples/index.jsp content-type: application/vnd.oracle.xhtml+xforms; charset=UTF-8 x-oracle-wireless.base.url: http://localhost:9010/mcs/examples/index.jsp connection: Close date: Fri, 23 May 2003 17:59:27 GMT server: Oracle9iAS (9.0.3.0.0) Containers for J2EE content-length: 994
The XML content from back-end applications can be checked from the log file under XML Result from backend.
Sample log entries:
127.0.0.1 - - 3b34912b68474bc1b1defa87e74dbd1e - - INFO : [Fri, 23 May 2003 11:00:50 PDT] XML Result from backend: <?xml version = "1.0" encoding = "UTF-8" standalone="yes" ?> <html profile="http://xmlns.oracle.com/ias/dtds/xhtml+xforms/0.9.0/1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:style="urn:oracle:iasw-internal:style.1.0" xmlns:extra="urn:oracle:iasw-internal:mxml.1.0"> <head> <title>Oracle9iAS Wireless Examples</title> <style type="text/css"> .title {font-style: italic; color: blue; font-size: xx-large} .menu {font-style: italic; color: blue; font-size: x-large} li {font-weight: bold; color: blue} </style> </head> <body> <nl style="list-style-type: decimal"> <label class="title">Oracle9iAS Wireless Examples</label> <li class="menu" href="xhtml%2Bxforms/index.jsp">XHTML+XFroms Examples</li> <li class="menu" href="xhtml%2Bmp/index.jsp">XHTML MP Examples</li> <li class="menu" href="mobile-xml/index.jsp">MobileXML Examples</li> </nl> <body> </html> 127.0.0.1 - - 3b34912b68474bc1b1defa87e74dbd1e - - ERROR : [Fri, 23 May 2003 11:00:50 PDT] oracle.wireless.sdk.SdkException: The xml could not be parsed. It contains invalid xml.
This tutorial takes you through the process of setting up a OracleAS Wireless development environment on your laptop or desktop using the Wireless Developer's Kit (WDK). You will take a few existing applications and run them in your environment.
Note: The WDK and simulators can be downloaded from http://otn.oracle.com/tech/wireless/tools/content.html. |
The WDK is a small runtime environment of OracleAS Wireless. It includes the Multi-Channel Server of OracleAS Wireless for device adaptation and multi-media adaptation allowing you to build and test wireless applications.
The following steps take you through the WDK environment setup.
You must modify the following WDK files:
WDK_INSTALL_DIR/wireless/j2ee/config/oc4j.properties
WDK_INSTALL_DIR/wireless/j2ee/config/global-web-application.xml
The entries: __REPLACE_WITH_IASW_HOME_PATH__, must be replaced with the absolute path to the WDK_INSTALL_DIR. Use the slash (/) for the directory separator, even in Microsoft Windows. For example, if the WDK is installed in d:\wdk, then replace __REPLACE_WITH_IASW_HOME_PATH__ with d:/wdk.
wdk.bat
(in wdk9041/j2ee/home/wdk.bat) to start the Wireless environment. At first startup, some files will be unpacked. After starting, a messaging appears stating the Containers for J2EE have initialized.
ctrl-C
, and answer Yes. Restart the environment as in Step 1 above.
There are two main URLs that you need to know for the Wireless Development Kit: the URL to access your application and the URL to view the logs.
http://<host_name>:9010/wdk/mcslite/http/<host_name>/9010/examples/<app_name>
For example, http://localhost:9010/wdk/mcslite/http/localhost/9010/examples/mobile-xml/Hello.jsp. Use this URL to access the Hello World example with your PC browser or your mobile device simulator. This is a simple demo to test your WDK.
The code for the Hello World application is in the following directory of the WDK: D:\wdk9041\wireless\j2ee\applications\wdk\examples-web\mobile-xml. You will not be able to see the examples code until you start the WDK for the first time and the WDK unpackages the examples.
Explanation of the URL: the WDK enables Wireless access to your application even if the application is not running in the WDK environment. The first part of the URL (http://localhost:9010/wdk/mcslite/http/), means that you want to access a wireless application with the WDK. The second part the URL (localhost/9010/examples/mobile-xml/Hello.jsp), is the URL of your application.
If your application was located on Geocities, the full URL would be http://localhost:9010/wdk/mcslite/http/www.geocities.com/myaccount/Hello.jsp.
http://<host_name>:9010/wdk/log. For example, http://localhost:9010/wdk/log. This provides the full error logs on requests to the WDK. Try this URL in your PC browser to view the log of your Hello World application; scroll down to the bottom to view the newest log output.
OracleAS Wireless includes multi-media adaptation capabilities. If an application includes a GIF image, the server will automatically resize and convert the image to the appropriate format. For example, a GIF will be converted to WBMP format for a WAP phone. The following example will show an Oracle logo image on multiple devices. Copy and paste this URL into your PC browser, color phone, or black and white phone to see the images.
http://localhost:9010/wdk/mcslite/http/localhost/9010/examples/mobile-xml/ImageExample.jsp
|
![]() Copyright © 2003 Oracle Corporation. All Rights Reserved. |
|