When a SOAP object contains the characters “]]>” in the request message, the test will not run. the file will not save and will throw a java error:
11-16-2018 04:58:50 PM - [WARNING] - Cannot find test object with id ‘Object Repository/ClearCart’ because of ‘org.dom4j.DocumentException: Error on line 34 of document file:///Katalon%20Studio/Test/Object%20Repository/ClearCart.rs : The character sequence “]]>” must not appear in content unless used to mark the end of a CDATA section. Nested exception: The character sequence “]]>” must not appear in content unless used to mark the end of a CDATA section.’
The SOAP message has a CDATA section and needs to have one. This bug seems to be widespread through many applications that are built on Java.
Could you please show the content of the file:///Katalon%20Studio/Test/Object%20Repository/ClearCart.rs
Attaching the file here would be most convenient.
<soapenv:Envelope xmlns:ser=“http://xmlns.oracle.com/Enterprise/HCM/services” xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/”>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
Soap envelope contains a message which is also XML, but needs to be sent as CDATA so as to not interfere with the outer XML structure. We have tried HTML entities, but the server will not take anything else. This actually works. Katalon seems to be having an issue serializing this when running a test.
I think the SOAP Envelope document you provided above looks OK.
By googling with key “The character sequence “]]>” must not appear in content unless used to mark the end of a CDATA section”, I found the following post in the Stack Overflow.
A quote from the thread:
Looks like the problem was that the XML is not well-formed. The
xmlwf utility says it was not. The error it gives is:
foo.xml:18135:65: not well-formed (invalid token)The error was not in your code. You should contact the data provider and get them to fix their XML generation.
Do you find any message which indicates that the XML parser is recognizing (wrongly) that the xml document is not well-formed?
I am confused.
Which code do you actually find in your ClarCart.rs file?
The fragment escaped with \
or the fragment without escape by :