G
Guest
I am writing a web service in C#. One method queries a database for xml
formatted data and responds to the requester with an XMLDocument (this part
works fine). What I want now is another method that will return the schema
for that document.
My idea is to create a DataSet using the xml document and inferring its
schema (the data sources for these xml docs are varied). Then the schema
could be extracted from the dataset and sent to the requester.
But looking at the methods available to DataSet, it seems I would have to
WriteXmlSchema to a file on the server then use XmlSchema.Read to get back a
XmlSchema that I could then send in the response.
Surely there is a better way to get the schema into the response?
formatted data and responds to the requester with an XMLDocument (this part
works fine). What I want now is another method that will return the schema
for that document.
My idea is to create a DataSet using the xml document and inferring its
schema (the data sources for these xml docs are varied). Then the schema
could be extracted from the dataset and sent to the requester.
But looking at the methods available to DataSet, it seems I would have to
WriteXmlSchema to a file on the server then use XmlSchema.Read to get back a
XmlSchema that I could then send in the response.
Surely there is a better way to get the schema into the response?