[Mono-dev] [PATCH] System.Web.Services: remove extra documentation item(s) from wsdl

Konstantin Triger kostat at mainsoft.com
Mon Mar 5 04:29:08 EST 2007


Hi Eno,

Suppose someone has a class with the following property defined:

[XmlAnyElement (Name="Some name", Namespace="some namesapce")]
public XmlElement DocumentationElement
{
	get { return docElement; }
	set { docElement = value; }
}

The SerializationCodeGenerator will produce something like this:

if (o119 is XmlElement) {
	if ((o119.LocalName == "name from the XmlAnyElement attribute" && o119.NamespaceURI == 
		"NS from the XmlAnyElement attribute")) { }
	else o119.WriteTo (Writer); 
	
	WriteElementLiteral (o119, "", "", false, true);
}
	else throw CreateUnknownAnyElementException (o119.Name, 				o119.NamespaceURI);

So, currently, any element will be serialized, sometimes twice.
The .Net creates different code, something like this:

if ((o119.LocalName == "name from the XmlAnyElement attribute" && 	o119.NamespaceURI == 
		"NS from the XmlAnyElement attribute"))
	WriteElementLiteral (o119, "", "", false, true);
else throw CreateUnknownAnyElementException (o119.Name, 				o119.NamespaceURI);


Regards,
Konstantin Triger

> -----Original Message-----
> From: Atsushi Eno [mailto:atsushi at ximian.com]
> Sent: Monday, March 05, 2007 10:39 AM
> To: Konstantin Triger
> Cc: Mono Development List
> Subject: Re: [Mono-dev] [PATCH] System.Web.Services: remove extra
> documentation item(s) from wsdl
> 
> Hi Kosta,
> 
> Konstantin Triger wrote:
> > Hi Eno,
> >
> > That's right, in Sys.Web.Services exists only "wsdl:documentation" case.
> But since you make a change in the generator code, the fix should be
> generic.
> >
> > What I mean is that if someone outside the Sys.Web.Services will create
> such a code and pass something different to "wsdl:documentation", he will
> get results different than on .net.
> 
> Hmm I still don't get it - do you think that our
> SerializationCodeGenerator is now hardcoded to detect "documentation"
> in wsdl namespace? If not, what is the "generic" case that is in
> trouble? (That's kind of why I asked concrete trouble case ...)
> 
> Atsushi Eno


More information about the Mono-devel-list mailing list