With SOAP encoding you can have an ID attribute with SOAP encoded elements and use HREF that references them. With literal encoding this is not allowed.
Literal bindings require the literal data be a 1 to 1 translation to valid schema (which has no native concept of representing a circular graph, and explicitly forbids them). If there is a need to represent circular data, then that is up to the developer to define custom elements or attributes in their schema to represent these link associations. So you could define something like
However it is your responsibility to transform the id fields to an object reference.
<xs:complexType name="employeeType"> <xs:sequence> <xs:element name="id" type="xsd:int"/> <xs:element name="manager" type="xsd:int"/> </xs:sequence> </xs:complexType>
Bottome line: it is not supported with ws4ee, which only allows literal encoding
Thank you very much. I have solved the problem by creating a custom serializer that adds an ID to the object as an attribute and then when the same object is meant to be serialized again just creates it as null with two attributes specifying that it is a reference and the ID. Not really a portable solution but it works very nicely.