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

  • Home
  • SEARCH
  • 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 8217573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:30:12+00:00 2026-06-07T12:30:12+00:00

At the moment, I am generating xml and json data using the following code:

  • 0

At the moment, I am generating xml and json data using the following code:

public class App
{
    public string app_name;
    public string app_path;

    public App(string m_app_name, string m_app_path)
    {
        app_name = m_app_name;
        app_path = m_app_path;
    }

    public App() { }
}

[ScriptService]
public class Apps : WebService {
    List<App> App = new List<App>();

    SqlConnection connection;
    SqlCommand command;
    SqlDataReader reader;

    [WebMethod()]
    public List<App> GetUserApps()
    {
        var apps = new List<App>();

        using (connection = new SqlConnection(ConfigurationManager.AppSettings["connString"]))
        {


                using (command = new SqlCommand(@"some query here", connection))
                {
                    connection.Open();
                    using (reader = command.ExecuteReader())
                    {
                        int AppNameIndex = reader.GetOrdinal("application_name");
                        int AppPathIndex = reader.GetOrdinal("application_path");

                        while (reader.Read())
                        {
                            apps.Add(new App(reader.GetString(AppNameIndex), reader.GetString(AppPathIndex)));
                        }
                    }
                }



        }

        return apps;
    }
}

If I then request this in javascript using application/json; charset=utf-8, I automatically get json data.

My problem is that I need to get data from an external RSS feed, instead of a local database, and convert that to json data so I can call it the same way using javascript.

Anyone know how I can capture the RSS feed http://www.hotukdeals.com/rss/hot using similar code as above?

  • 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-07T12:30:13+00:00Added an answer on June 7, 2026 at 12:30 pm

    Add a refrence to System.ServiceModel.Web and use the following code:

        [WebMethod()]     
        public List<Deal> GetDeals()
        {
            var deals = new List<Deal>();
    
            XmlReader xr = XmlReader.Create("http://www.hotukdeals.com/rss/hot");
            SyndicationFeed feed = SyndicationFeed.Load(xr);
    
            foreach (var item in feed.Items)
            {
                deals.Add(new Deal { Title = item.Title.Text, Summary = item.Summary.Text });
            }
    
            return deals;
        }
    

    Replace the Deal class above with whatever class you need for your app and add some error handling as well 🙂

    Check the SyndicationFeed documentation for details.


    To read a dc:date property, add

    using System.Xml.Linq;
    

    and then add this in the foreach loop ( converts the first date )

            var dates = item.ElementExtensions.Where(x => x.OuterName == "date");
    
            if(dates.Count() > 0) 
            {
                var element = dates.First().GetObject<XElement>();
                var d = DateTime.Parse(element.Value);
            }
    

    I found it in this article: Reading non-standard elements in a SyndicationItem with SyndicationFeed

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

Sidebar

Related Questions

I'm generating code in java using SWIG. One of the generated class belongs to
Till this moment I used this method to invoke: public string AddText { set
A PHP script is generating the following table panel based on the data from
At moment I want to implement picture upload without using any plug-ins. My upload
At the moment I'm using JavaFX only for fun and learning it. What I
I noticed a moment ago that my .gitconfig -file was public at my repo.
A bit on my requirements, at the moment i'm passing on a search string
I am using xjc to generate Java classes from the XML schema and the
How do you get started generating native code for a target platform? I've got
I am using a CMS system, which has a template for generating forms, with

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.