开源OA办公平台教程(O2OA):WebService调用样例
一、接口样例1、打开服务管理平台2、创建接口写上相关代码/********************this.entityManager; //实体管理器this.applications; //访问系统内服务this.requestText//请求正文this.request//请求this.currentPerson//当前用户this.response//响应对象。通过this.respons
·
一、接口样例
1、打开服务管理平台
2、创建接口写上相关代码
/********************
this.entityManager; //实体管理器
this.applications; //访问系统内服务
this.requestText//请求正文
this.request//请求
this.currentPerson//当前用户
this.response//响应对象。通过this.response.setBody(data)设置响应内容
this.organization; //组织访问
this.org; //组织快速访问方法
this.service; //webSerivces客户端
********************/
try{
var result = {
}
var wsdl = "http://172.16.1.235:8009/hello?wsdl"; //WebService调用地址
var method = "sayHello"; //WebService方法
var ws = this.service; //webSerivces客户端
var parameter = "wwx"; //需传入的参数
var res = ws.jaxws(wsdl, method, parameter); //进行调用并接收返回内容
print(res[0]);//输出返回内容
result.state = "NMT0001";
result.message = "成功";
}catch(e){
e.printStackTrace();
result.state = "NMT0002";
result.message = "失败";
result.data = e.name + ": " + e.message
}
//JSON.stringify(result);
this.response.setBody(result,"application/json");

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐
所有评论(0)