By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,600 Members | 1,861 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,600 IT Pros & Developers. It's quick & easy.

Call a PL script through HTTP and get returned values

P: n/a
Hi All..

What I have is a normal ASP web page wih javascript. The javascript
needs to call a payment gateway, but the only way to get to it is
https://paymentgateway/external.pl with parameters.

What is returned is a string containing several lines of information.
This information I need to formulate into my own page..

At present, I use document.location = https..... but of course this
displays the called page (above) in the browser screen with the
results.

Im sure this can be done, but how can I call this gateway webpage
without showing it (so the user would just see my please wait page)
and retrieve the data when it comes back (within 6 secs).

Thanks,
Robert
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Robert Brown wrote:
Hi All..

Im sure this can be done, but how can I call this gateway webpage
without showing it (so the user would just see my please wait page)
and retrieve the data when it comes back (within 6 secs).

What you want to do is get the results on the server side, not on the
client, so you want to make a request to the page, parse the result,
write a result page according to what you got back from the pl script
and send that to the client. To do this, you need to find out how to
call a URL and get the return value in ASP, not in JavaScript.

Cheers,

Guido

Jul 20 '05 #2

P: n/a
You have to submit the data to the "perl" gateway in
the ASP code. Javascript can't do it.

In java the call to the "perl" site might look like :

public void PostFetch( String site , String sQueryString ) {
try {
URL url = new URL(site);
URLConnection connection = url.openConnection();
connection.setDoOutput(true);
PrintStream out = new PrintStream(connection.getOutputStream());
out.print(sQueryString);
out.close();
DataInputStream in = new DataInputStream(connection.getInputStream());
// parse the result from the perl server
in.close();
} catch(MalformedURLException mue) {
System.out.println("MalformedURL : " + mue);
} catch(Exception e) {
System.out.println("Error: " + e);
}
return;
}

rb****@edium.com (Robert Brown) wrote in message news:<bd*************************@posting.google.c om>...
Hi All..

What I have is a normal ASP web page wih javascript. The javascript
needs to call a payment gateway, but the only way to get to it is
https://paymentgateway/external.pl with parameters.

What is returned is a string containing several lines of information.
This information I need to formulate into my own page..

At present, I use document.location = https..... but of course this
displays the called page (above) in the browser screen with the
results.

Im sure this can be done, but how can I call this gateway webpage
without showing it (so the user would just see my please wait page)
and retrieve the data when it comes back (within 6 secs).

Thanks,
Robert

Jul 20 '05 #3

P: n/a
Thanks for you reply.

I am glad to do it in ASP.

Now, I have been an ASP programmer for a while, yet do you think I can
remember (or find) exactly how to call a URL and get the return value? I
know of the command reponse.redirect but that will show the page.

If not being too bold could I ask for a little bit more help on this
subject. Mainly the call procedure. I have done a bout 4 hours
searching, and to say the least, my head is spinning.

Thanks again,
Robert
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.