AXIS2 turn WebService client

C:\360Downloads\axis2-1.6.1-bin\axis2-1.6.1\bin>wsdl2java -uri http:/ /www.****.net/webservice/smsservice.asmx?wsdl -p com.club.webservice.sms -s -o stub

Generate a SMSServiceStub.java file, and then use this file That’s it.

package com.club.webservice.sms;

import java.util.Calendar;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.club.webservice.sms.SMSServiceStub.SendSMS;
import com.club.webservice.sms.SMSServiceStub.SendSMSCovey;
import com.club.webservice.sms.SMSServiceStub.SendSMSCoveyResponse;
import com.club.webservice.sms.SMSServiceStub.SendSMSResponse;


public class SMSUtils {

private static final Logger log = LoggerFactory.getLogger(SMSUtils.class);

private static SMSUtils instance = null;

    public static SMSUtils getInstance() {
        if (instance == null) {
            instance = new SMSUtils();
        }
        return instance;
    }

public String mySendSMS(String tokenid, String content, String mobile, Calendar c, int formatid) throws Exception {
SMSServiceStub stub = new SMSServiceStub();
SendSMS send = new SendSMS();
send.setTokenID(tokenid);
send.setContent(content);
send.setMobile(mobile);
send.setScheduleDate(c);
send.setFormatID(formatid);
SendSMSResponse smsResponse = stub.sendSMS(send);
//log.info(smsResponse.getSendSMSResult());
return smsResponse.getSendSMSResult();
}

/**
* Not recommended by SMS providers
* @param tokenid
* @param xml
* @throws Exception
*/
public void mySendSMSCovey(String tokenid, String xml) throws Exception {
SMSServiceStub stub = new SMSServiceStub();
SendSMSCovey covey = new SendSMSCovey();
covey.setTokenID(tokenid);
covey.setXMLStr(xml);
SendSMSCoveyResponse coveyResponse = stub.sendSMSCovey(covey);
log.info(coveyResponse.getSendSMSCoveyResult());
}
}

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 403 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.