mgw client api how to easily integrate messaging into your application

9
MGW client API How to easily integrate messaging into your application

Upload: sydney-holt

Post on 29-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: MGW client API How to easily integrate messaging into your application

MGW client API

How to easily integrate messaging into your application

Page 2: MGW client API How to easily integrate messaging into your application

Transport (sending/receiving) of:

• SMS messages• MMS messages• binary SMS messages (e.g. WAP Push service indication)• LBS messages (location based services)

MGW Client API Offers

Page 3: MGW client API How to easily integrate messaging into your application

MGW client API uses ParlayX web services as transport protocol.(www.parlay.org)

There are two libraries:

• Java MGW client API• Microsoft .NET MGW client API (written in C#)

Technologies & Standards

Page 4: MGW client API How to easily integrate messaging into your application

Download latest Java and Microsoft .NET libraries from here:

https://support.tiskis.com/confluence/display/download

Getting Started

Page 5: MGW client API How to easily integrate messaging into your application

Java requirements:

• Operating system: independent• Java SDK version 1.4.x or version 1.5.x (http://java.sun.com)• Apache Ant tool version 1.6.x (http://ant.apache.org)

Microsoft .NET requirements:

• Operating system: MS Windows 98, 2000, 2003, XP• .NET framework• Visual Studio .NET

Compiling & Running The Samples

Page 6: MGW client API How to easily integrate messaging into your application

Compiling & Running The Samples

Java sample: sms-test

• Unzip mgw-client-x.x.x.zip to a working directory

• Using command line, browse to samples/sms-test

• Read the file: readme.txt to get some quick info about the sample

• Open conf.properties file and adjust the configuration parameters properly

• To compile the sample type 'ant compile' and press ENTER

• To run the sample type 'ant run' and press ENTER

• You'll be prompted to enter a message text and an MSISDN to send to

Page 7: MGW client API How to easily integrate messaging into your application

Programming

Java programming

Read the user guide document: docs/UserGuide.html and follow the instructionsGet yourself in common with the API, read the JavaDoc: docs/api/index.html

/*** Creates an SMS message using the given parameters* and send it to the given recipient's MSISDN*/public void send(String text, String recipient)throws Exception{

Message message = new SmsMessage(text);messageManager.sendMessage("none", message, originator, new String[]

{recipient}, Priority.DEFAULT, null);}

Page 8: MGW client API How to easily integrate messaging into your application

Programming

Java programming

Make some initialization on the application startup/**

* Instantiates and initializes all needed service objects and parameters* which MGW client library uses to send messages.*/public void init(String confFilePath)throws FileNotFoundException, IOException{

Properties conf = new Properties();conf.load(new FileInputStream(confFilePath));

originator = conf.getProperty("originator");SingleRouteCredentialsHandlerImpl credentialsHandler = new

SingleRouteCredentialsHandlerImpl();credentialsHandler.setUsername(conf.getProperty("userName"));credentialsHandler.setPassword(conf.getProperty("userPassword"));

//messageManager is preferable to be a singleton instance in your business application.

MessageManagerImpl mm = new MessageManagerImpl();mm.setSendMessagePortURL(conf.getProperty("sendMessagePortURL"));mm.setRouteCredentialsHandler(credentialsHandler);messageManager = mm;

}

Page 9: MGW client API How to easily integrate messaging into your application

MGW Client API

Thank you for your attention