690716494
发贴: 4
积分: 0
|
于 2010-12-18 14:30
Java平台实现:
static String url = "http://121.37.58.18:8080/SMSWebService/services/SMS"; public static void main(String[] args) { System.out.println(doSendMessage("基本账号;账号密码;手机号码清单(多个中间用","隔开);信息内容".split(";"))); }
/*** * 发送信息 * */ public static String doSendMessage(String[] temp){ String result = ""; Call call = getCall(); call.setTargetEndpointAddress(url); call.setOperationName("sendMessage");//WSDL里面描述的接口名称//接口的参数 call.addParameter("userAcc", XMLType.XSD_STRING, ParameterMode.IN);//接口的参数 call.addParameter("passwd", XMLType.XSD_STRING, ParameterMode.IN); call.addParameter("telNumber", XMLType.XSD_STRING, ParameterMode.IN); call.addParameter("message", XMLType.XSD_STRING, ParameterMode.IN); call.setReturnType(XMLType.XSD_STRING);//设置返回类型 try { result = (String)call.invoke(temp); } catch (RemoteException e) { } return result; }
/*** * 获得CALL * */ public static Call getCall(){ Service service = new Service(); Call call = null; try { call = (Call)service.createCall(); } catch (ServiceException e) { } return call; }
|