Integrating Openwave WAP Push Library, Java Edition , with IBM Websphere Studio
If you are using IBM Websphere Studio to create push-enabled mobile applications that use the WAP Push standard and that target mobile phones, the Openwave WAP Push Library, Java Edition simplifies your programming tasks by encapsulating the WAP 1.2.1 Push Access Protocol (PAP).
WAP Push Library Basics
The WAP Push Library is a Java package composed of classes that encapsulate the most useful aspects of Push Access Protocol (PAP) communication, including Push Submission and response, content building, and exception handling. The WAP Push Library hides the details of PAP communication, building all required XML or multipart/related documents internally, forming the completed HTTP transaction, and embodying the transport layer security, either Secure Sockets Layer (SSL) or Transport Layer Security (TLS), used to protect a transmission. The WAP Push Library dramatically simplifies the process of building PAP applications. As a developer, you do not need to know any of the details of the XML or multipart/related documents that make up a Push Submission. All of the elements needed to build a well-formed Push Submission are required parameters of the various WAP Push Library class constructors, making it impossible to forget any of the necessary elements. The WAP Push Library includes classes that parse all of the XML documents the PPG sends in response to a Push Submission, making it easy for your applications to provide detailed information to users. This chapter provides an overview of the major WAP Push Library classes and how they correspond to specific PAP entities.
For more information about how to use the WAP Push standard to build compelling push-enabled mobile applications, see the Openwave Developer Web site.
WAP Push Library Package Overview
When you install the WAP Push Library, the following components are available:
Libraries
wappush.jar
The wappush.jar file contains the WAP Push Library Java package and accompanying JavaDoc API documentation. This package provides all of the functionality you need to create push applications and services. The WAP Push Library package includes the SimplePush class, which you can use to create simple PAP applications quickly. The SimplePush class consists of a series of methods that encapsulate essential WAP Push Library functionality, greatly reducing the amount and complexity of code required to develop PAP applications.
servlet.jar
The servlet.jar file is part of Tomcat. It is included with the WAP Push Library so you can compile the Travel demo source code using the build.xml file, without having to insert servlet.jar into your classpath environment variable.
NOTE The Tomcat software was developed by the Apache Software Foundation
Getting Started
xerces.jar
Xerces is a general purpose XML parser used by the WAP Push Library.
NOTE The Xerces library software was developed by the Apache Software
Foundation (http://www.apache.org).
Tools and Utilities
PushIT
PushIT is a Java tool that you can use to submit push operations and review the results. Using the PushIT GUI, you can quickly set the various parameters and content required by the Push Proxy Gateway and submit the operation. Complete source code can be found in the <installroot>\examples\PushIT\src\java directory.
For more information, refer to the Developer’s Guide for the Openwave WAP Push Library. You can find it within the Programs Menu or in the Docs directory of the WAP Push Library after you install the WAP Push Library.
Examples
The WAP Push Library includes an example application and source code that show you how to use the WAP Push Library APIs.
Travel
The Travel example depicts a web site at which users can make travel arrangements. This application uses the WAP Push Library APIs to alert users to changes in flight plans.
Source Code
The WAP Push Library includes the source code for the Travel example and PushIT. You can use the source code as a reference showing how to use the WAP Push Library APIs. The source code is located in the following directories:
• PushIT: <installroot>\examples\PushIT\src\java
• TravelDemo: <installroot>\examples\TravelDemo\src\java
WAP Push Developer Resources
Openwave provides a variety of developer support resources online including a quick start tutorial, a WAP Push developer’s page, and an application style guide.
Visit the Openwave Developer site at: http://developer.openwave.com/utils/redirect.cgi?ver=1&url=http://developer.openwave.com
Click the WAP Push link under the Products and Technology heading to access all of these resources.
Integrating Openwave WAP Push Library with IBM Websphere Studio
Requirements
Recommended for Testing with Device Simulators
The Openwave WAP Push Library, Java Edition 1.0, and the Openwave SDK 4.1.1, SDK 6.1, and SDK 6.2 are available for download at the Openwave Developer Web site.
Instructions:
1. Download, install, and integrate an Openwave simulator with WSAD according to the technical note found at the Openwave Developer Web site. The Openwave SDK will allow you to test your push application content on Openwave browser simulators. You will be able to view pushed messages generated by your application on these browser simulators.
2. Download and install the Openwave WAP Push Library, Java Edition 1.0, found at the Openwave Developer Web site. There you will also find instructions, called WAP Push Quick Start, on how to use a test Push Proxy Gateway hosted by Openwave to help you test your push applications. Refer to “WAP Push Library Package Overview” section below to determine the classes you need to get started. Details of how to build applications with the WAP Push Library can be found in the Developer’s Guide. You can find it within the Windows Programs menu or in the Docs directory of the WAP Push Library after you install the WAP Push Library.
3. Start WSAD.
4. Open or create a Java project that will target mobile devices.
5. From the File menu, select Import...
6. In the Import dialog box, select File System and click Next.
7. Choose the destination folder for the library classes you are about to import.
8.
Browse to find
the WAP Push Library.
If you installed the WAP Push Library in the default location, the path name
is:
" C:\Openwave\wappushjava1.0\lib"
9. Select the Jar files you need for your application (you will want to include wappushlib.jar at the very minimum).
10. Click Finish.