If a web service returns an object graph where some objects appear multiple times, will the data about these objects necessarily be duplicated in the transport format?
Put differently: With Java serialization, each object's state is written only once, and subsequent references to that object are mere pointers within the serialization stream. Is there a (preferable portable, i.e. WI-Basic-Profile compliant) way to achieve the same when (un)marshalling a webservice request or response?
Example: Given the classes
class Project {
Task[] tasks;
}
class Task {
User assignee;
}
class User {
// some data
}
The webservice is supposed to return a Project
, and I'd like to send each User
at most once, regardless of how many tasks he is assigned in the project.