Send Xml file to asp page

  • Thread starter Thread starter Sasha
  • Start date Start date
S

Sasha

Hi,
I need to send xml file to an asp page.. I have no idea how to do it... I
only know that I need to do HTTPRequest Post... Could someone help? Maybe
there are some examples on the Web?

Thank you,
Sash
 
You have to use XMLHTTP Object e.g.

Dim obj
Dim xmlstring

Set obj = CreateObject("Microsoft.XMLHTTP")
obj.Open("POST", "http://yoururl.asp", False)

dim xmlstring = "<Test id="1">Suresh</Test>"
obj.send(xmlstring)

I hope this one helps...

-Suresh
 
Hi Sasha,

There are many ways of doing this.
Normally, you can use the 3 standard ways of sending information to server:
1. Post information from a form.
2. Post information from a form in a hidden frame.
3. Use the XMLHTTP control to send and receive XML information using HTTP
requests.

For more information, please refer to the links below:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm/
xml_concepts2_7kfm.asp
http://www.codetoad.com/xml/xml-dom/xmlhttp.asp
http://msdn.microsoft.com/msdnmag/issues/0400/cutting/

Hope this helps,

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Sasha" <[email protected]>
| Subject: Send Xml file to asp page
| Date: Thu, 16 Oct 2003 11:54:06 -0800
| Lines: 9
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups:
microsoft.public.dotnet.general,microsoft.public.dotnet.languages.csharp,mic
rosoft.public.dotnet.xml
| NNTP-Posting-Host: filenet-gw.filenet.com 198.3.8.1
| Path:
cpmsftngxa06.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
..phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.languages.csharp:191902
microsoft.public.dotnet.xml:16673 microsoft.public.dotnet.general:112163
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Hi,
| I need to send xml file to an asp page.. I have no idea how to do it... I
| only know that I need to do HTTPRequest Post... Could someone help? Maybe
| there are some examples on the Web?
|
| Thank you,
| Sash
|
|
|
 
Sasha said:
Hi,
I need to send xml file to an asp page.. I have no idea how to do it... I
only know that I need to do HTTPRequest Post... Could someone help? Maybe
there are some examples on the Web?

Thank you,
Sash

Yes, but I forgot to mention that I need to do this in a WinForms
Application....

Sorry.
 
Then use System.Net.WebRequest.

XmlDocument yourxml;

WebRequest req = WebRequest.Create(url);
req.Method = "POST";
req.ContentType = "text/xml";
XmlTextWriter xw = new XmlTextWriter(req.GetRequestStream(), Encoding.UTF8);
yourxml.WriteTo(xw);
xw.Close();

WebResponse rep = req.GetResponse();
....
etc, etc.
 
Back
Top