Retrieving and Processing XML with ASP.Net
(Page 1 of 3 )
The .Net Framework includes an extensive set of tools for working with XML data. This article will explain how to retrieve remote XML data from an application that doesn’t necessarily provide Web Services yet, but transmits data in XML format. Also included is the code to process the returned data.
As we move into a new era of web application development, many sites and applications are providing web services for consumption by our web-based (or otherwise) client applications. However, an enormous number of applications do not provide standardized web services. Many do, however, provide the ability through an API to send a remote request to their system, and receive XML data in return.
A good example of this is if you’re working with a 3rd party, hosted CRM solution or Email Service Provider. You may want to work with the data locally, either in a client application, or even an intranet web application. You have perhaps the unique identifier for a product, or the email address of a user, and you wish to retrieve all of the information for use locally.
The Approach The approach I decided to take in this case was to create a class primarily for the transmission and retrieval of XML data. This is because I could see that the functionality would come in handy, and I would most likely want to use it in more than one place in my application, on quite possibly even in other applications down the road.
So rather than chopping up the code, I’ll just insert the code for the entire class file and insert comments outlining steps, which I’ll explain afterwards.
Next: The Code and Explanation >>
More ASP.NET Articles
More By Justin Cook