简体   繁体   English

无法在SoapUI中调用请求-模糊方法重载

[英]Unable to call request in SoapUI - Ambiguous method overloading

I use following code in SoapUI SOAP request as a Script Assertion to get value from xml output: 我在SoapUI SOAP请求中使用以下代码作为Script Assertion从xml输出获取值:

import java.text.SimpleDateFormat
import com.eviware.soapui.support.XmlHolder

def xml = new com.eviware.soapui.support.XmlHolder(context.response)
def fname = xml.getNodeValue("//*:name")

It is working well, when I execute request directly, but get error message when call it from another test step with this code: testStepgetAttachment.run(testRunner, context) 当我直接执行请求时,它运行良好,但是使用以下代码从另一个测试步骤调用它时收到错误消息: testStepgetAttachment.run(testRunner, context)

Error message: 错误信息:

Ambiguous method overloading for method com.eviware.soapui.support.XmlHolder#. 方法com.eviware.soapui.support.XmlHolder#的方法重载模棱两可。 Cannot resolve which method to invoke for [null] due to overlapping prototypes between: [interface org.apache.xmlbeans.XmlObject] [interface org.w3c.dom.Node] 由于以下之间的原型重叠,无法解析为[null]调用的方法:[interface org.apache.xmlbeans.XmlObject] [interface org.w3c.dom.Node]

Context is not simply Context. 上下文不仅仅是上下文。 It depends on what you are doing. 这取决于您在做什么。

If I run it directly - either as a teststep, testcase or testsuite - it is an instance of com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext 如果我直接运行它(作为测试步骤,测试用例或测试套件),则它是com.eviware.soapui.impl.wsdl.testcase.WsdlTestRunContext的实例

If I run it from a Groovy Script teststep in another testcase, it is an instance of com.eviware.soapui.impl.wsdl.panels.support.MockTestRunContext 如果我从另一个测试用例中的Groovy脚本测试步骤运行它,则它是com.eviware.soapui.impl.wsdl.panels.support.MockTestRunContext一个实例

And there are probably more possibilities. 而且可能还有更多可能性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM