Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7128935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:11:24+00:00 2026-05-28T11:11:24+00:00

I have an xml file.i need to serialize to c# class. <Configs> <Services> <Path>

  • 0

I have an xml file.i need to serialize to c# class.

<Configs>
     <Services>
    <Path>
      <Url>test</Url>
      <ID>1234</ID>
    </Path>
      <Path>
      <Url>java</Url>
      <ID>1234</ID>
    </Path>
    </Services>
    <Certification>
      <name>Mark</name>
      <name>Peter</name>
    </Certification>
    </Configs>
  </Configuration>

I need to serialize this into a class

I have written the following class.

 public class Configuration
        {
            public Certification Configs { get; set; }
            public Path[] Services { get; set; }
        }

        public class  Certification
        {
            [XmlArray("Certification")]
            [XmlArrayItem("name")]
            public string[] name { get; set; }

          }

        public class Path
        {
            public string Url { get; set; }
            public string ID { get; set; }
        }

I am getting the value of Certification class and its value.
I created an object for Configuration and looped

foreach (string Name in obj.Configs.name)
{
}

this is working.

But i am not getting the value of Services.
This is not working getting null on obj.services

   Foreach (Path serviceUrl in obj.Services)
    {
    }

obj.Services is null

How to get the value of url and ID node in Path?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T11:11:25+00:00Added an answer on May 28, 2026 at 11:11 am

    Your Services array is in the wrong class. It should be inside the Configs property of the root class:

    public class Configuration
    {
        public Certification Configs { get; set; }
    }
    
    public class Certification
    {
        [XmlArray("Certification")]
        [XmlArrayItem("name")]
        public string[] name { get; set; }
    
        public Path[] Services { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following class that I want to serialize to an XML file
I need to serialize an XML java object to a XML file using the
I have an xml file where I need to comment out a whole piece
I have an XML file which I need to parse using PHP and send
i have an xml file sitemap.xml as shown below ..i need to add one
HI I have an xml file with 500KB size which i need to send
i have a log file which contains hundreds/thousands of seperate XML messages and need
I have an XML file that starts like this: <Elements name=Entities xmlns=XS-GenerationToolElements> I'll have
I am creating an XML file using the System.Xml.Serialization module. I have a class
For my application, I need to serialize data to file using XML, so I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.