This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Unable to bind a collection when the parent mapping uses flexible= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Unable to bind a collection when the parent mapping uses flexible="true"." Watch "Unable to bind a collection when the parent mapping uses flexible="true"." New topic
Author

Unable to bind a collection when the parent mapping uses flexible="true".

Nasir Ahmed
Greenhorn

Joined: Apr 25, 2012
Posts: 1

Unable to bind a collection when the parent mapping has attribute flexible="true".
Getting error
All child components must define element names for flexible='true';
when including the flexible="true" at the binding level .

If flexible attribute is removed from parent element, then it parses but gives run-time error
XmlBindingService: Could not unmarshal the response. MappedClass [ com.ProvisionRequest ]
org.jibx.runtime.JiBXException: Expected "Order" start tag, found "namePrefix" start tag (line 1, col 1933, in UTF-8)


Below are the snippets of files used.

Request.xml

Binding xml


com.envelope.OrderEnvelope.java



com.envelope.CustomerContactInfoEnvelope.java





 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to bind a collection when the parent mapping uses flexible="true".