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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:11:22+00:00 2026-05-25T01:11:22+00:00

After I send a request with the required parameters in the response I get

  • 0

After I send a request with the required parameters in the response I get the following XML:

<content>
    <main>
        <IMGURL>image url</IMGURL>
        <IMGTEXT>Click Here</IMGTEXT>
        <TITLE>image title</TITLE>
        <IMGLINK>image link</IMGLINK>
    </main>
</content>

and I also made the following two classes:

[Serializable]
public class content
{
    private Main _main;
    public content()
    {
        _main = new Main();
    }
    public Main Main
    {
        get { return _main; }
        set { _main = value; }
    }
}

[Serializable]
public class Main
{
    public string IMGURL { get; set; }
    public string IMGTEXT { get; set; }
    public string TITLE { get; set; }
    public string IMGLINK { get; set; }
}

While debugging I can see that in the response I get the wanted results. However I’m having troubles deserializing the XML and populating the object.


Call to the method:

public static class ImageDetails
    {
        private static string _url = ConfigurationManager.AppSettings["GetImageUrl"];

        public static content GetImageDetails(string ua)
        {
            var contenta = new content();
            _url += "&ua=" + ua;
            try
            {
                WebRequest req = WebRequest.Create(_url);
                var resp = req.GetResponse();
                var stream = resp.GetResponseStream();

                //var streamreader = new StreamReader(stream);

                //var content = streamreader.ReadToEnd();



                var xs = new XmlSerializer(typeof(content));
                if (stream != null)
                {
                    contenta = (content)xs.Deserialize(stream);
                    return contenta;
                }
            }
            catch (Exception ex)
            {
            }
            return new content();
        }
    }
  • 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-25T01:11:23+00:00Added an answer on May 25, 2026 at 1:11 am

    The serializer is case-sensitive. You either need to rename the property content.Main to main or add the attribute [XmlElement("main")] to it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know that it's possible to get SVN to send emails after a commit
Problem After downloading a CSV once, the form does not send a request on
After user places an order I have to send detailed email message containing order
I want to send an Email message after a page is returned to the
i want to send an email to user after he sign-up with code.for ex
I need send certain attributes(say, human readable user name) from server to client after
Is it possible for Uploadify to send out e-mail confirmation after the upload? Uploadify
I need to send files using the BizTalk 2006 (non wcf) FTP adapter. After
On a PHP-based web site, I want to send users a download package after
I know barely nothing about JSON and I need to send a request to

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.