当前位置: 代码迷 >> Lotus >> 请问使用lotusscript调用Webservice的实例方法
  详细解决方案

请问使用lotusscript调用Webservice的实例方法

热度:455   发布时间:2016-05-05 06:42:33.0
请教使用lotusscript调用Webservice的实例方法
最近OA里边要做个发短信的功能,其他公司已经架设好了一个短信平台,并且提供了一个webserbice调用接口,想在这里寻求一个使用lotusscript调用Webservice的实例方法,谢谢

附上短信平台提供的调用示例:


调用示例:

public String send() throws Exception {
Call call = null;
Service service = null;
String strreturn = "111110", strReturn = "";
try {
// 电话号码参数,多个之间用','隔开
String arg0 = "18983896601";
// 短信内容
String arg1 = "断线测试1234";
//发送时间, 为null时立即发送
String arg2 = "";
//序列号,由业务系统产生(0-99999999,步长为1,循环产生)
String arg3 = "12345";
//业务系统编码(两位数字编码)
String arg4 = "01";
//优先级,优先级,可为null,为null时默认为0:普通优先级
String arg5 = "0";

String mobileURL = "http://localhost:8080/SmsService/SMSNotification?wsdl"; // 短信访问webservice路径
service = new Service();
call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(mobileURL));
call.setOperationName(new QName(
"com.zenith.mobilemessage.sms.notification.service.SMSNotification",
"sendSms"));

call.addParameter("arg0", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("arg1", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("arg2", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("arg3", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("arg4", XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter("arg5", XMLType.XSD_STRING, ParameterMode.IN);
call.setReturnType(XMLType.XSD_STRING);
call.setUseSOAPAction(true);
strreturn = (String) call.invoke(new Object[] { arg0,
arg1, arg2, arg3, arg4, arg5 });
System.out.println(strreturn);
if (strreturn.indexOf("0")<0) {
if (strreturn.equals("-1")) {
strReturn = "通过访问路径[" + mobileURL
+ "]发送手机短信时出错,原因是:电话号码为空!";
} else if (strreturn.equals("-2")) {
strReturn = "通过访问路径[" + mobileURL
+ "]发送手机短信时出错,原因是:短信内容为空!";
} else if (strreturn.equals("-3")) {
strReturn = "通过访问路径[" + mobileURL
+ "]发送手机短信时出错,原因是:系统编码为空!";
} else if (strreturn.equals("-4")) {
strReturn = "通过访问路径[" + mobileURL
+ "]发送手机短信时出错,原因是:无正确电话号码!";
} else if (strreturn.equals("-5")) {
strReturn = "通过访问路径[" + mobileURL
+ "]发送手机短信时出错,原因是:其他错误!";
}
}else{
strReturn = "通过访问路径[" + mobileURL
+ "]发送手机短信成功!";
}
} catch (Exception ex) {
strReturn += "发送手机短信出错,原因是:" + ex.toString();
} finally {
call = null;
service = null;
}
return strReturn;
}


------解决思路----------------------
试试OpenURL
------解决思路----------------------
具体怎么写的记不清了,可以看看Designer的帮助:
1. 拼一个URL的字符串,mobileURL = "http://localhost:8080/SmsService/SMSNotification?wsdl"
2. 用openurl(mobileURL )发出HTTP请求,响应短信就可以发出了
但这样做,没有返回值。
------解决思路----------------------
这个代码有没有看过。 
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
Set doc = session.DocumentContext
Dim strWsdl As String
Dim Client As Variant
strWsdl = "http://" & doc.Server_Name(0) & "/" & doc.Current_Database(0) & "/TestWS?wsdl"
Set Client =CreateObject("MSSOAP.SoapClient30")
Client.ClientProperty("ServerHTTPRequest") = True
Call Client.MSSoapInit(strWsdl)
'Get the current database's name
doc.txtDbName = Client.getDBName
'Get the current database's path
doc.txtDbPath = Client.getDBPath
------解决思路----------------------
看看这个。 
http://bbs.csdn.net/topics/320104058
------解决思路----------------------
参考
参考
------解决思路----------------------
给你一个domino编写及调用webservice的参考链接。
http://blog.csdn.net/gavid0124/article/details/37514289
------解决思路----------------------
domino里面有帮助,8.5版本很方便的
  相关解决方案