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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:58:06+00:00 2026-05-18T06:58:06+00:00

I want to consume an XML-RPC service built in PHP for my WP7 app

  • 0

I want to consume an XML-RPC service built in PHP for my WP7 app but I cannot find any examples without using xml-rpc.net’s library. I cannot create a reference to that library because it wasn’t built using the Windows Phone runtime (as VS so politely informed me).

A poster on a similar question on stackoverflow (sadly, I cannot add comments yet) suggested to use the CF version of the library but I get the same error when I try to create a reference.

I guess, if there’s no way to use that library, an alternative would be to use HttpWebRequest and parse the XML manually.

Thanks in advance for any replies!

Edit:

Here’s the XML returned, how could I go about parsing that?

XML Response: link text (Sorry for the external link, I couldn’t copy paste all that here)

  • 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-18T06:58:07+00:00Added an answer on May 18, 2026 at 6:58 am

    Have a look at my answer to this question.

    It shows a simple example of using WebClient to get XML data from a website and then parsing it. It’s not tricky.

    While the example uses WebClient, this blocks on the UI thread when processing the completed thread so you will probably want to consider using HttpWebRequest instead if your processing of the returned XML is anything but trivial.

    Edit:
    You could do something like the following to process your response:

    var myStructs = new List<MyStruct>();
    
    foreach (var child in xml.Elements("params").Elements("param").Elements("value").Elements("array").Elements("data").Elements("value"))
    {
        var newStruct = new MyStruct();
    
        var members = child.Elements("struct").Elements("member");
    
        foreach (var member in members)
        {
            switch (member.Elements("name").First().Value)
            {
                case "id":
                    newStruct.Id = int.Parse(member.Elements("value").First().Elements("int").First().Value);
                    break;
                case "idParent":
                    newStruct.IdParent = int.Parse(member.Elements("value").First().Elements("int").First().Value);
                    break;
                case "idUser":
                    newStruct.IdUser = int.Parse(member.Elements("value").First().Elements("int").First().Value);
                    break;
                case "rating":
                    newStruct.IdUser = int.Parse(member.Elements("value").First().Elements("int").First().Value);
                    break;
                case "imageUrl":
                    newStruct.ImageUrl = member.Elements("value").First().Elements("int").First().Value;
                    break;
                case "message":
                    newStruct.Message = member.Elements("value").First().Elements("int").First().Value;
                    break;
                case "title":
                    newStruct.Title = member.Elements("value").First().Elements("int").First().Value;
                    break;
                case "username":
                    newStruct.Username = member.Elements("value").First().Elements("int").First().Value;
                    break;
                case "ytVideoId":
                    newStruct.YtVideoId = member.Elements("value").First().Elements("int").First().Value;
                    break;
            }
        }
    
        myStructs.Add(newStruct);
    }
    

    This assumes you have the following

    internal struct MyStruct
    {
        public int Id { get; set; }
        public int IdParent { get; set; }
        public int IdUser { get; set; }
        public string Title { get; set; }
        public string Message { get; set; }
        public int Rating { get; set; }
        public string Username { get; set; }
        public string ImageUrl { get; set; }
        public string YtVideoId { get; set; }
    }
    

    and that the variable xml is an XElement holding the response.

    I’ll happily admit it’s not pretty, but it works. You’ll probably want to add lots of error handling!

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

Sidebar

Related Questions

I want to consume a REST service in my web app (.war with 6.0.0.Final),
I want to consume a web service that is running on the local machine
I'm developing a JSF 2.0 app that consumes a SOAP-based web service. I want
I am trying to create an application will consume XML web service from one
I have a webservice, written in PHP, which I want to consume in a
I want to consume a web service using jquery's get function. There is no
i want to consume a php Webservice from C# which is protected by htaccess.
I want to consume wordpress XMLRPC API for my latest experiment. Do you know
I want to consume a webservice and show that answer in tabhost on android.How
I have a wcf serivce I want to consume from a j2me application (blackberry).

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.