Getting data from an XML serialised class .

  • Thread starter Thread starter Bredahl jensen
  • Start date Start date
B

Bredahl jensen

Hello,
I'm calling a web method of an xml web service. The method returns a class
that is
serialized according to an xml schema definition.
The xml schema is very extensive an has several level of nodes (child
nodes).

My question is: How can i best read data from the class that the web method
returns.

I'm thinking converting the class to a dataset. Does tha make any sens?


Many thanks in advance


JB
 
Bredhal,

It depends on what you are going to do with the class. If there are a
lot of relations between the nodes of data, then a data set might be better,
as it will capture those relations better. The reason for this is that with
XML Serialization, it does not take int account relations between nodes (if
one node references another node of data, it won't pick it up).

I think it would be easier to just use the dataset anyways, since you
have so many levels.

Hope this helps.
 
Great,
How do i go from the class to the dataset?
The class is serializable.
How to proceed to get the corresponding DataSet?
 
Jensen,

You can just call the ReadXml method on the DataSet to load the XML into
the dataset.
 
Back
Top