81,095
社区成员
发帖
与我相关
我的任务
分享
String address="http://localhost:8080/.../services/TemplateWS?wsdl";
String SoaNameSpace="http://Test.com"
Service service=new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(address);
//WSDL里面描述的函数名称
call.setOperationName(new QName(SoaNameSpace,"getTemplateListByUserName"));
//设置参数
call.addParameter(new QName(SoaNameSpace,"UserName"),
org.apache.axis.encoding.XMLType.XSD_STRING,
javax.xml.rpc.ParameterMode.IN);//这里发生如下错误
//设置返回类型
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setUseSOAPAction(true);
call.setSOAPActionURI(SoaNameSpace+ "getTemplateListByUserName");
//调用接口
String result = (String)call.invoke(new Object[]{UserId});
System.out.println(result);