SOAP Web services: object aliasing in response?
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.
It appears that SOAP can serialize object graphs by using encodingStyle
, but using encodingStyle
contradicts WS-I Basic Profile 1.1. (source)
精彩评论