简体   繁体   English

groovy.lang.MissingMethodException:groovy脚本中没有方法签名

[英]groovy.lang.MissingMethodException: No signature of method in groovy script

Can some one please help me with the following code. 可以请下面的代码帮助我。 It is causing "groovy.lang.MissingMethodException: No signature of method: java.lang.String.setNodeValue() is applicable for argument types: (java.lang.String, java.lang.String) values: [//ns:tem:intA, 50] error at line: 14" error. 它导致“ groovy.lang.MissingMethodException:方法的无签名:java.lang.String.setNodeValue()适用于参数类型:(java.lang.String,java.lang.String)值:[// ns: tem:intA,50]行错误:14“错误。

def getaddresponse=context.expand('${Add SOAP Request#response}')

import com.eviware.soapui.support.XmlHolder

def addresponseholder= new XmlHolder(getaddresponse) 
addresponseholder.namespaces["ns"]="http://tempuri.org/"

def addresponsenodevalue=                  
    addresponseholder.getNodeValue("//ns:AddResult")

def deleterequest=context.expand('${Delete SOAP Request#request}')
def deleteholder =new XmlHolder (deleterequest)

deleteholder.namespaces["ns"]="http://tempuri.org/"
deleterequest.setNodeValue("//ns:tem:intA",addresponsenodevalue)

def updatedxml=deleterequest.getXml()

The problem is that context.expand(String content) returns a String , which by default does not have the method setNodeValue(String xpath, Object value) . 问题是context.expand(String content)返回一个String ,默认情况下没有方法setNodeValue(String xpath,Object value)

Try calling setNodeValue() on your deleteholder instead: 尝试setNodeValue()在您的deleteholder上调用setNodeValue()

deleteholder.setNodeValue("//ns:tem:intA",addresponsenodevalue)
def updatedxml=deleteholder.getXml()

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

相关问题 Groovy:groovy.lang.MissingMethodException:方法未签名 - Groovy : groovy.lang.MissingMethodException: No signature of method groovy.lang.MissingMethodException:肥皂中没有方法--groovy脚本的签名 - groovy.lang.MissingMethodException:No signature of method --groovy script in soap jenkinspipeline groovy.lang.MissingMethodException:没有方法签名 - jenkinspipeline groovy.lang.MissingMethodException: No signature of method 捕获:groovy.lang.MissingMethodException:没有方法的签名 - Caught: groovy.lang.MissingMethodException: No signature of method groovy.lang.MissingMethodException:没有方法解析的签名 - groovy.lang.MissingMethodException: No signature of method resolution groovy.lang.MissingMethodException:没有方法的签名: - groovy.lang.MissingMethodException: No signature of method: groovy.lang.MissingMethodException:没有方法签名 - groovy.lang.MissingMethodException: No signature of method 错误:groovy.lang.MissingMethodException:没有方法签名 - ERROR:groovy.lang.MissingMethodException: No signature of method groovy.lang.MissingMethodException:方法的无签名:在詹金斯构建流程的groovy中 - groovy.lang.MissingMethodException: No signature of method: in groovy on jenkins buildflow soapUI groovy脚本groovy.lang.MissingMethodException - soapUI groovy script groovy.lang.MissingMethodException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM