⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 callbacktest.java

📁 短信发送
💻 JAVA
字号:
package com.jdev.sms.samples;

import junit.framework.TestCase;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import com.jdev.sms.Const;
import com.jdev.sms.soa.Register;
import com.jdev.util.Debug;

import sun.misc.BASE64Encoder;

public class CallBackTest extends TestCase{
	private final static String module = CallBackTest.class.getName();
	
	public void testNotifyStatus() {
		Service service = new Service();
		Call call;
		
		// 获取回调CONNID
		try {
			call = (Call) service.createCall();
			call.setTargetEndpointAddress(new java.net.URL("http://121.15.128.27:2008/gwtsms/services/CallBack"));
			call.setOperationName("NotifyStatus");
			call.invoke(new java.lang.Object[] {13, "1368020", 1, "13023896265" });
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		Debug.logVerbose("完成。。");
	}
	
	public void testRecvMsg() {
		Service service = new Service();
		Call call;
		
		// String caller, String time, String cont, String ucNum
		BASE64Encoder baseEncoder = new BASE64Encoder();
		
		try {
			call = (Call) service.createCall();
			call.setTargetEndpointAddress(new java.net.URL("http://121.15.128.27:2008/gwtsms/services/CallBack"));
			call.setOperationName("RecvSMS");
			call.invoke(new java.lang.Object[] {"13023896265", "20080703", baseEncoder.encode("我是谁,短信回复 北京WebService测试".getBytes()),Const.UC});
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		Debug.logVerbose("完成。。");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -