Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to access this data ( XML, C# Deserialize )

Posted on 2008-06-25
4
Medium Priority
?
1,396 Views
Last Modified: 2008-09-18
I need to deserialize this xml file. And access the value using C#..

the value i want to access is

<Image Kdf=\"PRgo=\" />

thanks
so far what i have 
 
 XmlReaderSettings settings = new XmlReaderSettings();
            XmlSerializer serializer2 = new XmlSerializer(typeof(ISOReponsesType1));
            System.IO.StringReader stringReader2 = new System.IO.StringReader(myString);
            XmlReader xmlReader2 = XmlReader.Create(stringReader2, settings);
            ISOReponsesType1 svcResp = (ISOReponsesType1)serializer2.Deserialize(xmlReader2);
 
 
            ReportsType report = (ReportsType)svcResp.Items[1];
 
 
            string myText = "";
            ResponsesType responses = (ResponsesType)report.Responses;
 
            ....
 
we also have a wrapper class

Open in new window

0
Comment
Question by:beos1907
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Author Comment

by:beos1907
ID: 21870941
also we have a wrapper class
public partial class ResponseType
{
    private ReportType report2Field;
    private object itemField;
 
    /// <remarks/>
    [System.Xml.Serialization.XmlElementAttribute("ErrorReturn", typeof(ErrorReturn))]
    [System.Xml.Serialization.XmlElementAttribute("Report", typeof(RepCostReportType), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
    [System.Xml.Serialization.XmlElementAttribute("root", typeof(HomeValueErrorsType), Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
    public object Item
    {
        get
        {
            return this.itemField;
        }
        set
        {
            this.itemField = value;
        }
    }
 
etc.. 

Open in new window

0
 
LVL 11

Accepted Solution

by:
Vivek Thangaswamy earned 2000 total points
ID: 21871716
Hope this helps you
http://www.codeproject.com/KB/XML/webservicessimple.aspx
// Data Binding :: DataSet Appending
public void DataBindFrmWS()
{
   XmlDocument myServiceDoc = new XmlDocument();
   System.Xml.XmlNode neNode;
   //Adding the resulting XML from WebMethod to a user created XmlNode
   neNode = myService1.GetDataFromDB();
   //Creating a Dataset
   DataSet myDataSet = new DataSet();
   //The XmlNode is added to a byte[]
   byte[] buf = System.Text.ASCIIEncoding.ASCII.GetBytes(neNode.OuterXml);
   System.IO.MemoryStream ms = new System.IO.MemoryStream(buf);
   //The XML is readed from the MemoryStream
   myDataSet.ReadXml(ms);
   
   GridView1.DataSource = myDataSet.Tables[0];
   GridView1.DataBind();
}

Open in new window

0
 
LVL 11

Expert Comment

by:Vivek Thangaswamy
ID: 22237316
Hi beos1907,
Is my solution helped you?
0

Featured Post

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question