Click here to Skip to main content
16,015,583 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi All,

How to use XML Parsing in ASP.Net using web service. Can anyone tell and give sample?
Posted

You can do this a number of ways.

Using XmlDocument and XmlNode etc.

http://www.stardeveloper.com/articles/display.html?article=2009030701&page=1[^]

Using Xml Linq....e.g.

C#
XDocument posLog = XDocument.Load(posLogPath);
XNamespace ns = "http://www.somenamespace.org/IXRetail/namespace/";

// Query the data and write out a subset of contacts
var transactions = from transaction in posLog.Descendants(ns + "Transaction")
where transaction.Descendants(ns + "SomeRequiredCriteria").Any()


Try google, there are lots of examples of both techniques
 
Share this answer
 
Comments
Oshtri Deka 18-May-12 3:36am    
Good answer. 5.
XML parsing is performed the ame way, regardless of the platform (asp.net app, web service, windows service, winforms app, etc). I would use Xml.Linq personally because those classes are easier to deal with than the legacy .Net classes.

Parsing XML is too big of a topic to discuss in its entirety in Quick Answers. Google is your friend.
 
Share this answer
 
Comments
Oshtri Deka 18-May-12 3:36am    
Excellent answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900