Sending XML Data to a Webserver with ASP.NET
From: Jon (jbigg21_at_yahoo.com)
Date: 08/04/04
- Next message: Laphan: "Re: VB app for MySQL backup files"
- Previous message: newsreader: "Re: POP3/SMTP NTLM authentication"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 4 Aug 2004 09:41:31 -0400
I'm writing an ASP.NET web app that needs to send data as an XML packet via
an HTTP POST method to a cgi program on another server. In VB6, I could
accomplish this in the following manner:
In the example code below, Inet1 is a Microsoft Internet Transfer Control
Private Sub SendToWebserver_Click()
Dim strURL As String
Dim strHead As String
Dim strFormData As String
strFormData = "<?xml version=""1.0"" encoding=""iso-8859-1""?>" &
XMLOut.Text
On Error GoTo SendMessageerr
Inet1.Execute "http://somwhere.com/cgi-bin/testxml.cgi", "POST",
strFormData, "Content-Type: application/xml" & vbCrLf & vbCrLf
While Inet1.StillExecuting
' wait until Inet finishes
DoEvents
Wend
Exit Sub
SendMessageerr:
MsgBox "Some Inet error "
End Sub
Since I'm writing an ASP.NET page to accomplish a similar function, I'd like
to find an equivalent procedure for doing this with either VB.NET or C#.NET.
I know I could use COM Interop and still use the old ActiveX Microsoft
Internet Transfer Control in my .NET project, but I'd really like to avoid
that extra baggage and stick to a pure .NET Framework implementation. Anyone
have any ideas on this? Thanks.
Jon
- Next message: Laphan: "Re: VB app for MySQL backup files"
- Previous message: newsreader: "Re: POP3/SMTP NTLM authentication"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|