DataSet.ReadXml - where the schema name is?

R

RA

Hi

I have an xml schema and I have created a dataset from that schema.
I have a web service that recieve info and sends back an xml information.
I send back the xml using SchemaDataset.WriteXml (...)
A consumer of the web service then call a different method of the web
service which takes an xml string as an input parameter.
I need to load this xml string into the Schemadataset. I do that using the
following:

SchemaDataset.ReadXml (...)

My question is:

I assume that the dataset validated the xml string agianst its schema - well
then where does the dataset gets the schema from?
Here is the info that the web service method gets

<MyDatasetSchema xmlns=http://www.myweb.com/schema/MyDatasetSchema.xsd>
<StoreList>
<StoreId>5</StoreId>
</StoreList>
</MyDatasetSchema >

Thanks
 
J

Joyjit Mukherjee

Hi,

if you didn't specify the XML schema associated with the XML file as a
socond optional parameter to the Dataset.ReadXml method, it does the
following: -

1. if the xml has a schema(in-line or separate), it sets XmlReadMode to
ReadSchema.
2. if the Xml contains both original & current values, it sets XmlReadMode
to DiffGram.
3. if the xml does not have an in-line schema so as the dataset, it sets
XmlReadMode to InferSchema.

So, in your case, it infers the schema from the Xml data.

HTH
Regards
Joyjit
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top