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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:09:51+00:00 2026-06-16T22:09:51+00:00

Hello i learning about this stuff an i need to send request to site

  • 0

Hello i learning about this stuff an i need to send request to site get xml in response than deserialize it and see anything what was inside… i created request deserialize method and stream method and Xml Schema but now i dont know what next and it doest working so if anybody know about some nice tutorial pls give me link.

public static class LoadXml
{
    public static root material;



    public static void LoadXML()
    {
        var serviceUrl = "http://api.deezer.com/2.0/artist/27&output=xml";
        string serviceName = "Deezer";

        HttpWebRequest request = null;
        WebResponse response = null;

        request = WebRequest.Create(serviceUrl) as HttpWebRequest;
        request.Method = "GET";
        request.ContentType = " text/xml";



        material = Deserialize<root>(GetResponseStream(request, response, serviceName));

        Console.WriteLine(material.ToString());
    }

    public static T Deserialize<T>(MemoryStream stream)
    {
        XmlSerializer serializer = new XmlSerializer(typeof(T));
        T result = (T)serializer.Deserialize(stream);

        return result;
    }

    public static MemoryStream GetResponseStream(HttpWebRequest request, WebResponse response, string debugServiceName)
    {

        response = request.GetResponse();

        MemoryStream stream = new MemoryStream();
        response.GetResponseStream().CopyTo(stream);
        stream.Position = 0;

        return stream;
    }

}
  • 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-16T22:09:53+00:00Added an answer on June 16, 2026 at 10:09 pm

    Place (or load) the results into an [XDocument][1] and work with it from there by manipulating and extracting data from the document.

    Using the url as a starting point this is a snippet (easier way to load; try it) where we load it and then look at a target child node if the structure returned was (\root\name):

    XDocument doc = XDocument.Load(@"http://api.deezer.com/2.0/artist/27&output=xml");
    
    Console.WriteLine ( doc.ToString() );
    
    /*
    <root>
      <id><![CDATA[27]]></id>
      <name><![CDATA[Daft Punk]]></name>
      <link><![CDATA[http://www.deezer.com/artist/27]]></link>
      <picture><![CDATA[http://api.deezer.com/2.0/artist/27/image]]></picture>
      <nb_album><![CDATA[54]]></nb_album>
      <nb_fan><![CDATA[592180]]></nb_fan>
      <radio><![CDATA[1]]></radio>
      <type><![CDATA[artist]]></type>
    */
    
    Console.WriteLine ( doc.Element("root").Element("name").Value);
    // Outputs:
    // Daft Punk
    

    Update Alternate Load (Parse)

    var xml = @"
    <root>
      <id><![CDATA[27]]></id>
      <name><![CDATA[Daft Punk]]></name>
      <link><![CDATA[http://www.deezer.com/artist/27]]></link>
      <picture><![CDATA[http://api.deezer.com/2.0/artist/27/image]]></picture>
      <nb_album><![CDATA[54]]></nb_album>
      <nb_fan><![CDATA[592180]]></nb_fan>
      <radio><![CDATA[1]]></radio>
      <type><![CDATA[artist]]></type>
    </root>";
    
    var doc = XDocument.Parse( xml );
    
    Console.WriteLine ( doc.Element("root").Element("name").Value);
    // Outputs
    // Daft Punk
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am learning about build.xml file for ant build. I have a simple Hello
Hello Guys! I started learning python GUI development. Let's say I have this script:
I'm learning javascript. Poked around this excellent site to gather intel. Keep coming across
Hello I am just learning more about using classes in PHP. I know the
Hello I am new to codeigniter. I am learning this framework by developing a
hello i am learning PHP and came upon this multi-level array after using print_r
I am learning about pmap and wrote the following function: (pmap #((println hello from
I'm learning about the autotools and made it through a hello world scenario and
Hello everyone I have a quick question. I am learning about HTML and CSS
I am learning about C++ and programming to the windows api. My first Hello

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.