473,320 Members | 2,189 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1784
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Glenn | last post by:
Is there any way to partially refresh a web page on each request? I have a search page that needs to refresh the number of results with each change in the form elements. Since there are so many...
2
by: Varun Singal | last post by:
Hi I am calling .NET components from my Classical ASPs. For this I strong named my assemblies, then registered them in the resistry ( using RegAsm), and put them in GAC (using GacUtil) ....
3
by: Rob Rutherford | last post by:
I have a PC running Win XP Home and want to learn how to write ASPs. In order to test them I think I need a web server installed on my PC. Since I don't believe IIS can be run under Win XP Home I...
36
by: Robert Vazan | last post by:
I am looking for other people's attempts to create safe subset of C and enforce it with scripts. Does anybody know about anything like this? By "safe", I mean the following: * Strongly typed...
1
by: Xiangliang Meng | last post by:
Hi, all. Recently, I find there is a way in our project to maintain a global set in many files by using preprocessing directives. I'm wondering if we could find a better method for this. Many...
1
by: Antony Sequeira | last post by:
I wanted to make a type safe array slice method (at least for single dimension arrays) Here is what I have public static <T> T arraySlice(T src, int offset, int length) { int dim = new int...
2
by: =?Utf-8?B?U2hhcm9u?= | last post by:
I'm using a COM DLL in my C# application (a single process). This COM DLL generates a data array, and by using the interop DLL (generated by VS/TlbImp.exe), I'm getting this array to a safe Array...
95
by: hstagni | last post by:
Where can I find a library to created text-based windows applications? Im looking for a library that can make windows and buttons inside console.. Many old apps were make like this, i guess ...
3
by: BARTHA CLIFTON | last post by:
HELLO I AM WONDERING IF ANYONE CAN HELP ME PUT THE ASPS IN THE TRANLOADAS I AM NOT VERY FAMILIAR WITH THIS METHOD PLEASE SOMEONE HELP ME THANK YOU~~~~~~~~!!!!!!!!!!!!!!!!!!
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.