soap 返回简单数据类型 wsdl webservice
来源:互联网 发布:时间序列分析算法 编辑:程序博客网 时间:2024/06/08 14:45
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.message.SOAPHeaderElement;
import javax.xml.soap.SOAPElement;
public class SendSMSBJ2 implements Runnable {
public String phones = null;//"15345667766"
public String msg = null;// "kkk测试";
public int T_count = 0;
public int tname = 0;
public void run() {
// System.out.println("[TN:"+tname+"] "+T_count);
long s = System.currentTimeMillis();
String r = send2BJ(username, password, mobile, smscontent);
long e = System.currentTimeMillis();
String time = (e - s) / 1000 == 0 ? (e - s) + "毫秒" : (e - s) / 1000
+ "秒" + (e - s) % 1000 + "毫秒";
System.out.println("[TN:" + tname + "] P:" + phones + " ST->" + time
+ ",R->" + r);
// System.out.println("ST->"+time+",R->"+r );
}
public static String send2BJ(String username,String password,String mobile,String smscontent) {
String ret = null;
String md5 = null;
try {
String nameSpace = "http://tempuri.org/";
String endPoint = "http://www.ldsm.com/Service.asmx";
Service service = new Service();
Call call = null;
call = (Call) service.createCall();
call.setTargetEndpointAddress(new URL(endPoint));
call.setOperationName(new QName(nameSpace, "SendSMS"));
call.addParameter(new QName("http://DefaultNamespace", "username"),
XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://DefaultNamespace", "password"),
XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://DefaultNamespace", "mobile"),
XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://DefaultNamespace", "smscontent"),
XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_INT);
call.setUseSOAPAction(true);
call.setSOAPActionURI(nameSpace + "SendSMS");
System.out.println(call.invoke(new Object[] { username, password, mobile, smscontent}));
} catch (Exception e) {
e.printStackTrace();
}
return ret;
}
static String username="saaa";
static String password="123456";
static String smscontent="abc测试";
static String mobile = "159211156331";
static String SendTime = "";
public static void main(String[] a) {
send2BJ( username, password, mobile, smscontent);
}
}
- soap 返回简单数据类型 wsdl webservice
- soap 返回xml 文件 soap 文件 webservice wsdl
- webservice wsdl和soap
- php wsdl SOAP WebService
- webservice SOAP WSDL
- 理解webservice SOAP WSDL
- webservice SOAP WSDL
- webservice wsdl soap axis
- Webservice soap wsdl区别
- webservice soap wsdl
- 关于SOAP调用返回对象的写法 wsdl webservice
- WebService 与 SOAP、WSDL、UDDI
- 彻底理解webservice SOAP WSDL
- Webservice/SOAP/WSDL释疑篇
- 彻底理解webservice SOAP WSDL
- webservice中wsdl和soap
- webservice soap wsdl 在线接口
- 彻底理解webservice SOAP WSDL
- 万网id---30088192
- session dataset 访问数据库
- 从按下电源开关到bash提示符 声明 (完)
- C#操作Word完全方法
- 如何创建 /dev/random
- soap 返回简单数据类型 wsdl webservice
- Oracle中日期函数的使用
- ADO.NET的连接式和断开式
- 【转帖】用VNC远程登录Ubuntu桌面
- Session模型简介
- 影响世界的100条管理定律
- soap 设置header 添加头元素 webservice wsdl
- 识人九句
- tomcat配置Https