一、接口样例
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");