SAXParseException; DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true

Hi

Am running a Test Suite which calls a SOAP API
Windows 10
Katalon Studio 8.6.8
Java Auth 6.4

Last Successful log:
responseText = XmlSlurper().parseText(responseText)

Then

[Fatal Error] :1:10: DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.

2023-10-10 14:29:58.549 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/xxx FAILED.
Reason:
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 10; DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at xxx.run(xxx:128)
	at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1696910358484.run(TempTestCase1696910358484.groovy:25)
1 Like

You want to change this to

responseText = XmlSlurper().parseText(responseText, true, true)

See XmlSlurper (Groovy 2.4.2)