无法使用以下groovy脚本读取/获取xml文件并得到“发生问题:org.xml.sax.SAXParseException; lineNumber:1; columnNumber:1;序言中不允许内容”错误。请帮忙。
def warningJsonUrl = EnvBuildUrl+"warnings40Result/api/json?"
def authString = "username:password".getBytes().encodeBase64().toString()
def conn = warningJsonUrl.toURL().openConnection()
conn.setRequestProperty( "Authorization", "Basic ${authString}" )
if( conn.responseCode == 200 ) {
println("code:"+conn.responseCode)
def textJsonObj = new JsonSlurper().parseText(conn.content.text)
return conn.content.text
}