SoapUI Api - 以编程方式调用项目服务方法?
我试图从测试步骤脚本以编程方式调用我的项目中定义的服务方法。我处于阻塞状态,似乎不知道如何设置请求字段并拨打电话。该方法将 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 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 ?