C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » Webservices »

Parsing a XML file using WebService


Posted Date: 11 Jul 2006      Posted By: bingi      Member Level: Silver     Points: 2   Responses: 2



Hi All,
My requirment is to parse a XML file using webserce. That is a XML file will be taken as an input which contains username and password. How to parse this XML file ? and how to give input as a xml file using webservice. Can anybody help regarding this ?

Thanks
Bingi





Responses

Author: Abhishek Arya    12 Jul 2006Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

use this kb for the same

http://www.dotnetspider.com/kb/Article2065.aspx



Author: MOHAN BABU DODDAPANENI    17 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 5

Two different ways of doing it

1) If the web service is internal (intranet) - Have the web method that takes the location of the file. But this should be a shared location with appropriate permissions on the location. Once it is available, inside the web method XmlDocument can be created using the file Path. Use XmlDocument.Load(string xmlPath) method;

2) If the web service is exposed outside, have a web method that’s take string as parameter.
a. When consuming the web method in the client app, read content of the xml file and send it to web method
b. Inside the web method, load the input string as XmlDocument using XmlDodument.LoadXml (string xml) methog and if loading fails it means the xml is not in the proper format

Once the xml document is loaded then its as good as parsing the xml.

I would suggest to use the option 2.

Njoy!!
.Mohan



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Search File on FTP Server..it's urgent
Previous : what is webservice
Return to Discussion Forum
Post New Message
Category: Webservices

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use