Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

issues using List in document/literal web services  RSS feed

 
senthil kumar
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
one of my method returns result in a List, which I am converting it into array to avoid deserialization error in webservices, could anyone explain why List is not supported in document-literal webservices.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch,

Please check your private messages.
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Document/literal web services don't support any implementation langauge specific types. Document/literal web services exchange XML documents as messages; period.

Marshalling/Unmarshalling of those documents is specific to the SOAP stack and the implementation langauge.

Java enterprise web services already transformed XML types with maxOccurs > 1 to and from arrays. There is no value in representing a java.util.List differently from an array in XML because the differences are largely in behavior. XML is semi-structured data; it doesn't model behavior.

Also it is easy enough to get an Array from a List (toArray) and to turn an array into a List (java.util.Arrays.asList).
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!