Ask a Question related to ASP.NET Web Services, Design and Development.
-
Vi #1
Submitting XML to an URL
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.
Vi Guest
-
Submitting Forms
I followed the directions for creating a web form in publisher. When I click submit it says The page cannot be displayed and the url at the top... -
Submitting whole PDF to server
Hello all, I am working on a small project and cannot seem to locate the information I require... I have a PDF form that has been created in Adobe... -
Page is not submitting
Loop Relevant code snippet? Ray at work "DK" <dmitriy10@hotmail.com> wrote in message news:065601c36112$d585fee0$a101280a@phx.gbl... -
Submitting input
I'm in a bind, I've searched the website, and all attemps have come up short of what I need. I have a form that a friend created, and it's... -
Submitting photos
My photos are on my pbase site. How can I submit Challenge candidates from there? Thank you. EDIT: A lot of the photos are of my toddler/baby... -
Tomas Restrepo \(MVP\) #2
Re: Submitting XML to an URL
Vi,
a) I'm assuming you're using GetResponse() at the end, right?> 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?
b) If your content encoding is application/x-www-form-urlencoded, then the
way you're sending it is probably not correct. the way you're writing it is
usually used for text/xml instead.
--
Tomas Restrepo
[email]tomasr@mvps.org[/email]
[url]http://www.winterdom.com/[/url]
Tomas Restrepo \(MVP\) Guest



Reply With Quote

