473,779 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5607

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

"Maximus" <me@maximus.net > wrote in message
news:OM******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP12.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******** ******@TK2MSFTN GP12.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.G etBytes(xml);
HttpWebRequest request = (HttpWebRequest ) WebRequest.Crea te(url);
request.Method = "POST";
request.Content Length = bytes.Length;
request.Content Type = "text/xml";
using (Stream requestStream = request.GetRequ estStream()) {
requestStream.W rite(bytes, 0, bytes.Length);
}

HttpWebResponse response = (HttpWebRespons e) request.GetResp onse();
if (response.Statu sCode != HttpStatusCode. OK) {
string message = String.Format(" POST failed. Received HTTP {0}",
response.Status Code);
throw new ApplicationExce ption(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.G etBytes(xml);
HttpWebRequest request = (HttpWebRequest ) WebRequest.Crea te(url);
request.Method = "POST";
request.Content Length = bytes.Length;
request.Content Type = "text/xml";
using (Stream requestStream = request.GetRequ estStream()) {
requestStream.W rite(bytes, 0, bytes.Length);
}

HttpWebResponse response = (HttpWebRespons e) request.GetResp onse();
if (response.Statu sCode != HttpStatusCode. OK) {
string message = String.Format(" POST failed. Received HTTP {0}",
response.Status Code);
throw new ApplicationExce ption(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*********@gm x.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.G etBytes(xml);
HttpWebRequest request = (HttpWebRequest ) WebRequest.Crea te(url);
request.Method = "POST";
request.Content Length = bytes.Length;
request.Content Type = "text/xml";
using (Stream requestStream = request.GetRequ estStream()) {
requestStream.W rite(bytes, 0, bytes.Length);
}

HttpWebResponse response = (HttpWebRespons e) request.GetResp onse();
if (response.Statu sCode != HttpStatusCode. OK) {
string message = String.Format(" POST failed. Received HTTP {0}",
response.Status Code);
throw new ApplicationExce ption(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*********@gm x.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.G etBytes(xml);
HttpWebRequest request = (HttpWebRequest ) WebRequest.Crea te(url);
request.Method = "POST";
request.Content Length = bytes.Length;
request.Content Type = "text/xml";
using (Stream requestStream = request.GetRequ estStream()) {
requestStream.W rite(bytes, 0, bytes.Length);
}

HttpWebResponse response = (HttpWebRespons e) request.GetResp onse();
if (response.Statu sCode != HttpStatusCode. OK) {
string message = String.Format(" POST failed. Received HTTP {0}",
response.Status Code);
throw new ApplicationExce ption(message);
}
}

Cheers,


Nov 18 '05 #9

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

Similar topics

2
2769
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 = fsockopen("tcp://$address", (int) $port, $errno, $errstr, 1); $extra = "extra=blah&this=test";
3
6763
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 simpler, than Hotmail or Webmail. I've been told by our system administrator that I can't access our SMTP and POP3 servers directly. If I could use SMTP or POP3, this problem would be trivial, I think. But instead, I'm forced to rely on the HTTP...
20
2515
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 the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security ( obviusly ) reazons.. so..i think this probable solutions to unlock the computer and run the...
4
297
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
3522
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 administrator told me to write the emails to the “pickup directory” instead. I know that JMail can do this in ASP, but how do you do this in asp.net? -- --------------------
5
3029
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 need to send data from my server via the post method to the payment server. The payment server does not run asp.net. I dont know what they run. The payment server then returns to my server with the
3
7728
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 value for the UserName token. Is it possilbe at all to do this from VBScript (or jscript?)? I know I will be limited with what I can do with the SOAP message. Eg/ can't sign/encrypt it etc. Thanks,
0
1532
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 send a request to remote application. --------------------------------------------------------------------------------------------------------------- string lcUrl = "http://localhost/check/WebSite3/Default.aspx"; HttpWebRequest loHttp...
2
3028
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 server configuration that I need to set. I don't think it's a port problem b/c I'm able to send a page via WCTP using the same port using a stand-alone app. Anyhow, here's the code I'm using: sub send_wctp_old{ #my $url =...
10
5102
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> <zone>BOXING</zone> <status>Running</status> <job>1000139233</job>
0
9474
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10306
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10139
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9931
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5504
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.