gpt4 book ai didi

java - 使用 Java 列出 wsdl url 中的所有操作(请求)

转载 作者:行者123 更新时间:2023-12-01 23:28:37 25 4
gpt4 key购买 nike

有没有办法使用 Java 列出来自 wsdl url 的所有操作(通过指定端点而不是来自 xml)?

下面是一个示例端点。 http://www.webservicemart.com/uszip.asmx?WSDL

请帮忙。

最佳答案

您可以使用eviware/soapui's API为了那个原因。

您可以使用指定的 WSDL 创建一个接口(interface),然后使用它来获取操作。

    int operationCount = wsdlInterface.getOperationCount();

for (int i = 0; i < operationCount; i++){

WsdlOperation wsdlOperation = wsdlInterface.getOperationAt(i);
String operationName = wsdlOperation.getName();
// you can use this name, add to an arraylist etc.

allOperations.add(wsdlOperation);

WsdlTestCase testCase = generateTestCase(wsdlTestSuite, operationName);
WsdlTestStep testStep = generateTestStep(wsdlOperation, testCase, operationName);

}

文档位于此处:

https://www.soapui.org/apidocs/allclasses-noframe.html

关于java - 使用 Java 列出 wsdl url 中的所有操作(请求),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19651422/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com