Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Nasir Ahmed
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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





 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic