读书人

axis2开发WebSerivce,传到String类型

发布时间: 2014-01-19 01:28:51 作者: rapoo

axis2开发WebSerivce,传入String类型 查询参数XML格式,接口返回:Xml输入参数格式不正确

对Web service 不是很熟悉 速求一大神, 每次都返回Xml输入参数格式不正确 axis2开发WebSerivce,传到String类型 查询参数XML格式,接口返回:Xml输入参数格式不正确

                                                                            
[解决办法]
不影响,你参数是string的 xml.toString()。
[解决办法]
public static void main(String[] args) throws IOException {
String url = "http://127.0.0.1/oms/services/MobileBlogService?wsdl";
String operateName = "mesDelete";//方法名
String namespace="";

Service service = new Service();
Call call = null;
try {
call = (Call) service.createCall();
call.setTargetEndpointAddress(url);
call.setOperationName(operateName);
call.setReturnType(XMLType.XSD_STRING);
call.addParameter("serSupplier", XMLType.XSD_INTEGER, ParameterMode.IN);
call.addParameter("serCaller", XMLType.XSD_INTEGER, ParameterMode.IN);
call.addParameter("callerPwd", XMLType.XSD_INTEGER, ParameterMode.IN);


call.addParameter("callTime", XMLType.XSD_INTEGER, ParameterMode.IN);
call.addParameter("callUser", XMLType.XSD_INTEGER, ParameterMode.IN);
call.addParameter("owner", XMLType.XSD_INTEGER, ParameterMode.IN);
call.addParameter("mesID", XMLType.XSD_INTEGER, ParameterMode.IN);



String result = (String)call.invoke(
new Object[] {"mof","blog","1","2222","222","111","111"});
System.out.println(result);
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}

读书人网 >Java Web开发

热点推荐