0845 356 5758
or

Java SMS SDK

The Esendex SDK contains a Java library that you can use within your applications. The library contains classes that enables you to send text messages, query the status of a messages, retrieve messages from your Inbox and get information about your account. Please see our Downloads section for the latest version of the SDK.

Java Runtime Compatibility

The Java library has been compiled and tested against Java 5.0 Update 6. The source code and build files are provided in the SDK and these can be used to generate a library for earlier versions of the Java runtime, if required.

Notes

The service aliasing feature within the SendMessageFull and SendMessageMultipleRecipientsFull methods on the SendServiceSoap class is not available with Evaluation or Premium accounts. When using these methods, you must set the originator parameter to your account address or you will receive an error when sending a message.

Using the Java SDK in your Code

To use the library, import the Esendex classes as follows:

import com.esendex.sdk.ems.soapinterface.*;

You can then send a message as follows:

EsendexHeader header = new EsendexHeader("MyUserName", "MyPassword", "MyAccount");
SendServiceLocator locator = new SendServiceLocator();
SendServiceSoap _BindingStub service = (SendServiceSoap_BindingStub)locator.getSendServiceSoap();
service.setHeader(header);
service.sendMessage("441234567890", "Hello", MessageType.Text);

Sample Code

You can find the following code samples in the Java folder within the Esendex SDK:

  • Clients - Simple applications which demonstrate how to use each of the Esendex services listed above.
  • Send Message - A simple application that sends an SMS message.
  • Send WAP Push - A simple application that sends a WAP push.
  • Inbox - Monitors your inbox for incoming SMS messages.

Notes

  • The naming convention for client stub classes has changed in this release. In previous versions of the SDK the name was in the form XXXXSoapStub, whereas in this release they are now XXXSoap_BindingStub. Client applications built against the previous version of the SDK will need to be modified accordingly.

Supported Services

  • SendService - Methods to send SMS messages individually and in batches
  • SendContentService - Methods to send SMS messages for delivering content, eg WAP Push, individually and in batches
  • ScheduledSendService - Methods to schedule an SMS to be sent at a specific time. and in batches
  • InboxService - Monitors your inbox for incoming SMS messages
  • InboxService2 - Additionally allows you to monitor your inbox for the latest messages
  • ContactService - Contact and Contact Group management functionality
  • AccountService - Account management functionality