com.spedmo.sms
Class SpedmoMessageService

java.lang.Object
  extended by com.spedmo.sms.SpedmoMessageService

public class SpedmoMessageService
extends Object

 Spedmo (http://www.spedmo.com) Java SMS service. Connects to the Spedmo using web services (SOAP) to
 send sms messages.
 
 Simple to use... be sure to have an internet connection and write some code a bit like this
 
                SpedmoMessageService messageService = new SpedmoMessageService();
                messageService.setUsername("spedmo");
                messageService.setSoapCode("1234");             
                messageService.createSms("61401234567", "Message #1");  // Create a SMS to send
                messageService.createSms("61401234567", "Message #2");  // Make another one
                messageService.createSms(....); // etc.
                messageService.send("61401234567");     // Send the SMS's from this number via Internet
 
 


Constructor Summary
SpedmoMessageService()
          Spedmo Message Service Constructor
SpedmoMessageService(String username, String soapCode)
          Spedmo Message Service Constructor
 
Method Summary
 void createSms(String number, String text)
          Create a sms message and add it to the queue.
 Integer getReturnCode()
          Return the code from the server.
 String getReturnCodeDefinition()
          Return the code definition.
 void send(String fromNumber)
          Service connector.
 void setSoapCode(String soapCode)
          Set the soap code for the connection
 void setUsername(String username)
          Set the username for the connection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpedmoMessageService

public SpedmoMessageService(String username,
                            String soapCode)
Spedmo Message Service Constructor

Parameters:
username - Spedmo username - This is the same username which you use to log into http://www.spedmo.com
soapCode - Spedmo soap code - This can be obtained by visiting http://www.spedmo.com and signing up for a mobile account.

SpedmoMessageService

public SpedmoMessageService()
Spedmo Message Service Constructor

Method Detail

setUsername

public void setUsername(String username)
Set the username for the connection

Parameters:
username - Your Spedmo username. This is the same username which you use to log into http://www.spedmo.com

setSoapCode

public void setSoapCode(String soapCode)
Set the soap code for the connection

Parameters:
soapCode - Your soap code. This can be obtained by visiting http://www.spedmo.com and signing up for a mobile account.

createSms

public void createSms(String number,
                      String text)
               throws SpedmoException
Create a sms message and add it to the queue.

Parameters:
number - The mobile (cell) number which will be the recipient. Numbers should be a string of digits only. +61-41-123-4567 should be represented at "61411234567" for example.
text - The text of the sms. 160 characters per sms.
Throws:
SpedmoException - Thrown in the event that an error occurs.

send

public void send(String fromNumber)
          throws SpedmoException
Service connector. Send sms's which have been created in the queue.

Parameters:
fromNumber - The mobile (cell) number which will be the sender. Numbers should be a string of digits only. +61-41-123-4567 should be represented at "61411234567" for example.
Throws:
SpedmoException - Thrown in the event that an error has occured.

getReturnCodeDefinition

public String getReturnCodeDefinition()
Return the code definition.

Returns:
String value. Null if no code has been returned.

getReturnCode

public Integer getReturnCode()
Return the code from the server.

Returns:
Integer code value. Null if no code has been returned.


Copyright © 2007 Spedmo. All Rights Reserved.