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.
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.
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.
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);
You can find the following code samples in the Java folder within the Esendex SDK: