469,306 Members | 2,443 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

Using Safe Arrays in ASPs

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
Jul 19 '05 #1
4 1694
show your code and an example of the XML to be sent.

--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
ms*****@ielearning.com
http://www.ielearning.com
714.637.9480 x17
<Bo********@galileo.ie> wrote in message
news:um**************@TK2MSFTNGP09.phx.gbl...
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

Jul 19 '05 #2
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
Jul 19 '05 #3
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/d...C0DD-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
ms*****@ielearning.com
http://www.ielearning.com
714.637.9480 x17
<Bo********@galileo.ie> wrote in message
news:eu**************@TK2MSFTNGP11.phx.gbl...
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

Jul 19 '05 #4
Thank You. I knew there had to be a simple answer!

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

Bob Brandt
Jul 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Glenn | last post: by
2 posts views Thread by Varun Singal | last post: by
3 posts views Thread by Rob Rutherford | last post: by
36 posts views Thread by Robert Vazan | last post: by
1 post views Thread by Antony Sequeira | last post: by
2 posts views Thread by =?Utf-8?B?U2hhcm9u?= | last post: by
95 posts views Thread by hstagni | last post: by
3 posts views Thread by BARTHA CLIFTON | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.