So, I have the following data contract:
[DataContract(Namespace = "http://abc/Services/Data")]
public abstract class AbcObject
{
[DataMember]
[XmlAnyElement]
public XmlElement[] Any { get; set; }
}
My expectation is to see the following corresponding xs:complexType
element in the generated wsdl:
<xs:complexType name="AbcObject">
<xs:sequence>
<xsd:any minOccurs="0"/>
</xs:sequence>
</xs:complexType>
However, what I actually see is:
<xs:complexType name="AbcObject">
<xs:sequence>
<xs:element name="Any" type="q1:ArrayOfXmlElement" nillable="true" minOccurs="0" xmlns:q1="http://schemas.datacontract.org/2004/07/System.Xml"/>
</xs:sequence>
</xs:complexType>
So, this is not what I want, but I am kind of puzzled how to get the xsd:any
generated for me.
Any ideas?
EDIT 1
As per jamiemeyer advice I have changed the DFObject.Any
property to be of type XmlAttribute[]
. Here is the result:
<xs:complexType name="DFObject">
<xs:sequence>
<xs:element name="Any" type="q1:ArrayOfArrayOfanyType" nillable="true" minOccurs="0" xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays"/>
</xs:sequence>
</xs:complexType>
Although the result is different, it is still not xsd:any
.