Link to home
Start Free TrialLog in
Avatar of KishNovoice
KishNovoice

asked on

I need to retrieve information in xml from multiple websites using POST/GET methods as required

I need to retrieve information from multiple websites accordingly and save information into sql server. Based on carriers, we need to retrieve information from an xml/webservice/as parametrized string using POST/GET methods.

I am a beginner and would like to know what would be the best approach..

Overview:
I will be working with a third party application which has a "get least freight" button and once clicked we need to get the least possible freight from the list of carries.
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Wow, it sounds like you are going to have fun, since that is not really an easy process, and you will have a lot to learn.  As with anything like this, you gotta start somewhere.  This appears to be a mix of different technologies, and deciding on the "best" course of action is difficult without knowing what is involved.

I believe that you need to look into creating and using web service references, parsing XML, and using the System.Net.HttpWebRequest, since the System.Net.WebClient is just a wrapper for an HttpWebRequest, and is only a subset of the HttpWebRequest class.  

The details for your requirement are going to come in time.
Avatar of KishNovoice
KishNovoice

ASKER

Thanks for the suggestion TheLearnedOne. So do you suggest me following this path..

click triggers a event -> function gets the input like To and From zip codes -> queries each website url one after other -> based on the method, validates the response and gets the Rate and Days information and Save it to database.

My question would also be how would I convert the document to XMLformat so that I could read the nodes from HttpWebResponse..

Thanks a lot..

Kish


Kish,

It is hard to know what I am really going to suggest.  Like I said before, that depends on what type of web site/web service you are pulling information from.  If you can provide a little more detail, I might be able to suggest a "better" course of action.

Bob
Creating an XmlDocument is pretty easy, and can take different forms:

Simple example:

using System.Xml;

XmlDocument document = new XmlDocument();
document.Load(fileName);

foreach (XmlNode node in document.SelectNodes("//node")
{
    string name = node.Name;
    string innerText = node.InnerText;
}

The SelectNodes method, along with SelectSingleNode, takes a valid XPath expression, so you could get the full power of XPath to parse an XML document.
ASKER CERTIFIED SOLUTION
Avatar of Bob Learned
Bob Learned
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks LearnedOne you answered my question..