简体   繁体   中英

WP7 Help with XML Web Service! (How to send XML Data as Request using XML Web Service and receive and display the data)

I am trying to figure out how to make apps, i got all the basics and even more but what i want to no is how to create an app that you have a search bar and when you search it sends a requests a xml file from a server, the server send back the xml file and i display it. i look all over on how to do this but i couldn't find any tutorials. can anyone help?

More Detail:

I want to create a very basic app which accesses an XML file at a web address and displays the various items within the file as text within the app. I've come across several tutorials which all seem to do it in a different way, or aren't explaining exactly the thing it is I want to do. I don't want to search the XML file, I don't want to update it, I just want to retrieve it's contents. Within the XML file are "items" and within those are categories like "title" and "description". I want the app to list all of the items and within each one display it's title and description.

How you download the xml will depend how the server you're interacting with serves the documents. Assuming it is a RESTful service, you can download a document from a specific URL using HttpWebRequest.

This sample project will show you how to use HttpWebRequest.

WebClient, HttpWebRequest and the UI Thread on Windows Phone 7

The stream object created in the ResponseCallback method can be passed instead to XDocument.Load to read the supplied XML data using LINQ.

This sample project will show you how do that and bind the retrieved data to a listbox for display.

binding a Linq datasource to a listbox

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM