public static void test() {
try {
String url = "http://172.7.128.128/services/ClientService?wsdl";// 提供接口的地址
String soapaction = "http://webservice.cms.hikvision.com"; // 域名,这是在server定义的
Service service = new Service();
Call call = null;
call = (Call) service.createCall();
call.setTargetEndpointAddress(new java.net.URL(url));
QName qn = new QName(soapaction, "getAllEmapInfo");
call.registerTypeMapping(EmapInfoReq.class, qn,
new BeanSerializerFactory(EmapInfoReq.class, qn),
new BeanDeserializerFactory(EmapInfoReq.class, qn)); //注册自己定义的类
call.registerTypeMapping(EmapInfoResult.class, qn,
new BeanSerializerFactory(EmapInfoResult.class, qn),
new BeanDeserializerFactory(EmapInfoResult.class, qn)); //注册自己定义的类
call.setOperationName(new QName(soapaction, "getAllEmapInfo"));// 设置要调用哪个方法
call.addParameter(
new QName(soapaction, "emapInfoReq"), // 设置要传递的参数
org.apache.axis.encoding.XMLType.SOAP_INT,  javax.xml.rpc.ParameterMode.IN);
call.setReturnType(new QName(soapaction, "getAllEmapInfo"),
CommonResult.class);// 要返回的数据类型(自定义类型)
call.setUseSOAPAction(true);
call.setSOAPActionURI(soapaction + "getAllEmapInfo");
// String ret = (String) call.invoke(new Object[]
// {"北京"});//调用方法并传递参数
final CommonResult commonResult = (CommonResult) call
.invoke(new Object[] { "222" });// 调用方法并传递参数
System.out.println(commonResult.toString());
} catch (Exception e) {
e.printStackTrace();
System.out.println("webservice调用异常:" + e.getMessage());
}
这边的 call.addParameter 的第2个参数 我想传入自己定义的类型的参数 请问要怎么写?