0
我想使用SoapUI API,但我無法使用SoapUI項目中的API找到請求。使用SoapUI API找不到請求
和代碼如下所示:
public static void main(String[] args) {
try {
WsdlProject project = new WsdlProject("SoapUI/Tests.xml");
WsdlInterface iface = WsdlInterfaceFactory.importWsdl(project, "SoapUI/Enrollment.wsdl", true)[0];
System.out.println("\n\n<---------WSDL INTERFACE " + iface.getName() + " IMPORTED---------->\n\n");
WsdlOperation op = (WsdlOperation)iface.getOperationAt(0);
System.out.println("Opperation: " + op.getName());
for(Request r : op.getRequestList()) {
if(r instanceof WsdlRequest) {
System.out.println("\t" + r.getName());
}
}
iface.release();
System.out.println("\n\nDONE");
System.exit(0);
} catch (XmlException | IOException | SoapUIException e) {
e.printStackTrace();
System.exit(0);
}
}
}
輸出: < --------- WSDL INTERFACE Enrollment_v1SoapBinding IMPORTED ---------->
Opperation:AsyncEnroll 請求1
DONE
它accuratly打印的操作名稱是 'AsyncEnroll'。接口名稱從「enrollment_v1HttpBinding」稍微更改爲「Enrollment_v1SoapBinding」。然而,最大的問題是它只打印一個叫做'請求1'的請求。它找不到'Test1-AsyncEnroll'或'Test2-AsyncEnroll'。
我該如何解決這個問題?
你應該通過創建一個[測試套件 - >測試用例並且有測試步驟]來使用它(https://www.soapui.org/Functional-Testing/structuring-and-running-tests.html) – Rao