File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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".