java - Deserialize an empty list in Web Services -


i'm having trouble deserializing empty list xml.

xml message i'm sending

 <dataobj>     <roleassignments />  </dataobj> 

java class i'm deserializing into

public class dataobj {    @xmlelementwrapper(nillable=true)    private list<roleassignmentdataobj> roleassignments; } 

what's happening i'm getting dataobj list of size 1 single object nulls values. if omit <roleassignments />, null in class.

how can empty list in java?

this blog posting gives examples of how jaxb xmlelementwrapper supposed work.

according it, have written should give empty collection; see "mapping #3".

so think real problem somewhere else. maybe schema not allow list empty. maybe input xml not think should be.


Comments

Popular posts from this blog

design - Custom Styling Qt Quick Controls -

Unable to remove the www from url on https using .htaccess -