Groovy脚本在SoapUI中出现错误

Groovy脚本在SoapUI中出现错误,soap,groovy,Soap,Groovy,我在SoapUI中编写groovy脚本,在编写下面提到的代码时,我遇到了类似“类:Script1没有这样的属性:GetSupplierByCityResult”的错误 SoapUI响应: <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://

我在SoapUI中编写groovy脚本,在编写下面提到的代码时,我遇到了类似“类:Script1没有这样的属性:GetSupplierByCityResult”的错误

SoapUI响应:

  <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"  
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     
  xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Body>
  <GetSupplierByCityResponse xmlns="http://www.webservicex.net/">
     <GetSupplierByCityResult>false</GetSupplierByCityResult>
     <SupplierDataLists>
        <SupplierDatas/>
        <TotalRecords>0</TotalRecords>
     </SupplierDataLists>
  </GetSupplierByCityResponse>
</soap:Body>
</soap:Envelope>

请帮助我解决此问题。

行中:

if(GetSupplierByCityResult=="false")
def GetReservationResponse =   holder.getNodeValue("//GetSupplierByCityResult")
您的变量名为
GetReservationResponse
,不是吗

从线条上看是这样的:

if(GetSupplierByCityResult=="false")
def GetReservationResponse =   holder.getNodeValue("//GetSupplierByCityResult")

变量也应该以小写字符开头(这是一个很好的约定,否则Groovy可能会在您提出一个名称不好的变量时猜测您正在谈论一个类)

感谢tim_yates的支持,现在它工作得很好。