1.用到的lib包
activation.jar
axis.jar
axis-ant.jar
commons-discovery-0.2.jar
commons-logging-1.0.4.jar
jaxrpc.jar
log4j-1.2.16.jar
mail.jar
saaj.jar
wsdl4j-1.5.1.jar
Java 代码
private String startDate;
private String endDate;
private int lvl;
private String cqId = "";
public static final String serviceurl = "http://192.168.163.232:8088/ReportService.asmx";
public static final String targetnamespace = "w";
Service service = new Service();
Call call = (Call) service.createCall();
call.setSOAPVersion(SOAPConstants.SOAP12_CONSTANTS);
call.setTargetEndpointAddress(serviceurl);
call.addParameter(new QName(targetnamespace, "area"), Constants.XSD_STRING,
ParameterMode.IN);
call.addParameter(new QName(targetnamespace, "beginTime"), Constants.XSD_STRING,
ParameterMode.IN);
call.addParameter(new QName(targetnamespace, "endTime"), Constants.XSD_STRING,
ParameterMode.IN);
call.addParameter(new QName(targetnamespace, "lvl"), Constants.XSD_INT,
ParameterMode.IN);
call.addParameter(new QName(targetnamespace, "cqId"), Constants.XSD_STRING,
ParameterMode.IN);
call.setReturnType(Constants.XSD_STRING);
call.setUseSOAPAction(true);
call.setOperationName(new QName(targetnamespace, "GenerateDailyReport20"));
call.setSOAPActionURI(targetnamespace + "GenerateDailyReport20");
Object str = call.invoke(new Object[]{resTvProvider.getName(), this.getStartDate(), this.getEndDate(), 2, ""});
String directory = (String) str;
说明:serviceurl 为 c+给的接口
targetnamespace 命名空间
call.setOperationName(new QName(targetnamespace, "GenerateDailyReport20"));
GenerateDailyReport20 接口对应的方法名