SoapUI Api - 以编程方式调用项目服务方法?

发布于 2024-09-24 08:27:43 字数 735 浏览 2 评论 0原文

我试图从测试步骤脚本以编程方式调用我的项目中定义的服务方法。我处于阻塞状态,似乎不知道如何设置请求字段并拨打电话。该方法将 getMore() 正在测试的调用结果。因此,我想在有更多结果需要获取并将其存储在测试步骤脚本中时调用此方法。到目前为止,这是我所掌握的:

profileInterface = testRunner.testCase.testSuite.project.getInterfaceByName("profileSoapBinding");
proGetMore = profileInterface.getOperationByName("getMore");
proGetMoreReq = proGetMore.requests[0];

// proGetMoreReq.setPropertyValue("sessionToken", testRunner.testCase.testSuite.getPropertyValue("SessionToken"));  // - Doesn't Work
// submitResult = proGetMoreReq.submit(new com.eviware.soapui.impl.wsdl.WsdlSubmitContext(proGetMoreReq), false); // - Returns NULL

有人可以为我指明如何做到这一点的正确方向吗?如果我一直在错误的地方尝试解决这个问题,您也可以告诉我吗?我一直在 SoapUI API 文档中仔细研究 WSDLRequest 的 API 文档

I am trying to call a service method defined in my project programmatically from a test step script. I am at a blocker and can't seem to figure how to set the request fields and make the call. The method will getMore() results of the call being tested. So I want to call this method while there are more results to fetch and store them in the test step script. Here's what I have so far:

profileInterface = testRunner.testCase.testSuite.project.getInterfaceByName("profileSoapBinding");
proGetMore = profileInterface.getOperationByName("getMore");
proGetMoreReq = proGetMore.requests[0];

// proGetMoreReq.setPropertyValue("sessionToken", testRunner.testCase.testSuite.getPropertyValue("SessionToken"));  // - Doesn't Work
// submitResult = proGetMoreReq.submit(new com.eviware.soapui.impl.wsdl.WsdlSubmitContext(proGetMoreReq), false); // - Returns NULL

Can someone point me in the right direction on how to do this? Can you also let me know if I've been looking in the wrong place to try and figure this out. I have been pouring over the API doc for a WSDLRequest in the SoapUI API docs

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

岁月无声 2024-10-01 08:27:43

您可以使用 Groovy 脚本来完成。它几乎就像 java 一样,您创建一个类并放置 Pro.jar 并将 SOAPUI 的 lib 文件夹添加到您的类路径中。这对你有帮助吗?

You can do with Groovy script. IT is almost like java and you create a class and place Pro.jar and add lib folder of SOAPUI to your classpath. Does this help you ?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文