-
Bug
-
Resolution: Obsolete
-
Major
-
JBossAS-4.0.4.GA
-
None
-
All operating system and software platform
-
Low
Problem:
---------
The following soap message should parsed by JBossWS/JBoss 4.04GA
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<oms:ExecuteResponse xmlns:oms="http://omsoe.crm.tmobile.net/services/oms">
<data>
<ReturnValue code="NOT_VALID" validationErrors="invalid XML <xml-fragment xmlns:ins="http://omsoe.crm.tmobile.net/datatypes/ccoscks/installakz" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oms="http://omsoe.crm.tmobile.net/services/oms" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>: Expected elements 'contractNumber iccid msisdn' before the end of the content in element contractIdentificator
" />
</data>
</oms:ExecuteResponse>
</soap:Body>
</soap:Envelope>
The following exception "caused by: java.io.IOException: org.xml.sax.SAXParseException: Element type "ReturnValue" must be followed by either attribute specifications, ">" or "/>"." is thrown by JBoss.
Analysis:
---------
The problem is caused by the XML attribute expression:
validationErrors="invalid XML ... Expected elements 'contractNumber iccid msisdn' before the end of the content..."
JBoss performs the following steps:
(1) Converting the soap xml snippet(see above) from XML in a DOM document
(2) Converting DOM document in the xml snippet with the following result:
validationErrors='invalid XML ... Expected elements 'contractNumber iccid msisdn' before the end of the content'
The XML attribute value is not wellformed because the embedded ' character is not allowed. The bug is caused by the class "org.jboss.util.xml.DOMWriter.java".
The character ' is not normalized in the methode: private String normalize(String s).
Solution:
---------
The following code snippet has added in the case statement of the method normalize():
case '\'':
{ str.append("'"); break; }