Examples of SMSEngine


Examples of ru.headhunter.smsengine.client.SMSEngine

public class SMSEngineServiceWorkTest {

    public static void main(String[] args) throws Exception {
        HessianProxyFactory factory = new HessianProxyFactory();
        SMSEngine engine = (SMSEngine) factory.create(SMSEngine.class, "http://localhost:9292/sms-engine/service");
        try {
            engine.sendSMS("79053673205", "sms sending test");
            System.out.println("sms sent");
            engine.sendSMS("79053673205", "sms sending test");
            System.out.println("sms sent");
            engine.sendSMS("79053673205", "sms sending test");
            System.out.println("sms sent");
            engine.sendSMS("79053673205", "sms sending test");
            System.out.println("sms sent");
            engine.sendSMS("79053673205", "sms sending test");
            System.out.println("sms sent");
        } catch (Exception e) {
            System.out.println("send error");
        }

        List<SmsMessage> smsList = engine.getSmsMessages();
        for (SmsMessage smsMessage : smsList) {
            System.out.println("uid: [" + smsMessage.getUid() + "], receivedTime: [" + smsMessage.getReceiveTime() + "], number: ["
                    + smsMessage.getFromPhone() + "], message: [" + smsMessage.getMessageBody() + "]");
        }

        if (smsList != null && !smsList.isEmpty()) {
            engine.removeFromInQueue(smsList.get(0));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.