Sending XML Data to a Webserver with ASP.NET

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Jon (jbigg21_at_yahoo.com)
Date: 08/04/04


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



Relevant Pages

  • RE: BinaryWriter Write adds Carrots
    ... Travis ... > string." ... >> I am writing a program that write out and array that I have stored. ... >> End Sub ...
    (microsoft.public.dotnet.languages.vb)
  • Re: ASCII to PDU convertion and back
    ... I'm writing a string all the time. ... End Sub ... It works really fine with just normal text, but once I begin using accents ...
    (microsoft.public.dotnet.framework)
  • Re: ASCII to PDU convertion and back
    ... I'm writing a string all the time. ... End Sub ... It works really fine with just normal text, but once I begin using accents ...
    (microsoft.public.dotnet.general)
  • Re: ASCII to PDU convertion and back
    ... I'm writing a string all the time. ... End Sub ... It works really fine with just normal text, but once I begin using accents ...
    (microsoft.public.dotnet.languages.vb)
  • Re: RFC: utils.pm
    ... but I'm tired to writing this god damn line each time I want to ... sub as_boolean { ... "Scientists are complaining that the new "Dinosaur" movie shows dinosaurs with lemurs, who didn't evolve for another million years. ...
    (comp.lang.perl.misc)