Groovy脚本错误没有这样的属性:类的customerId

Groovy脚本错误没有这样的属性:类的customerId,groovy,Groovy,在执行脚本时,我遇到了一个错误,即groovy.lang.MissingPropertyException:没有这样的属性:类的customerId 剧本是 import org.w3c.dom.Node 导入org.w3c.dom.NodeList NodeList nodes=employeeServiceResponse.getFirstChild().getChildNodes() 字符串firstName=null 字符串lastName=null 对于(int i=0 i

在执行脚本时,我遇到了一个错误,即groovy.lang.MissingPropertyException:没有这样的属性:类的customerId

剧本是

import org.w3c.dom.Node
导入org.w3c.dom.NodeList
NodeList nodes=employeeServiceResponse.getFirstChild().getChildNodes()
字符串firstName=null
字符串lastName=null
对于(int i=0 i
我是groovy脚本新手,有人能帮我吗。脚本解析数据。

您编写的(最后一行):

但是此脚本中未定义
customerId
。当您在脚本中寻找任何员工时,您应该只写:

println 'Employee not found'

您能给出一些xml示例吗?您是如何创建
employeeServiceResponse
?但是我没有得到响应。XML customerId
println 'Employee not found'