2
13693261870
2022-09-16 653761a31dfeb50dd3d007e892d69c90bf0cdafc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.landtool.lanbase.common.utils;
 
import java.util.ArrayList;
import java.util.List;
 
import javax.wsdl.WSDLException;
 
import com.landtool.lanbase.modules.res.entity.WebService.ParameterInfo;
 
public class WEBServiceUtils {
    public static void main(String[] args) throws WSDLException {
        String wsdluri = "http://127.0.0.1:8443/WebService1.asmx?wsdl";
        List<String> operations = new ArrayList<String>();
        WAWsdlUtil.getOperationList(wsdluri, operations);
        for (String operationName : operations) {
            System.out.println("-----------------operation----------------");
            System.out.println(operationName);
            List<ParameterInfo> parameterInfos = WAWsdlUtil.getMethodParams(wsdluri, operationName);
            printParams(parameterInfos, "");
        }
    }
 
    private static void printParams(List<ParameterInfo> parameterInfos, String parentName) {
        if (parameterInfos != null) {
            for (ParameterInfo parameterInfo : parameterInfos) {
                System.out.println("parentname : " + parentName + " ; name : " + parameterInfo.getName() + " ; type :" +
                        " " + parameterInfo.getType() + " ;" +
                        " childtype : " + parameterInfo.getChildType());
                printParams(parameterInfo.getChildren(), parameterInfo.getName());
            }
        }
    }
 
}