Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-08-11 19:09:11 +0400
committerGonzalo Paniagua Javier <gonzalo.mono@gmail.com>2009-08-11 19:09:11 +0400
commit3f0c47aa48d9a81cba57f7c78b36408225241550 (patch)
tree22b15a30bed93a5cf20860a2ed31440fbfb6f27e /data
parentd431cd0cae736ea806076b1faa0e0d8e0700d2e5 (diff)
2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
* DefaultWsdlHelpGenerator.aspx: the 'Message Layout' can now handle self-referencing types. Fixes bug #529353. svn path=/trunk/mono/; revision=139712
Diffstat (limited to 'data')
-rw-r--r--data/net_2_0/ChangeLog5
-rw-r--r--data/net_2_0/DefaultWsdlHelpGenerator.aspx16
2 files changed, 19 insertions, 2 deletions
diff --git a/data/net_2_0/ChangeLog b/data/net_2_0/ChangeLog
index 09f2a825968..d925a1e415a 100644
--- a/data/net_2_0/ChangeLog
+++ b/data/net_2_0/ChangeLog
@@ -1,3 +1,8 @@
+2009-08-11 Gonzalo Paniagua Javier <gonzalo@novell.com>
+
+ * DefaultWsdlHelpGenerator.aspx: the 'Message Layout' can now handle
+ self-referencing types. Fixes bug #529353.
+
2009-08-05 Atsushi Enomoto <atsushi@ximian.com>
* web.config: add WCF assemblies as references at compilation.
diff --git a/data/net_2_0/DefaultWsdlHelpGenerator.aspx b/data/net_2_0/DefaultWsdlHelpGenerator.aspx
index 6d02af355e9..4750b01f141 100644
--- a/data/net_2_0/DefaultWsdlHelpGenerator.aspx
+++ b/data/net_2_0/DefaultWsdlHelpGenerator.aspx
@@ -10,6 +10,7 @@
--%>
<%@ Import Namespace="System.Collections" %>
+<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Xml.Serialization" %>
<%@ Import Namespace="System.Xml" %>
@@ -1035,7 +1036,7 @@ public class HtmlSampleGenerator: SampleGenerator
if (elem == null) throw new InvalidOperationException ("Element not found: " + qname);
WriteElementSample (xtw, qname.Namespace, elem);
}
-
+
void WriteElementSample (XmlTextWriter xtw, string ns, XmlSchemaElement elem)
{
bool sharedAnnType = false;
@@ -1129,9 +1130,18 @@ public class HtmlSampleGenerator: SampleGenerator
{
WriteAttributes (xtw, stype.Attributes, stype.AnyAttribute);
}
-
+
+ Dictionary<XmlSchemaComplexType,int> recursed_types = new Dictionary<XmlSchemaComplexType,int> ();
void WriteComplexTypeElements (XmlTextWriter xtw, string ns, XmlSchemaComplexType stype)
{
+ int prev = 0;
+ if (recursed_types.ContainsKey (stype))
+ prev = recursed_types [stype];
+
+ if (prev > 1)
+ return;
+ recursed_types [stype] = ++prev;
+
if (stype.Particle != null)
WriteParticleComplexContent (xtw, ns, stype.Particle);
else
@@ -1141,6 +1151,8 @@ public class HtmlSampleGenerator: SampleGenerator
else if (stype.ContentModel is XmlSchemaComplexContent)
WriteComplexContent (xtw, ns, (XmlSchemaComplexContent)stype.ContentModel);
}
+ prev = recursed_types [stype];
+ recursed_types [stype] = --prev;
}
void WriteAttributes (XmlTextWriter xtw, XmlSchemaObjectCollection atts, XmlSchemaAnyAttribute anyat)