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 7877233
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:18:33+00:00 2026-06-03T03:18:33+00:00

I’m trying to deserialize a reponse from a REST API. <FieldListDTO xmlns=\api.playcento.com/1.0\ xmlns:i=\http://www.w3.org/2001/XMLSchema-instance\> <Allfield>

  • 0

I’m trying to deserialize a reponse from a REST API.

"<FieldListDTO xmlns=\"api.playcento.com/1.0\" xmlns:i=\"http://www.w3.org/2001/XMLSchema-instance\">
<Allfield>
<FieldDTO>
<Fieldname>Mobile nr</Fieldname>
<Fieldtype>T</Fieldtype>
<Fieldvalue>003241234578</Fieldvalue>
<Fk_id_page>CP584ea74ce5ad4e2d8561d75fc6944f96</Fk_id_page>
<Id_field>FI152dcde5ef9849898b12d6a3f2cdb4ee</Id_field>
<Required>true</Required>
</FieldDTO>
</Allfield>
<Totalcount>1</Totalcount>
</FieldListDTO>"

The Field class:

namespace PlaycentoAPI.Model
{
    [XmlRoot("FieldListDTO",Namespace = "api.playcento.com/1.0")]
    [XmlType("FieldListDTO")]
    public class FieldListDTO
    {
        public FieldListDTO() { }

        [XmlElement("Totalcount")]
        public int TotalCount { get; set; }

        [XmlArray("Allfield")]
        [XmlArrayItem("FieldDTO", typeof(Field))]
        public Field[] Field { get; set; }

    }
    [XmlRoot("FieldDTO", Namespace = "api.paycento.com/1.0")]
    [XmlType("FieldDTO")]
    public class Field
    {
        public Field()
        {
        }

        [XmlElement("Id_field")]
        public string ID_Field { get; set; }
        [XmlElement("Fieldtype")]
        public string FieldType { get; set; }
        [XmlElement("Fk_id_page")]
        public string FK_ID_PAGE { get; set; }
        [XmlElement("Required")]
        public bool Required { get; set; }
        [XmlElement("Fieldname")]
        public string FieldName { get; set; }
        [XmlElement("Fieldvalue")]
        public string FieldValue { get; set; }
    }
}

My code which calls the API and deserializes it:

string response = Helper.PerformAndReadHttpRequest(uri, "GET", "");
                FieldListDTO myObject;
                XmlReaderSettings settings = new XmlReaderSettings();
                using (StringReader textReader = new StringReader(response))
                {
                    using (XmlReader xmlReader = XmlReader.Create(textReader, settings))
                    {
                        XmlSerializer mySerializer = new XmlSerializer(typeof(FieldListDTO));
                        myObject = (FieldListDTO)mySerializer.Deserialize(xmlReader);
                    }
                }
                return myObject.Field;

In my actual response, I’m getting back 14 FieldDTO’s. After deserializing the xml, FieldListDTO myObject contains TotalCount = 14 and Field is an array containing 14 Field’s. But all the properties of these fields are NULL (or false).

I’m using the same method for several other API calls. I’ve compared the classes and the only difference that I see is that the class (Field) has an bool property. So I thought that was the problem. I’ve changed the bool property to a string but still all the properties were NULL after deserialization.

  • 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-06-03T03:18:34+00:00Added an answer on June 3, 2026 at 3:18 am

    First thing to catch my eye is that the namespace in your FieldDTO class doesn’t match the one in the XML document.

    "api.paycento.com/1.0"
    "api.playcento.com/1.0"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string

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.