How to compile a schema that uses a DataSet (xs: schema)?

I created the simplest web service in C #:

public void AddData(DataSet ds)

The generated schema (Wsdl) looks like this:

<s:schema xmlns:s="http://www.w3.org/2001/XMLSchema">
...
<s:element ref="s:schema" />
...
</s:schema>

Please note: the schema does not contain import / inclusion elements.

I am trying to load this schema in C # System.Xml.XmlSchema and add it to System.Xml.XmlSchemaSet:

var set = new XmlSchemaSet();
var fs = new FileStream(@"c:\temp\schema.xsd", FileMode.Open);
var s = XmlSchema.Read(fs, null);
set.Add(s);            
set.Compile();

The last line throws this exception:

The 'http://www.w3.org/2001/XMLSchema:schema' element is not declared.

This makes sense: a .Net-generated schema uses the type "s: schema", which is declared in a schema that is not imported.

+5
2
+2

, , WSDL, : " - XML , , ". , WSDL .

-1

All Articles