后台代码:
@At("/register/serviceTestNew")
@Ok("jsp:jsp.admin.service.register.setParam")
public Map<String, Object> serviceTestNew(@Param("url") String url, @Param("method") String method) {
Map<String, Object> map = new HashMap<String, Object>();
System.out.println(url+"+++"+method);
List<OperationInfo> list = WSClient.getWSDLInfo(url);
if (list != null) {
List<MyElement> myelement = new ArrayList<MyElement>();
for (OperationInfo oi : list) {
if (oi.getTargetMethodName().equals(method)) {
List inparam = oi.getInparameters();
for(Object obj:inparam){
ParameterInfo oper=(ParameterInfo)obj;
MyElement my=new MyElement();
my.setName(oper.getName());
my.setAttribute(oper.getKind());
my.setText(oper.getValue());
myelement.add(my);
}
map.put("inparam", myelement);
map.put("paramf", "new");
break;
}
}
}
return map;
}
前端调用代码:
function showParametersTR(obj){
//type 01门户调用 02系统调用
var id=null;
var url=$('#url').val();
var templateId=null; //配置模板
var method=$(obj).attr("title"); //服务调用方法
// alert(method);
var type='01'; //01 webservice代理 02 rest代理
var href="serviceTestNew";
href+="?url="+url+"&method="+method;
console.log("href="+href);
$(".test_bottom").load(href);
后台日志:
DEBUG 16:06:46 UrlMappingImpl.get(87)-->Found mapping for [GET] path=/admin/service/register/serviceTestNew : RegisterAt.serviceTestNew(...)
DEBUG 16:06:46 NutIoc.get(138)-->Get 'registerAt'<class com.wonders.mbpss.admin.service.RegisterAt>
debug模式下运行发现,没有调到上面给出的函数。