Using Safe Arrays in ASPs

B

Bob.Brandt

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
 
M

Mark Schupp

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

--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
(e-mail address removed)
http://www.ielearning.com
714.637.9480 x17
 
B

Bob.Brandt

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

xmlStr = "<?xml version=""1.0""
encoding=""utf-8""?> said:
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
 
M

Mark Schupp

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
(e-mail address removed)
http://www.ielearning.com
714.637.9480 x17
 
B

Bob.Brandt

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

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

Bob Brandt
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top