Call a PL script through HTTP and get returned values

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Robert Brown

    #1

    Call a PL script through HTTP and get returned values

    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.locati on = 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
  • Guido Wesdorp

    #2
    Re: Call a PL script through HTTP and get returned values

    Robert Brown wrote:[color=blue]
    > 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).
    >[/color]
    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

    Comment

    • GIMME

      #3
      Re: Call a PL script through HTTP and get returned values

      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.openConnect ion();
      connection.setD oOutput(true);
      PrintStream out = new PrintStream(con nection.getOutp utStream());
      out.print(sQuer yString);
      out.close();
      DataInputStream in = new DataInputStream (connection.get InputStream());
      // parse the result from the perl server
      in.close();
      } catch(Malformed URLException mue) {
      System.out.prin tln("MalformedU RL : " + mue);
      } catch(Exception e) {
      System.out.prin tln("Error: " + e);
      }
      return;
      }

      rbrown@edium.co m (Robert Brown) wrote in message news:<bdd1819.0 312020157.5a18b fe8@posting.goo gle.com>...[color=blue]
      > 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.locati on = 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[/color]

      Comment

      • Robert Brown

        #4
        Re: Call a PL script through HTTP and get returned values

        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.redirec t 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!

        Comment

        Working...