尝试从Jenkins运行groovy脚本时,出现以下错误
C:\Jenkins\workspace\Load-Test-for-container-HimaM13\hudson16255048887172875424.groovy: 139: unable to resolve class XmlParser @ line 139, column 14.
def root = new XmlParser().parseText(response)
^
使用的Groovy版本groovy-4.0.0-rc-2
程式码片段
try {
String response = sendSoap(request, "getSamlArtifact")
def soapNS = new groovy.xml.Namespace("http://schemas.xmlsoap.org/soap/envelope/", "SOAP")
def samlProtocolNS = new groovy.xml.Namespace("urn:oasis:names:tc:SAML:1.0:protocol", "samlp")
def root = new XmlParser().parseText(response)
def assertionArtifact = root[soapNS.Body][samlProtocolNS.Response][samlProtocolNS.AssertionArtifact]
if (null == assertionArtifact[0]){
//printString("value1-"+assertionArtifact[0])
return null
}
else
return assertionArtifact[0].text();
} catch (IOException e) {
return null
}
1条答案
按热度按时间tez616oj1#
在尝试了
而不是