Using Safe Arrays in ASPs

Discussion in 'ASP General' started by Bob.Brandt@galileo.ie, Sep 17, 2003.

  1. Guest

    I need to find some way of using Safe Arrays within an ASP without using an
    external application.

    Here is the senerio:

    I have one ASP and sends XML data to another ASP which returns Data from a
    Database. Pretty straight forward, however the XML string is quite long and
    I would like to pass it to the second ASP via a POST rather then a GET.
    Problem is that the only way to retrieve the data is to use the BinaryRead
    method of the Request object. This data is only text, but I can not find
    any reference of how to use the data once I have retrieved it?!?!

    So my question is how do I access the Data from the REQUEST.BINARYREAD?

    Or, how else do I read the POSTed data?

    Thanks
    Bob Brandt
    , Sep 17, 2003
    #1
    1. Advertising

  2. Mark Schupp Guest

    show your code and an example of the XML to be sent.

    --
    Mark Schupp
    --
    Head of Development
    Integrity eLearning
    Online Learning Solutions Provider

    http://www.ielearning.com
    714.637.9480 x17


    <> wrote in message
    news:um6c$...
    > I need to find some way of using Safe Arrays within an ASP without using

    an
    > external application.
    >
    > Here is the senerio:
    >
    > I have one ASP and sends XML data to another ASP which returns Data from a
    > Database. Pretty straight forward, however the XML string is quite long

    and
    > I would like to pass it to the second ASP via a POST rather then a GET.
    > Problem is that the only way to retrieve the data is to use the BinaryRead
    > method of the Request object. This data is only text, but I can not find
    > any reference of how to use the data once I have retrieved it?!?!
    >
    > So my question is how do I access the Data from the REQUEST.BINARYREAD?
    >
    > Or, how else do I read the POSTed data?
    >
    > Thanks
    > Bob Brandt
    >
    >
    Mark Schupp, Sep 17, 2003
    #2
    1. Advertising

  3. Guest

    The first asp (test.asp) is:
    ----------------------------------------------------------------------------
    -------------------
    Dim objxmlhttp
    Set objxmlhttp = Server.CreateObject("Msxml2.ServerXMLHTTP")

    xmlStr = "<?xml version=""1.0""
    encoding=""utf-8""?><search><type>basic</type><sessid>959404635</sessid><use
    r></user><pass></pass><op></op><dd>01/Oct/2003</dd><du>7</du><dp>ANY</dp><ds
    >ANY</ds><accom></accom><ad>1</ad><ch>0</ch><res></res><ra></ra><bo></bo><pr

    ice></price><fto></fto><ftr></ftr></search>"

    objxmlhttp.Open "POST", "http://tqtest.galileo.ie/xml/xmltest.asp", False
    objxmlhttp.setRequestHeader "Content-Type", "text/xml"
    objxmlhttp.send xmlStr
    Response.write objxmlhttp.responseText
    Set objxmlhttp=nothing
    ----------------------------------------------------------------------------
    -------------------

    The second asp (xmltest.asp) is:
    ----------------------------------------------------------------------------
    -------------------
    tempdata=Request.BinaryRead(Request.TotalBytes)
    Response.ContentType="text/xml"

    Response.BinaryWrite tempdata
    Response.End
    ----------------------------------------------------------------------------
    -------------------

    Right now the second file just spits back the XML code. But what I want to
    do is readin the XML information, access a database, and return an XML
    string. I am able to do this through the GET method, but the XML string is
    quite long and it looks unprofessional. I would greatly prefer to use the
    POST method.

    Bob
    , Sep 18, 2003
    #3
  4. Mark Schupp Guest

    Do a regular form post instead of sending as "text/xml"

    objxmlhttp.Open "POST", "http://tqtest.galileo.ie/xml/xmltest.asp", False
    xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
    objxmlhttp.send "xml=" & server.urlencode(xmlStr)

    OR

    Get the SOAP toolkit from MS
    (http://www.microsoft.com/downloads/details.aspx?FamilyId=C943C0DD-CEEC-4088
    -9753-86F052EC8450&displaylang=en).

    It should contain the components and sample scripts you need to receive
    "text/xml" messages.

    May be other ways as well.


    --
    Mark Schupp
    --
    Head of Development
    Integrity eLearning
    Online Learning Solutions Provider

    http://www.ielearning.com
    714.637.9480 x17


    <> wrote in message
    news:...
    > The first asp (test.asp) is:
    > --------------------------------------------------------------------------

    --
    > -------------------
    > Dim objxmlhttp
    > Set objxmlhttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
    >
    > xmlStr = "<?xml version=""1.0""
    >

    encoding=""utf-8""?><search><type>basic</type><sessid>959404635</sessid><use
    >

    r></user><pass></pass><op></op><dd>01/Oct/2003</dd><du>7</du><dp>ANY</dp><ds
    >
    >ANY</ds><accom></accom><ad>1</ad><ch>0</ch><res></res><ra></ra><bo></bo><pr
    > ice></price><fto></fto><ftr></ftr></search>"
    >
    > objxmlhttp.Open "POST", "http://tqtest.galileo.ie/xml/xmltest.asp", False
    > objxmlhttp.setRequestHeader "Content-Type", "text/xml"
    > objxmlhttp.send xmlStr
    > Response.write objxmlhttp.responseText
    > Set objxmlhttp=nothing
    > --------------------------------------------------------------------------

    --
    > -------------------
    >
    > The second asp (xmltest.asp) is:
    > --------------------------------------------------------------------------

    --
    > -------------------
    > tempdata=Request.BinaryRead(Request.TotalBytes)
    > Response.ContentType="text/xml"
    >
    > Response.BinaryWrite tempdata
    > Response.End
    > --------------------------------------------------------------------------

    --
    > -------------------
    >
    > Right now the second file just spits back the XML code. But what I want

    to
    > do is readin the XML information, access a database, and return an XML
    > string. I am able to do this through the GET method, but the XML string

    is
    > quite long and it looks unprofessional. I would greatly prefer to use the
    > POST method.
    >
    > Bob
    >
    >
    Mark Schupp, Sep 18, 2003
    #4
  5. Guest

    Thank You. I knew there had to be a simple answer!

    I tested it out (the first idea) and that works perfectly!

    Bob Brandt
    , Sep 19, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?anBvcHBlcg==?=

    New session created when moving between asps and asp pages

    =?Utf-8?B?anBvcHBlcg==?=, Apr 7, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    363
    Cowboy \(Gregory A. Beamer\) [MVP]
    Apr 8, 2004
  2. Replies:
    4
    Views:
    333
    Tim Williams
    Nov 28, 2007
  3. BARTHA CLIFTON

    PUTTING THE ASPS INTO THE TRANLOADAS

    BARTHA CLIFTON, Dec 24, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    268
    Mark Rae [MVP]
    Dec 24, 2007
  4. Lakshmi Jagarlapudi

    how to run asps on windows xp

    Lakshmi Jagarlapudi, Dec 5, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    104
    Lakshmi Jagarlapudi
    Dec 5, 2003
  5. Rob Rutherford

    How can I test ASPs?

    Rob Rutherford, Aug 23, 2003, in forum: ASP General
    Replies:
    3
    Views:
    97
    Rob Rutherford
    Aug 24, 2003
Loading...

Share This Page