httputility.urlencode(doc.outerxml) as a http xml post

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CindyH

    httputility.urlencode(doc.outerxml) as a http xml post

    Hi
    I'm not sure whether I should send this as a new message or use the one I've
    been using but...
    I'm using vb.net 2.0 -
    My problem is I need to send
    something like this: 'dim encodedstring = "test=" +
    httputility.url encode(doc.oute rxml)' as a http xml post and then need to
    receive it on other end for a test.
    It needs to be sent as a stream.
    I need some sample code on how to post it and then receive the request on
    other end so I get the information from the xml.
    Been playing around with all kinds of code and not getting anywhere.
    Thanks,
    Cindy


  • Michel Posseth  [MCP]

    #2
    Re: httputility.url encode(doc.oute rxml) as a http xml post


    Maybe you could explain the task a bit more ?

    You want to send XML data with a post command , this you can not do without
    encoding the XML data
    this task is simple

    But then you brought up streaming and i got confused , on HTTP everything is
    text this doens`t mean you cannot send binary`s cause you can with encoding
    and decoding ( BASE 64 or ROT 13 or even a custom protocol as long as the
    outcome is a text format that doesn`t interfere with HTML tags )


    hth

    Michel

    "CindyH" <chenschel@new. rr.comschreef in bericht
    news:OhmMCsDtIH A.2064@TK2MSFTN GP05.phx.gbl...
    Hi
    I'm not sure whether I should send this as a new message or use the one
    I've been using but...
    I'm using vb.net 2.0 -
    My problem is I need to send
    something like this: 'dim encodedstring = "test=" +
    httputility.url encode(doc.oute rxml)' as a http xml post and then need to
    receive it on other end for a test.
    It needs to be sent as a stream.
    I need some sample code on how to post it and then receive the request on
    other end so I get the information from the xml.
    Been playing around with all kinds of code and not getting anywhere.
    Thanks,
    Cindy
    >

    Comment

    • CindyH

      #3
      Re: httputility.url encode(doc.oute rxml) as a http xml post

      well the deal is that I need the post sent in key word - like
      test=doc.outerx ml

      "Michel Posseth [MCP]" <MSDN@posseth.c omwrote in message
      news:uAkH0NEtIH A.1772@TK2MSFTN GP03.phx.gbl...
      >
      Maybe you could explain the task a bit more ?
      >
      You want to send XML data with a post command , this you can not do
      without encoding the XML data
      this task is simple
      >
      But then you brought up streaming and i got confused , on HTTP everything
      is text this doens`t mean you cannot send binary`s cause you can with
      encoding and decoding ( BASE 64 or ROT 13 or even a custom protocol as
      long as the outcome is a text format that doesn`t interfere with HTML
      gs )
      >
      >
      hth
      >
      Michel
      >
      "CindyH" <chenschel@new. rr.comschreef in bericht
      news:OhmMCsDtIH A.2064@TK2MSFTN GP05.phx.gbl...
      >Hi
      >I'm not sure whether I should send this as a new message or use the one
      >I've been using but...
      >I'm using vb.net 2.0 -
      >My problem is I need to send
      >something like this: 'dim encodedstring = "test=" +
      >httputility.ur lencode(doc.out erxml)' as a http xml post and then need to
      >receive it on other end for a test.
      >It needs to be sent as a stream.
      >I need some sample code on how to post it and then receive the request on
      >other end so I get the information from the xml.
      >Been playing around with all kinds of code and not getting anywhere.
      >Thanks,
      >Cindy
      >>
      >
      >

      Comment

      • =?Utf-8?B?TWljaGVsIFBvc3NldGggW01DUF0=?=

        #4
        Re: httputility.url encode(doc.oute rxml) as a http xml post

        Okay

        well i hope i understand this right ,,, but here is my implementation

        Client code ( VB executable )

        Imports System.Net
        Imports System.Web
        Imports System.Xml
        Imports System
        Public Class Form1
        Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
        System.EventArg s) Handles Button1.Click
        Dim url As String = "http://localhost/Default.aspx"
        Dim objDoc As New System.Xml.XmlD ocument
        objDoc.Load("c: \sample.xml")
        MsgBox(SendAndR eceive(url, objDoc.OuterXml ))
        End Sub

        Public Function SendAndReceive( ByVal Url As String, ByVal vxml As
        String) As String
        Dim ResultHTML As String = String.Empty
        Try
        Dim myrequest As System.Net.WebR equest =
        System.Net.WebR equest.Create(U rl)
        myrequest.Metho d = "POST"
        myrequest.Conte ntType = "text/xml"

        Dim byteArray As Byte() = System.Text.Enc oding.UTF8.GetB ytes(vxml)
        myrequest.Conte ntLength = byteArray.Lengt h
        Dim dataStream As System.IO.Strea m = myrequest.GetRe questStream()
        dataStream.Writ e(byteArray, 0, byteArray.Lengt h)
        dataStream.Clos e()

        Dim myresponse As System.Net.WebR esponse = myrequest.GetRe sponse()
        Dim Reader As New IO.StreamReader (myresponse.Get ResponseStream)
        ResultHTML = Reader.ReadToEn d()
        Catch ex As Exception

        End Try
        Return ResultHTML
        End Function



        End Class


        Server code ( default.aspx )

        Partial Class _Default
        Inherits System.Web.UI.P age

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As
        System.EventArg s) Handles Me.Load
        Response.Clear( )
        Dim Reader As New IO.StreamReader (Request.InputS tream)
        Dim result As String = Reader.ReadToEn d()
        Response.Write( result)
        End Sub

        End Class



        i hope above makes sence :-)

        ofcourse in my example i just send the xml file and display the response of
        the default.aspx just to see if the xml had arrived


        but i guess this is what you wanted ??

        HTH

        Michel Posseth [MCP]








        "CindyH" wrote:
        well the deal is that I need the post sent in key word - like
        test=doc.outerx ml
        >
        "Michel Posseth [MCP]" <MSDN@posseth.c omwrote in message
        news:uAkH0NEtIH A.1772@TK2MSFTN GP03.phx.gbl...

        Maybe you could explain the task a bit more ?

        You want to send XML data with a post command , this you can not do
        without encoding the XML data
        this task is simple

        But then you brought up streaming and i got confused , on HTTP everything
        is text this doens`t mean you cannot send binary`s cause you can with
        encoding and decoding ( BASE 64 or ROT 13 or even a custom protocol as
        long as the outcome is a text format that doesn`t interfere with HTML
        gs )


        hth

        Michel

        "CindyH" <chenschel@new. rr.comschreef in bericht
        news:OhmMCsDtIH A.2064@TK2MSFTN GP05.phx.gbl...
        Hi
        I'm not sure whether I should send this as a new message or use the one
        I've been using but...
        I'm using vb.net 2.0 -
        My problem is I need to send
        something like this: 'dim encodedstring = "test=" +
        httputility.url encode(doc.oute rxml)' as a http xml post and then need to
        receive it on other end for a test.
        It needs to be sent as a stream.
        I need some sample code on how to post it and then receive the request on
        other end so I get the information from the xml.
        Been playing around with all kinds of code and not getting anywhere.
        Thanks,
        Cindy
        >
        >
        >
        >

        Comment

        • Cindy H

          #5
          Re: httputility.url encode(doc.oute rxml) as a http xml post

          Yea, your code is almost exactly like how I orginally had mine when I was
          first asked to do this, but then the client added this "key name" deal to
          the project and said he wanted it sent as a single key name. I didn't know
          what he was talking about then someone mentioned that he probably was
          refering to this:
          Dim encodedstring = "test=" + httputility.url encode(doc.oute rxml)'.
          I asked him if this was correct and he said yes, so trying to come up with
          the code to send and read the request on other end..


          "Michel Posseth [MCP]" <MichelPossethM CP@discussions. microsoft.comwr ote in
          message news:2E20D079-338A-4C2B-8555-0075A8F23DB5@mi crosoft.com...
          Okay
          >
          well i hope i understand this right ,,, but here is my implementation
          >
          Client code ( VB executable )
          >
          Imports System.Net
          Imports System.Web
          Imports System.Xml
          Imports System
          Public Class Form1
          Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
          System.EventArg s) Handles Button1.Click
          Dim url As String = "http://localhost/Default.aspx"
          Dim objDoc As New System.Xml.XmlD ocument
          objDoc.Load("c: \sample.xml")
          MsgBox(SendAndR eceive(url, objDoc.OuterXml ))
          End Sub
          >
          Public Function SendAndReceive( ByVal Url As String, ByVal vxml As
          String) As String
          Dim ResultHTML As String = String.Empty
          Try
          Dim myrequest As System.Net.WebR equest =
          System.Net.WebR equest.Create(U rl)
          myrequest.Metho d = "POST"
          myrequest.Conte ntType = "text/xml"
          >
          Dim byteArray As Byte() =
          System.Text.Enc oding.UTF8.GetB ytes(vxml)
          myrequest.Conte ntLength = byteArray.Lengt h
          Dim dataStream As System.IO.Strea m =
          myrequest.GetRe questStream()
          dataStream.Writ e(byteArray, 0, byteArray.Lengt h)
          dataStream.Clos e()
          >
          Dim myresponse As System.Net.WebR esponse =
          myrequest.GetRe sponse()
          Dim Reader As New IO.StreamReader (myresponse.Get ResponseStream)
          ResultHTML = Reader.ReadToEn d()
          Catch ex As Exception
          >
          End Try
          Return ResultHTML
          End Function
          >
          >
          >
          End Class
          >
          >
          Server code ( default.aspx )
          >
          Partial Class _Default
          Inherits System.Web.UI.P age
          >
          Protected Sub Page_Load(ByVal sender As Object, ByVal e As
          System.EventArg s) Handles Me.Load
          Response.Clear( )
          Dim Reader As New IO.StreamReader (Request.InputS tream)
          Dim result As String = Reader.ReadToEn d()
          Response.Write( result)
          End Sub
          >
          End Class
          >
          >
          >
          i hope above makes sence :-)
          >
          ofcourse in my example i just send the xml file and display the response
          of
          the default.aspx just to see if the xml had arrived
          >
          >
          but i guess this is what you wanted ??
          >
          HTH
          >
          Michel Posseth [MCP]
          >
          >
          >
          >
          >
          >
          >
          >
          "CindyH" wrote:
          >
          >well the deal is that I need the post sent in key word - like
          >test=doc.outer xml
          >>
          >"Michel Posseth [MCP]" <MSDN@posseth.c omwrote in message
          >news:uAkH0NEtI HA.1772@TK2MSFT NGP03.phx.gbl.. .
          >
          Maybe you could explain the task a bit more ?
          >
          You want to send XML data with a post command , this you can not do
          without encoding the XML data
          this task is simple
          >
          But then you brought up streaming and i got confused , on HTTP
          everything
          is text this doens`t mean you cannot send binary`s cause you can with
          encoding and decoding ( BASE 64 or ROT 13 or even a custom protocol
          as
          long as the outcome is a text format that doesn`t interfere with HTML
          gs )
          >
          >
          hth
          >
          Michel
          >
          "CindyH" <chenschel@new. rr.comschreef in bericht
          news:OhmMCsDtIH A.2064@TK2MSFTN GP05.phx.gbl...
          >Hi
          >I'm not sure whether I should send this as a new message or use the
          >one
          >I've been using but...
          >I'm using vb.net 2.0 -
          >My problem is I need to send
          >something like this: 'dim encodedstring = "test=" +
          >httputility.ur lencode(doc.out erxml)' as a http xml post and then need
          >to
          >receive it on other end for a test.
          >It needs to be sent as a stream.
          >I need some sample code on how to post it and then receive the request
          >on
          >other end so I get the information from the xml.
          >Been playing around with all kinds of code and not getting anywhere.
          >Thanks,
          >Cindy
          >>
          >
          >
          >>
          >>
          >>

          Comment

          • Michel Posseth

            #6
            Re: httputility.url encode(doc.oute rxml) as a http xml post

            Cindy H schreef:
            Yea, your code is almost exactly like how I orginally had mine when I was
            first asked to do this, but then the client added this "key name" deal to
            the project and said he wanted it sent as a single key name. I didn't know
            what he was talking about then someone mentioned that he probably was
            refering to this:
            Dim encodedstring = "test=" + httputility.url encode(doc.oute rxml)'.
            I asked him if this was correct and he said yes, so trying to come up with
            the code to send and read the request on other end..
            >
            >
            "Michel Posseth [MCP]" <MichelPossethM CP@discussions. microsoft.comwr ote in
            message news:2E20D079-338A-4C2B-8555-0075A8F23DB5@mi crosoft.com...
            >Okay
            >>
            >well i hope i understand this right ,,, but here is my implementation
            >>
            >Client code ( VB executable )
            >>
            >Imports System.Net
            >Imports System.Web
            >Imports System.Xml
            >Imports System
            >Public Class Form1
            > Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
            >System.EventAr gs) Handles Button1.Click
            > Dim url As String = "http://localhost/Default.aspx"
            > Dim objDoc As New System.Xml.XmlD ocument
            > objDoc.Load("c: \sample.xml")
            > MsgBox(SendAndR eceive(url, objDoc.OuterXml ))
            > End Sub
            >>
            > Public Function SendAndReceive( ByVal Url As String, ByVal vxml As
            >String) As String
            > Dim ResultHTML As String = String.Empty
            > Try
            > Dim myrequest As System.Net.WebR equest =
            >System.Net.Web Request.Create( Url)
            > myrequest.Metho d = "POST"
            > myrequest.Conte ntType = "text/xml"
            >>
            > Dim byteArray As Byte() =
            >System.Text.En coding.UTF8.Get Bytes(vxml)
            > myrequest.Conte ntLength = byteArray.Lengt h
            > Dim dataStream As System.IO.Strea m =
            >myrequest.GetR equestStream()
            > dataStream.Writ e(byteArray, 0, byteArray.Lengt h)
            > dataStream.Clos e()
            >>
            > Dim myresponse As System.Net.WebR esponse =
            >myrequest.GetR esponse()
            > Dim Reader As New IO.StreamReader (myresponse.Get ResponseStream)
            > ResultHTML = Reader.ReadToEn d()
            > Catch ex As Exception
            >>
            > End Try
            > Return ResultHTML
            > End Function
            >>
            >>
            >>
            >End Class
            >>
            >>
            >Server code ( default.aspx )
            >>
            >Partial Class _Default
            > Inherits System.Web.UI.P age
            >>
            > Protected Sub Page_Load(ByVal sender As Object, ByVal e As
            >System.EventAr gs) Handles Me.Load
            > Response.Clear( )
            > Dim Reader As New IO.StreamReader (Request.InputS tream)
            > Dim result As String = Reader.ReadToEn d()
            > Response.Write( result)
            > End Sub
            >>
            >End Class
            >>
            >>
            >>
            >i hope above makes sence :-)
            >>
            >ofcourse in my example i just send the xml file and display the response
            >of
            >the default.aspx just to see if the xml had arrived
            >>
            >>
            >but i guess this is what you wanted ??
            >>
            >HTH
            >>
            >Michel Posseth [MCP]
            >>
            >>
            >>
            >>
            >>
            >>
            >>
            >>
            >"CindyH" wrote:
            >>
            >>well the deal is that I need the post sent in key word - like
            >>test=doc.oute rxml
            >>>
            >>"Michel Posseth [MCP]" <MSDN@posseth.c omwrote in message
            >>news:uAkH0NEt IHA.1772@TK2MSF TNGP03.phx.gbl. ..
            >>>Maybe you could explain the task a bit more ?
            >>>>
            >>>You want to send XML data with a post command , this you can not do
            >>>without encoding the XML data
            >>>this task is simple
            >>>>
            >>>But then you brought up streaming and i got confused , on HTTP
            >>>everything
            >>>is text this doens`t mean you cannot send binary`s cause you can with
            >>>encoding and decoding ( BASE 64 or ROT 13 or even a custom protocol
            >>>as
            >>>long as the outcome is a text format that doesn`t interfere with HTML
            >>>gs )
            >>>>
            >>>>
            >>>hth
            >>>>
            >>>Michel
            >>>>
            >>>"CindyH" <chenschel@new. rr.comschreef in bericht
            >>>news:OhmMCsD tIHA.2064@TK2MS FTNGP05.phx.gbl ...
            >>>>Hi
            >>>>I'm not sure whether I should send this as a new message or use the
            >>>>one
            >>>>I've been using but...
            >>>>I'm using vb.net 2.0 -
            >>>>My problem is I need to send
            >>>>something like this: 'dim encodedstring = "test=" +
            >>>>httputility .urlencode(doc. outerxml)' as a http xml post and then need
            >>>>to
            >>>>receive it on other end for a test.
            >>>>It needs to be sent as a stream.
            >>>>I need some sample code on how to post it and then receive the request
            >>>>on
            >>>>other end so I get the information from the xml.
            >>>>Been playing around with all kinds of code and not getting anywhere.
            >>>>Thanks,
            >>>>Cindy
            >>>>>
            >>>>
            >>>
            >>>
            >
            >
            okay ....

            the code i showed is the most common when sending XML over the wire

            however you can also send it as an encoded string ,,,, as plain XML is
            AFAIK impossible when using key value pairs

            a simple solution would be

            exe code

            Imports System.Net
            Imports System.Web
            Imports System.Xml
            Imports System
            Public Class Form1
            Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
            System.EventArg s) Handles Button1.Click
            Dim url As String = "http://localhost/Default.aspx"
            Dim objDoc As New System.Xml.XmlD ocument
            objDoc.Load("c: \sample.xml")
            MsgBox(SendAndR eceive(url, objDoc.OuterXml ))
            End Sub

            Public Function SendAndReceive( ByVal Url As String, ByVal vxml As
            String) As String
            Dim result As String = String.Empty
            Try
            Dim wc As New WebClient

            Dim postdata As New Specialized.Nam eValueCollectio n

            postdata.Add("T est", HttpUtility.Url Encode(vxml))
            wc.UploadValues (Url, "POST", postdata)
            result =
            System.Text.Enc oding.UTF8.GetS tring(wc.Upload Values(Url, "POST", postdata))
            Catch ex As Exception

            End Try
            Return result


            End Function
            End Class


            server code

            Partial Class _Default
            Inherits System.Web.UI.P age

            Protected Sub Page_Load(ByVal sender As Object, ByVal e As
            System.EventArg s) Handles Me.Load
            Response.Clear( )


            Response.Write( HttpUtility.Url Decode(Request. Form("Test")))




            End Sub

            End Class


            as you see you have now the problem that you need to decode the data on
            the server side


            hth

            michel



            Comment

            • CindyH

              #7
              Re: httputility.url encode(doc.oute rxml) as a http xml post

              Yep, that's right - I have to decode on other side.
              Big pain - I just figured out how to do this, don't know if it's the best
              way or not.
              The guy tested it from his box and it seems to be working.
              Thanks for all your input and taking the time to send me this code!



              "Michel Posseth" <msnews@posseth .comwrote in message
              news:u%23Ozk1St IHA.2188@TK2MSF TNGP04.phx.gbl. ..
              Cindy H schreef:
              >Yea, your code is almost exactly like how I orginally had mine when I was
              >first asked to do this, but then the client added this "key name" deal to
              >the project and said he wanted it sent as a single key name. I didn't
              >know what he was talking about then someone mentioned that he probably
              >was refering to this:
              >Dim encodedstring = "test=" + httputility.url encode(doc.oute rxml)'.
              >I asked him if this was correct and he said yes, so trying to come up
              >with the code to send and read the request on other end..
              >>
              >>
              >"Michel Posseth [MCP]" <MichelPossethM CP@discussions. microsoft.comwr ote
              >in message news:2E20D079-338A-4C2B-8555-0075A8F23DB5@mi crosoft.com...
              >>Okay
              >>>
              >>well i hope i understand this right ,,, but here is my implementation
              >>>
              >>Client code ( VB executable )
              >>>
              >>Imports System.Net
              >>Imports System.Web
              >>Imports System.Xml
              >>Imports System
              >>Public Class Form1
              >> Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
              >>System.EventA rgs) Handles Button1.Click
              >> Dim url As String = "http://localhost/Default.aspx"
              >> Dim objDoc As New System.Xml.XmlD ocument
              >> objDoc.Load("c: \sample.xml")
              >> MsgBox(SendAndR eceive(url, objDoc.OuterXml ))
              >> End Sub
              >>>
              >> Public Function SendAndReceive( ByVal Url As String, ByVal vxml As
              >>String) As String
              >> Dim ResultHTML As String = String.Empty
              >> Try
              >> Dim myrequest As System.Net.WebR equest =
              >>System.Net.We bRequest.Create (Url)
              >> myrequest.Metho d = "POST"
              >> myrequest.Conte ntType = "text/xml"
              >>>
              >> Dim byteArray As Byte() =
              >>System.Text.E ncoding.UTF8.Ge tBytes(vxml)
              >> myrequest.Conte ntLength = byteArray.Lengt h
              >> Dim dataStream As System.IO.Strea m =
              >>myrequest.Get RequestStream()
              >> dataStream.Writ e(byteArray, 0, byteArray.Lengt h)
              >> dataStream.Clos e()
              >>>
              >> Dim myresponse As System.Net.WebR esponse =
              >>myrequest.Get Response()
              >> Dim Reader As New
              >>IO.StreamRead er(myresponse.G etResponseStrea m)
              >> ResultHTML = Reader.ReadToEn d()
              >> Catch ex As Exception
              >>>
              >> End Try
              >> Return ResultHTML
              >> End Function
              >>>
              >>>
              >>>
              >>End Class
              >>>
              >>>
              >>Server code ( default.aspx )
              >>>
              >>Partial Class _Default
              >> Inherits System.Web.UI.P age
              >>>
              >> Protected Sub Page_Load(ByVal sender As Object, ByVal e As
              >>System.EventA rgs) Handles Me.Load
              >> Response.Clear( )
              >> Dim Reader As New IO.StreamReader (Request.InputS tream)
              >> Dim result As String = Reader.ReadToEn d()
              >> Response.Write( result)
              >> End Sub
              >>>
              >>End Class
              >>>
              >>>
              >>>
              >>i hope above makes sence :-)
              >>>
              >>ofcourse in my example i just send the xml file and display the response
              >>of
              >>the default.aspx just to see if the xml had arrived
              >>>
              >>>
              >>but i guess this is what you wanted ??
              >>>
              >>HTH
              >>>
              >>Michel Posseth [MCP]
              >>>
              >>>
              >>>
              >>>
              >>>
              >>>
              >>>
              >>>
              >>"CindyH" wrote:
              >>>
              >>>well the deal is that I need the post sent in key word - like
              >>>test=doc.out erxml
              >>>>
              >>>"Michel Posseth [MCP]" <MSDN@posseth.c omwrote in message
              >>>news:uAkH0NE tIHA.1772@TK2MS FTNGP03.phx.gbl ...
              >>>>Maybe you could explain the task a bit more ?
              >>>>>
              >>>>You want to send XML data with a post command , this you can not do
              >>>>without encoding the XML data
              >>>>this task is simple
              >>>>>
              >>>>But then you brought up streaming and i got confused , on HTTP
              >>>>everythin g
              >>>>is text this doens`t mean you cannot send binary`s cause you can with
              >>>>encoding and decoding ( BASE 64 or ROT 13 or even a custom protocol
              >>>>as
              >>>>long as the outcome is a text format that doesn`t interfere with HTML
              >>>>gs )
              >>>>>
              >>>>>
              >>>>hth
              >>>>>
              >>>>Michel
              >>>>>
              >>>>"CindyH" <chenschel@new. rr.comschreef in bericht
              >>>>news:OhmMCs DtIHA.2064@TK2M SFTNGP05.phx.gb l...
              >>>>>Hi
              >>>>>I'm not sure whether I should send this as a new message or use the
              >>>>>one
              >>>>>I've been using but...
              >>>>>I'm using vb.net 2.0 -
              >>>>>My problem is I need to send
              >>>>>somethin g like this: 'dim encodedstring = "test=" +
              >>>>>httputilit y.urlencode(doc .outerxml)' as a http xml post and then need
              >>>>>to
              >>>>>receive it on other end for a test.
              >>>>>It needs to be sent as a stream.
              >>>>>I need some sample code on how to post it and then receive the
              >>>>>request on
              >>>>>other end so I get the information from the xml.
              >>>>>Been playing around with all kinds of code and not getting anywhere.
              >>>>>Thanks,
              >>>>>Cindy
              >>>>>>
              >>>>>
              >>>>
              >>>>
              >>
              >>
              okay ....
              >
              the code i showed is the most common when sending XML over the wire
              >
              however you can also send it as an encoded string ,,,, as plain XML is
              AFAIK impossible when using key value pairs
              >
              a simple solution would be
              >
              exe code
              >
              Imports System.Net
              Imports System.Web
              Imports System.Xml
              Imports System
              Public Class Form1
              Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
              System.EventArg s) Handles Button1.Click
              Dim url As String = "http://localhost/Default.aspx"
              Dim objDoc As New System.Xml.XmlD ocument
              objDoc.Load("c: \sample.xml")
              MsgBox(SendAndR eceive(url, objDoc.OuterXml ))
              End Sub
              >
              Public Function SendAndReceive( ByVal Url As String, ByVal vxml As
              String) As String
              Dim result As String = String.Empty
              Try
              Dim wc As New WebClient
              >
              Dim postdata As New Specialized.Nam eValueCollectio n
              >
              postdata.Add("T est", HttpUtility.Url Encode(vxml))
              wc.UploadValues (Url, "POST", postdata)
              result =
              System.Text.Enc oding.UTF8.GetS tring(wc.Upload Values(Url, "POST",
              postdata))
              Catch ex As Exception
              >
              End Try
              Return result
              >
              >
              End Function
              End Class
              >
              >
              server code
              >
              Partial Class _Default
              Inherits System.Web.UI.P age
              >
              Protected Sub Page_Load(ByVal sender As Object, ByVal e As
              System.EventArg s) Handles Me.Load
              Response.Clear( )
              >
              >
              Response.Write( HttpUtility.Url Decode(Request. Form("Test")))
              >
              >
              >
              >
              End Sub
              >
              End Class
              >
              >
              as you see you have now the problem that you need to decode the data on
              the server side
              >
              >
              hth
              >
              michel
              >
              >
              >

              Comment

              Working...