]
Alexey Loubyansky closed JBXB-116.
----------------------------------
Fix Version/s: JBossXB-2.0.0.CR13
JBossXB-1.0.0.SP4
Resolution: Done
Fixed. Thanks.
When unmarshalling a repeating element which is a subclass of the
declared type, in some cases only the last elmeent is stored in java object
---------------------------------------------------------------------------------------------------------------------------------------------
Key: JBXB-116
URL:
https://jira.jboss.org/jira/browse/JBXB-116
Project: JBoss XML Binding (JBossXB)
Issue Type: Bug
Affects Versions: JBossXB-1.0.0.CR11
Environment: Windows XP, Java 5, jboss 4.2.1.GA with jbossws-2.0.x.GA
(jboss-xml-binding 1.0.0CR11)
Reporter: Karen Lease
Assignee: Alexey Loubyansky
Fix For: JBossXB-2.0.0.CR13, JBossXB-1.0.0.SP4
Attachments: KLService.wsdl, XsiTypeUnitTestCase.java
I have a bug unmarshalling an array of objects in a jaxrpc webservice.
The method is declared as purchase(String, Product[]).
If I call the method with an array of ProductA (which is a subclass of Product), then the
deserialized Product array only contains 1 element which is always the last one in the
array which is being sent.
For example, if the incoming SOAP message is:
<env:Envelope
xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header/>
<env:Body>
<ns1:purchase xmlns:ns1='http://org.jboss.ws/samples/docstyle/wrapped/types'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
<String_1>Karen</String_1>
<arrayOfProduct_2 xsi:type='ns1:ProductA'>
<name>cyfac</name>
<price>3000</price>
</arrayOfProduct_2>
<arrayOfProduct_2 xsi:type='ns1:ProductA'>
<name>look</name>
<price>5000</price>
</arrayOfProduct_2>
<arrayOfProduct_2 xsi:type='ns1:ProductA'>
<name>GOSPORT</name>
<price>1000</price>
</arrayOfProduct_2>
</ns1:purchase>
</env:Body>
</env:Envelope>
the array in the purchase method is passed only the ProductA('GOSPORT',1000).
Using the method purchaseA(String, ProductA[]) and the same input, the call works as
expected.
The bug seems related to JBXB-96 which is marked as fixed. My purchase() method works
with the 1.0.0.GA version of jboss-xml-binding (which was included with jboss 4.2.1.GA,
jbossws-1.2.1.GA), but fails in 1.0.0.SP1 (aka CR11) which has the fix for JBXB-96.
I looked at the test case created for this bug (org.jboss.test.xml.XsiTypeUnitTestCase).
In that test, the collection of objects is the only content of the message. I added a
test case to add a wrapper object with a member appearing before the collection. That
testcase fails in the same way as my webservice; only the last element of the collection
appears in the parent object.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: