473,378 Members | 1,146 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,378 software developers and data experts.

sending xml as http post

Hi everyone,

I was wondering if anybody could help me with sending xml as part of an
http post. Any help will be greatly appreciated.
Thanks.

Nov 18 '05 #1
8 5573

what are your issues with it? what problems are you having?

"Maximus" <me@maximus.net> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi everyone,

I was wondering if anybody could help me with sending xml as part of an
http post. Any help will be greatly appreciated.
Thanks.

Nov 18 '05 #2

what are your issues with it? what problems are you having?

"Maximus" <me@maximus.net> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi everyone,

I was wondering if anybody could help me with sending xml as part of an
http post. Any help will be greatly appreciated.
Thanks.

Nov 18 '05 #3
you can user WebRequest class, and set xml data as the post data

"Maximus" <me@maximus.net> ????
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi everyone,

I was wondering if anybody could help me with sending xml as part of an
http post. Any help will be greatly appreciated.
Thanks.

Nov 18 '05 #4
you can user WebRequest class, and set xml data as the post data

"Maximus" <me@maximus.net> ????
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi everyone,

I was wondering if anybody could help me with sending xml as part of an
http post. Any help will be greatly appreciated.
Thanks.

Nov 18 '05 #5
Maximus wrote:
Hi everyone,

I was wondering if anybody could help me with sending xml as part of
an http post. Any help will be greatly appreciated.


This sample method shows how to post an XML string "xml" to a web
application located at "url".

public void PostXml(string url, string xml) {
byte[] bytes = Encoding.UTF8.GetBytes(xml);
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
request.Method = "POST";
request.ContentLength = bytes.Length;
request.ContentType = "text/xml";
using (Stream requestStream = request.GetRequestStream()) {
requestStream.Write(bytes, 0, bytes.Length);
}

HttpWebResponse response = (HttpWebResponse) request.GetResponse();
if (response.StatusCode != HttpStatusCode.OK) {
string message = String.Format("POST failed. Received HTTP {0}",
response.StatusCode);
throw new ApplicationException(message);
}
}

Cheers,

--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #6
Maximus wrote:
Hi everyone,

I was wondering if anybody could help me with sending xml as part of
an http post. Any help will be greatly appreciated.


This sample method shows how to post an XML string "xml" to a web
application located at "url".

public void PostXml(string url, string xml) {
byte[] bytes = Encoding.UTF8.GetBytes(xml);
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
request.Method = "POST";
request.ContentLength = bytes.Length;
request.ContentType = "text/xml";
using (Stream requestStream = request.GetRequestStream()) {
requestStream.Write(bytes, 0, bytes.Length);
}

HttpWebResponse response = (HttpWebResponse) request.GetResponse();
if (response.StatusCode != HttpStatusCode.OK) {
string message = String.Format("POST failed. Received HTTP {0}",
response.StatusCode);
throw new ApplicationException(message);
}
}

Cheers,

--
Joerg Jooss
jo*********@gmx.net

Nov 18 '05 #7
les
I'm trying to do the same thing in vb.net.

Is there an equivalent vb.net example?

Thanks
Leslie

On Sun, 11 Apr 2004 11:27:55 +0200, "Joerg Jooss"
<jo*********@gmx.net> wrote:
Maximus wrote:
Hi everyone,

I was wondering if anybody could help me with sending xml as part of
an http post. Any help will be greatly appreciated.


This sample method shows how to post an XML string "xml" to a web
application located at "url".

public void PostXml(string url, string xml) {
byte[] bytes = Encoding.UTF8.GetBytes(xml);
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
request.Method = "POST";
request.ContentLength = bytes.Length;
request.ContentType = "text/xml";
using (Stream requestStream = request.GetRequestStream()) {
requestStream.Write(bytes, 0, bytes.Length);
}

HttpWebResponse response = (HttpWebResponse) request.GetResponse();
if (response.StatusCode != HttpStatusCode.OK) {
string message = String.Format("POST failed. Received HTTP {0}",
response.StatusCode);
throw new ApplicationException(message);
}
}

Cheers,


Nov 18 '05 #8
les
I'm trying to do the same thing in vb.net.

Is there an equivalent vb.net example?

Thanks
Leslie

On Sun, 11 Apr 2004 11:27:55 +0200, "Joerg Jooss"
<jo*********@gmx.net> wrote:
Maximus wrote:
Hi everyone,

I was wondering if anybody could help me with sending xml as part of
an http post. Any help will be greatly appreciated.


This sample method shows how to post an XML string "xml" to a web
application located at "url".

public void PostXml(string url, string xml) {
byte[] bytes = Encoding.UTF8.GetBytes(xml);
HttpWebRequest request = (HttpWebRequest) WebRequest.Create(url);
request.Method = "POST";
request.ContentLength = bytes.Length;
request.ContentType = "text/xml";
using (Stream requestStream = request.GetRequestStream()) {
requestStream.Write(bytes, 0, bytes.Length);
}

HttpWebResponse response = (HttpWebResponse) request.GetResponse();
if (response.StatusCode != HttpStatusCode.OK) {
string message = String.Format("POST failed. Received HTTP {0}",
response.StatusCode);
throw new ApplicationException(message);
}
}

Cheers,


Nov 18 '05 #9

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

Similar topics

2
by: yawnmoth | last post by:
i'm trying to send an http post request and see if the server got it correctly. i'm sending the http post request with this script: <? $address = 'domain.tld'; $port = 80; $proxy =...
3
by: Jared | last post by:
Hello people, I've had major difficulties finding the right Java technology that can be used to make an e-mail applet program. I'm trying to build an applet that would be similar, but much...
20
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to...
4
by: Maximus | last post by:
Hi everyone, I was wondering if anybody could help me with sending xml as part of an http post. Any help will be greatly appreciated. Thanks.
7
by: Lau | last post by:
I need to send 1000 emails from an asp.net website. Normally I would use System.Web.Mail.MailMessage() to send thru an SMTP server. But the large amount of emails results in a timeout. My server...
5
by: Vishal | last post by:
Hello, I already asked this question in the ASP.NET forums, but no help came. So I am hoping that somebody can help me out. This is really very URGENT me. For my e-commerce application, I...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
0
by: sanjaygupta11 | last post by:
I am using httpwebrequest and httpwebresponse objects for sending data to remote appication by post and receiving the response from there. I am using this code in my windows application which will...
2
by: jabdulius | last post by:
Hi all, I'm trying to send a page using Perl via the WCTP protocol. For some reason, I cannot connect to the host "wctp.att.net/WCTP" (or any host for that matter). I figure it must be some...
10
by: Markgoldin | last post by:
I am sending an XML data from not dontnet process to a .Net via socket listener. Here is a data sample: <VFPData> <serverdata> <coderun>updateFloor</coderun> <area>MD2</area>...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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.