Hi All,
I am creating an interface into a Payment Gateway. I need to access a
URL (which is a perl script) with paramters attached. I will then get
a response within 10 seconds with information I need to formulate into
my pretty asp page.
I didn't know where to start but I have read alot about adodb.stream.
I setout to write some code and this is what I have done:
Set objStm = Server.CreateObject("ADODB.Stream")
objStm.Type = adTypeText
objStm.Open "URL=" & theurl, admoderead, 8
objStm.Charset = "ascii"
strText = objStm.ReadText
Response.Write strText
theURL variable contains the URL with the payment parameters.
On the open line however, I get an error c004800a. What the hell this
means I don't know. It doesn't matter what I put into theURL even if
it is something like www.yahoo.com, I still get the same error....
Ok, I read an interesting post about using XMLHTTP. I created the code
as follows:
Dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.XMLHTTP")
xmlhttp.Open "GET", theURL, false
xmlhttp.Send
Response.write xmlhttp.responseText
This seems to work very well. I actually got an error back from the
payment gateway stating NO PARAMETERS SUPPLIED. Realising this, I used
a POST rather than GET. Doing this I got FAILED NEED LOGIN although
the Login information was passed as two of the parameters in the URL.
I am doing a response.write of theURL so i know that is is filled with
the correct information. I couldnt find out what the false was for, so
I changed that to true, and got this error: The data necessary to
complete this operation is not yet available.
I am so lost, is there anyone that might have ideas on how to get the
above working. If I just put the URL into the browser, if works OK, so
I know the syntax of theURL is fine.
Thanks for your time,
Robert