In SOA I believe that the wsdl does not support recursive data types but I saw some examples where the proxy actually works. Anybody knows more about this?
views:
293answers:
2
A:
Please define what you mean by recursive. The following is a valid XML Schema for use in a WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Node" type="NodeType"/>
<xs:complexType name="NodeType">
<xs:sequence>
<xs:element name="Node" type="NodeType"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
John Saunders
2009-09-18 14:12:53
Let's say you have something like this:[DataContract]public class Tree{[DataMember] public Tree Left{get;set;}[DataMember]public Tree Right{get;set;[DataMember]public String Data{get;set;}}}
Neo Christo
2009-09-18 14:39:03
Neo: that should work.
Anderson Imes
2009-09-18 15:50:57
in SOA , isn't it true that recursive data types are not supported?
Neo Christo
2009-09-18 16:00:41
@Neo: I've never heard that. If you can find a citation, please post it.
John Saunders
2009-09-18 16:05:18
+1
A:
Recursive type definitions are allowed and even cyclic object graphs are allowed and serializable. However, in order to keep from running out of stack space while serializing and deserializing, you'll need to create a custom behavior overriding the CreateSerializer method and setting the preserveObjectReferences parameter to true when its creating a DataContractSerializer. See James Kovacs' blog for more.
Travis Heseman
2009-09-18 18:19:47
Thank you Travis, this is the answer that I was looking for. Very good blog indeed
Neo Christo
2009-09-18 18:41:06