]
Thomas Diesler updated JBWS-1137:
---------------------------------
Fix Version/s: jbossws-1.0.4
(was: jbossws-1.0.5)
DOMEnvelopeBuilder builds SOAPEnvelope reading only the first child
of SOAPBody element
---------------------------------------------------------------------------------------
Key: JBWS-1137
URL:
http://jira.jboss.com/jira/browse/JBWS-1137
Project: JBoss Web Services
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Components: jaxrpc
Affects Versions: jbossws-1.0.2
Environment: Linux 2.6.12-12mdk, jdk 1.5.0_06, jboss 4.0.4GA with jbossws 1.0.2
Reporter: Alessio Soldano
Assigned To: Thomas Diesler
Fix For: jbossws-1.0.4
Attachments: DOMEnvelopeBuilder.patch
When trying to build a SOAPMessage out of an InputStream containing a response to a SOAP
request, MessageFactoryImpl's createMessageInternal method uses DOMEnvelopeBuilder.
This build the envelope correctly except for the soap body if it contains more than one
child element. In case of rpc/encoded soap messages, you can have multiref elements at the
same level of the soapbody main child, ie for example:
<soapenv:Body
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/&quo...
<ns1:getUltimoElencoSociResponse
xmlns:ns1="http://bean.service.rivendell.lince.it">
<ns1:getUltimoElencoSociResponse href="#id0" />
</ns1:getUltimoElencoSociResponse>
<multiRef
xmlns:ns2="http://net.jboss.org/rivendell"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" id="id0"
soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:UltimoElencoSoci">
<aggiornato xsi:type="xsd:boolean">true</aggiornato>
<dataDeposito xsi:type="xsd:date">2006-06-19Z</dataDeposito>
<dataUltimoElencoSoci
xsi:type="xsd:date">2006-05-22Z</dataUltimoElencoSoci>
</multiRef>
</soapenv:Body>
DOMEnvelopeBuilder parses the ns1:getUltimoElencoSociResponse tag only, so at the end of
the process the multiref element is missing, thus the message is incomplete.
I know that rpc/encoded (used in the above example) won't be supported anymore in
future, however I think this issue should be fixed in order to correctly parse every
SOAPMessage. Moreover consider that your MessageFactory may be used also to manually parse
(through SOAPMessage, SOAPEnvelope, and so on) messages coming from legacy system that
still use rpc/encoded (that is exactly what I'm doing).
I fixed the issue simply by changing the "if" at line 99 of DOMEnvelopeBuilder
into a "while". Here is the patch file you could use:
99c99
< if (itBody.hasNext())
---
> while (itBody.hasNext())
Thank you in advance
Alessio Soldano
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: