I have the following xml Schema:
“<?xml version="1.0" encoding="Windows-1252"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Document">
<xs:complexType>
<xs:sequence>
</xs:sequence>
<xs:attribute name="name" type="xs:string" />
</xs:complexType>
</xs:element>
<xs:element name="Folder">
<xs:complexType>
<xs:sequence>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="Folder" />
<xs:element ref="Document" />
</xs:sequence>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:schema>”
I want to pass xml documents into a web service that conforms to this
schema. What I have tried to do is use the xsd /c tool to produce a class
based on the schema then have a method definition as follows:
[WebMethod]
public bool test(Folder test)
{
return true;
}
This only allows me to pass in a folder containing one document. The schema
allows for each folder to contain any number of folders or documents. What
can I do to enable this to work?
Thanks