我是这样调用客户提供的接口的
public List<Task> getOperationSystemData(Long userId) {
String url = AppContext.getSystemProperty("anhui.webService.url");
Object[] response = null;
try{
EndpointReference targetEPR = new EndpointReference(url);
RPCServiceClient serviceClient = new RPCServiceClient();
GetNewTasks parm = new GetNewTasks();
parm.setUserID(String.valueOf(userId));
Object[] opAddArgs = new Object[]{parm.getUserID()};
Options options = serviceClient.getOptions();
options.setTo(targetEPR);
QName opAdd =new QName("http://www.ustcsoft.com","getNewTasks");
Class[] returnTypes = new Class[] {Root.class};
response = serviceClient.invokeBlocking(opAdd,opAddArgs,returnTypes);
}catch(Exception e){
log.info("获取业务系统待办异常", e);
}
但一直报错:
org.apache.axis2.AxisFault: Unmarshalling Error: unexpected element (uri:"", local:"arg0"). Expected elements are <{}UserID>
at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:531)
google后给的答案是在方法参数中加@webParam(name="",targetNamespace="http://www.ustcsoft.com"),这样做了,还是没用,求大神指点