middleware, sort of (same question, different posting software)

Discussion in 'Perl' started by Tigerhillside, Jan 23, 2004.

  1. I forgot I had a "real" newsreader available. So here is the
    question you will see "soon" when google decides to post my other
    question.


    I have a server side script that takes a user's input in a form,
    packages it, and sends it on to an external server. The external
    server will then send back the response via http to my server
    script. But not the same script. And there is the rub, I don't
    know how the second script can get to my user.

    Let me diagram this for clarity.

    The logic is this:

    Client -> me -> XS (external server) -> me -> client

    Simple enough.

    But as I see it, programmatically it goes like this:

    browser -> me script1 -> XS

    XS -> script2 -> browser

    I can't open a pipe to the external server, I only have http
    access. So I can't get the response back in the same script
    AFAICT. My script1 and script2 know enough to know it is the same
    transaction, but script2 can't find the browser/script1
    conversation.

    I suppose I could have script1 wait around until script2 writes a
    token of some sort saying it got the results. That seems like a
    hack, but if that is how it is done I can do that. Wait something
    like 30 seconds, checking every second for the token. Is that how
    it is done or is there a better way? Something like a named pipe
    or something that script2 can get its hands on?

    I know this is not, strictly speaking, a perl language question,
    but it is on topic.


    Thanks very much in advance.
    Tigerhillside, Jan 23, 2004
    #1
    1. Advertising

  2. In comp.lang.perl, Tigerhillside
    <>, I read and responded

    >I forgot I had a "real" newsreader available. So here is the
    >question you will see "soon" when google decides to post my other
    >question.
    >
    >
    >I have a server side script that takes a user's input in a form,
    >packages it, and sends it on to an external server. The external
    >server will then send back the response via http to my server
    >script. But not the same script. And there is the rub, I don't
    >know how the second script can get to my user.
    >
    >Let me diagram this for clarity.
    >
    >The logic is this:
    >
    >Client -> me -> XS (external server) -> me -> client
    >
    >Simple enough.
    >
    >But as I see it, programmatically it goes like this:
    >
    >browser -> me script1 -> XS
    >
    >XS -> script2 -> browser
    >
    >I can't open a pipe to the external server, I only have http
    >access. So I can't get the response back in the same script
    >AFAICT. My script1 and script2 know enough to know it is the same
    >transaction, but script2 can't find the browser/script1
    >conversation.
    >
    >I suppose I could have script1 wait around until script2 writes a
    >token of some sort saying it got the results. That seems like a
    >hack, but if that is how it is done I can do that. Wait something
    >like 30 seconds, checking every second for the token. Is that how
    >it is done or is there a better way? Something like a named pipe
    >or something that script2 can get its hands on?
    >
    >I know this is not, strictly speaking, a perl language question,
    >but it is on topic.
    >
    >
    >Thanks very much in advance.
    >


    Ok, I won't say I'm an idiot. After all, there are few bette ways
    to solve a problem on your own than to ask someone for help. My
    problem was that I misunderstood some documentation. (So much for
    RTFM as a silver bullet.) There are two ways to do what I needed
    from the external server. I could send my user to their web page,
    in which case the response came back to one of my server pages.
    Or I could just send the information, in which case I get a
    response. But I thought that the only way I got my response was
    via the other web page. Since I can get the response from the
    calling script I can just use the LWP module and everything will
    be fine. Thanks for being there anyway.
    Tigerhillside, Jan 23, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christopher Brewster
    Replies:
    5
    Views:
    331
    John Machin
    Nov 14, 2008
  2. bluebaron
    Replies:
    3
    Views:
    725
    Jonathan N. Little
    Nov 4, 2009
  3. stephbt
    Replies:
    0
    Views:
    356
    stephbt
    Jan 10, 2010
  4. Navin
    Replies:
    1
    Views:
    670
    Ken Schaefer
    Sep 9, 2003
  5. Guest
    Replies:
    2
    Views:
    170
    Foo Man Chew
    Dec 29, 2003
Loading...

Share This Page