Skip to content
pr1001 edited this page Dec 10, 2011 · 6 revisions

OneAPI Release Notes / Installation Guide
These release notes cover the GSM Association OneAPI example implementation of the following components, which are available to download from the OneAPI github homepage. Note we have two branches: the head branch implements OneAPI v1 specifications, the OneAPI-2-1-beta branch adds asynchronous requests and callbacks.

Java library
An example Java library that can be used or enhanced to allow Java applications to interface more easily to a OneAPI server

PHP library
An example PHP library that can be used or enhanced to allow PHP applications to interface more easily to a OneAPI server

Java OneAPI test server
An example Java Servlet based server that accepts OneAPI requests and produces OneAPI responses (generally JSON)

Java/ JSP example pages
Simple JSP pages which allow OneAPI requests to be made and display the response information.

PHP example pages
Simple PHP pages which allow OneAPI requests to be made and display the response information. Note that the PHP examples are in the oneapi-2-1-beta branch, but will work to an extent on the head branch as well

Tutorials
OneAPI Java tutorial

This complete package provides an example working OneAPI server operating with Java or PHP client applications. The intention is that this can be used to build alternate client libraries, or any of the components can be used or enhanced to build development/ production OneAPI components.

Java Server
A complete Java web application (‘war’ file) has been built which combines the Java server and Java/JSP examples.
Pre-requisites

  1. Java development kit e.g. Sun/Oracle Java SE 6 JDK http://www.oracle.com/technetwork/java/javase/downloads
  2. Java servlet engine or application server such as Apache Tomcat (version 5 or version 6) available from Apache foundation

These are available for a variety of platforms including Windows, Linux, Mac OSX, Solaris

Once Tomcat or other servlet engine/ application server is installed and running – the Java web application (oneapiserver.war) can be copied into the ‘webapps’ folder.

Tomcat by default runs on port 8080. Use a web browser to make a request to http://localhost:8080/oneapiserver and you should see a home page for the Java/JSP examples.

The Java Server contains all dependent libraries required to support the OneAPI example server.
Tha Java source distribution contains everything needed to rebuild the Java server including Java JSP examples. This uses the Apache ant build tool.

Java example API
The Java example API is distributed as the file gsmoneapi.jar – though there are dependencies on a number of other library components:-

  • activation.jar
  • antlr-2.7.6.jar
  • asm.jar
  • commons-codec-1.4.jar
  • commons-collections-3.2.jar
  • commons-fileupload-1.2.1.jar
  • commons-httpclient-3.1.jar
  • commons-io-1.4.jar
  • commons-logging-1.1.jar
  • dom4j-1.6.1.jar
  • jackson-core-asl-1.7.0.jar
  • jackson-mapper-asl-1.7.0.jar
  • jdom.jar
  • jsp-api.jar
  • jta-1.1.jar
  • log4j-1.2.16.jar
  • mail.jar
  • servlet-api.jar

A copy of these has been included in the source package under the folder

WebContent/WEB-INF/lib

In addition there is a package of Javadoc reference documentation.

PHP Example API
This is distributed in two ways
  1. File oneapi-php.tar contains just the PHP API files
  2. File oneapi-php-examples.tar contains the PHP API files plus test page examples

When using the PHP API make sure your PHP page specifies the correct location for the PHP API by changing if necessary the line highlighted below. This will ensure all other OneAPI includes work correctly.

<?php 

$ONEAPICOMMON = dirname(__FILE__)."/oneapi/";

include ($ONEAPICOMMON.'endpoints/ServiceEndpoints.php');
include ($ONEAPICOMMON.'mms/MMSRetrieve.php');    

$endpoints=new ServiceEndpoints();

$receiver = new MMSRetrieve($endpoints, $username, $password);

$mmsResponse = $receiver->retrieveMessages($registrationId, 
							 $maxBatchSize);		
?>

Pre-requisites

  • PHP 5.2 or later (required for initial processing of JSON) (www.php.net)
  • PHP Curl extension
  • PEAR extension with the following PEAR libraries
  • Mail
  • Mail_Mime
  • Mail_mimeDecode

See the PHP documentation at http://www.php.net and http://pear.php.net for installation and configuration instructions.

Note that there is a package (XAMPP) of the Apache Web Server, PHP and MySQL available for various platforms available from http://www.apachefriends.org

Clone this wiki locally