473,385 Members | 1,863 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.

Submitting XML to an URL

Vi
Hello,
I'm not sure this is the right place for this question, but hopefully
somebody can help.
I'm trying to build an in-memory XML file and submit it to an URL. Here's a
sample code:

//================================================== ==
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create("http://localhost/localurl.aspx");
request.ContentType="application/x-www-form-urlencoded";
request.Method = "POST";

Stream myStream = request.GetRequestStream();
XmlTextWriter writer = new XmlTextWriter(myStream, null);

writer.WriteStartElement("orders");
writer.WriteAttributeString("value","205");
writer.WriteEndElement();

writer.Flush();
myStream.Close();
//================================================== ==

For some reason, the URL I'm submitting to does not receive the XML.
Anybody has any ideas why?

Thnks in advance.
Nov 23 '05 #1
2 1583
Maybe try setting the ContentLength?

Vi wrote:
Hello,
I'm not sure this is the right place for this question, but hopefully
somebody can help.
I'm trying to build an in-memory XML file and submit it to an URL. Here's a
sample code:

//================================================== ==
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create("http://localhost/localurl.aspx");
request.ContentType="application/x-www-form-urlencoded";
request.Method = "POST";

Stream myStream = request.GetRequestStream();
XmlTextWriter writer = new XmlTextWriter(myStream, null);

writer.WriteStartElement("orders");
writer.WriteAttributeString("value","205");
writer.WriteEndElement();

writer.Flush();
myStream.Close();
//================================================== ==

For some reason, the URL I'm submitting to does not receive the XML.
Anybody has any ideas why?

Thnks in advance.

Nov 23 '05 #2
Maybe try setting the ContentLength?

Vi wrote:
Hello,
I'm not sure this is the right place for this question, but hopefully
somebody can help.
I'm trying to build an in-memory XML file and submit it to an URL. Here's a
sample code:

//================================================== ==
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create("http://localhost/localurl.aspx");
request.ContentType="application/x-www-form-urlencoded";
request.Method = "POST";

Stream myStream = request.GetRequestStream();
XmlTextWriter writer = new XmlTextWriter(myStream, null);

writer.WriteStartElement("orders");
writer.WriteAttributeString("value","205");
writer.WriteEndElement();

writer.Flush();
myStream.Close();
//================================================== ==

For some reason, the URL I'm submitting to does not receive the XML.
Anybody has any ideas why?

Thnks in advance.

Nov 23 '05 #3

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

Similar topics

4
by: Mats | last post by:
Hi Maybee a little bit of topic, but is it possible to stay on the submitting page once you've clicked submit. This is to get processing done on page B when you submit on page A, and the page...
2
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
5
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
1
by: Hello | last post by:
Scenario: A page creates a pop up and that pop up submits a form. Is there a way to detect whether the submitting was successful or not, so true/false could be passed to the parent window?
4
by: Super Steve | last post by:
I'm trying to write a little script that disables the submit button on a form, changes the text of the button, and then submits the form. Can anyone tell me why this works ok: <input...
85
by: Russ | last post by:
Every Python programmer gets this message occasionally: IndexError: list index out of range The message tells you where the error occurred, but it doesn't tell you what the range and the...
3
by: kgbalaji1980 | last post by:
Hi all, i want the jscript coding for more than one form in one page and submitting the same . ie one parent form and one append button when we click that button one child form will display...
18
by: NavinM | last post by:
I have a couple of forms that are misbehaving in FireFox, but work fine in IE. when i do submit( with submit button) a javascript function validates all of the fields entered, and stops the...
1
by: SachinBhargava | last post by:
Hi, I am faceing the problem while submitting the same page in ASP. When i am submitting the page, I am showing the java script alert message before closing the pop up window. My problem is, when...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.