473,385 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Posting data to Http and receiving data in XML

I need to create a web client code in C# that retrieves data from a web site in sync method.
I have the following code in VB script that works today but need to be converted to c#
Set xmlHttp = WScript.CreateObject("Microsoft.XMLHTTP"
Set xmlDom = WScript.CreateObject("Microsoft.XMLDOM"
xmlDom.LoadXml("<PDETAILS FirstName=""John"" LastName=""James"" "" ZipCode=""78012"" />"
xmlHttp.Open "POST", "http://host/Purschase.aspx"; 0
xmlHttp.Send(xmlDom
xmlDom.LoadXml(XmlHttp.responseXml.Xml

Response from the site is in Xml format
A pointer & sample to C# classes will be appreciated

Nov 15 '05 #1
1 1522
Mike,

I believe that this was answered already in a previous post. Basically,
you will want to use the HttpWebRequest and HttpWebResponse classes to send
a request and get the response. Once you have that, you can use the
XmlDocument class in the System.Xml namespace to parse the XML returned and
use it.

If you really want, you can use COM interop to do this, and use the same
method calls (in C# of course). However, I think that it would be better to
use the managed classes.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"MikeO" <mi****@msn.com> wrote in message
news:AE**********************************@microsof t.com...
I need to create a web client code in C# that retrieves data from a web site in sync method. I have the following code in VB script that works today but need to be converted to c#: Set xmlHttp = WScript.CreateObject("Microsoft.XMLHTTP")
Set xmlDom = WScript.CreateObject("Microsoft.XMLDOM")
xmlDom.LoadXml("<PDETAILS FirstName=""John"" LastName=""James"" "" ZipCode=""78012"" />") xmlHttp.Open "POST", "http://host/Purschase.aspx"; 0
xmlHttp.Send(xmlDom)
xmlDom.LoadXml(XmlHttp.responseXml.Xml)

Response from the site is in Xml format.
A pointer & sample to C# classes will be appreciated.

Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Arnold Shore | last post by:
A really weird thing (to me, anyway) I've encountered is in a UTF-8 test script. Here, the input - a single two-byte Cyrillic character (as reported by Javascript in the originating form) is...
10
by: DaveFash | last post by:
Posting variables from an HTML FORM, via the Request.Form function on the receiving ASP page is great. But how can you POST a Form variable to an ASP page -- without a human pushing a Submit...
4
by: Stacey Levine | last post by:
Please tell me if this makes sense. I have written an ASPX page to handle and process POSTed XML data to it. I am expected the data to be in the Request.Form object. This works perfectly fine...
3
by: Hari | last post by:
Hi all, I have written a web service that receives large volume of data from consumers and process this data. When a consumer is sending large data (say xml files of 50KB) at frequent...
1
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
0
by: kwilliams1130 | last post by:
I am having a problem with data that is being posted to another server. The problem is I collect the data from our database through an .cfm file (and all data is correct), which then the data is...
0
by: pauland80 | last post by:
<snip> <snip> Late thanks for your both answers! (Please excuse me for that) The problem was a bug in the device firmware. But before finding this, I dugg lightly in the pyserial source...
0
by: george585 | last post by:
Hello! I am new to network programming, and understand just basics. Using some sample code, and having read documentation, I managed to create a simple app in C# and VB.NET. The application is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.