You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Andy Lim <an...@caltan.com> on 2001/09/28 03:09:43 UTC
Calling a cgi on other web server.
Hello. Guys.
This might be a stupid question.
I have two web servers. One is my main web server which runs under linux and
EMBPERL. (Web server-A)
The other is a windows based web server. (Web server - B)
I have ODBC connection setup between server B and unidata server. But can't
have connection from server A because they don't have ODBC driver for Linux
yet.
So, I need to execute a perl program (CGI) on server A to make a simple
query to unidata.
Is there any way that I can call this perl CGI program on server A from the
inside of my embeded perl code on server B and get the return value from
that cgi program?
Thanks
+++++++++++++++++++++++++++++++++
Andrew Lim
Web Developer
California Tan, Inc.
10877 Wilshire Blvd. 12th FL.
Los Angeles, CA 90024
T. 310.824.2508 ext.245
F. 310.824.0082
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Calling a cgi on other web server.
Posted by Andrew O'Brien <an...@switchonline.com.au>.
On Thu, Sep 27, 2001 at 06:09:43PM -0700, Andy Lim wrote:
> Is there any way that I can call this perl CGI program on server A from the
> inside of my embeded perl code on server B and get the return value from
> that cgi program?
Not "nicely" unless I, too, am missing something obvious :)
Basically you have to make a request to that URL, get back the output
and the parse it into whatever data structures you want.
I'm sure there are less ugly ways of doing it but using LWP is
something I do fairly often (tho not from within Embperl). perldoc LWP
and take the first example which does a fairly simple request with
POST data.
HTH
--
Andrew O'Brien
Product Engineer email: andrewo@switchonline.com.au.
Switch Online Group Pty Limited phone: +61 2 9299 1133
ABN 89 092 286 327 fax: +61 2 9299 1134
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org
Re: Calling a cgi on other web server.
Posted by Angus Lees <gu...@switchonline.com.au>.
On Thu, Sep 27, 2001 at 06:09:43PM -0700, Andy Lim wrote:
> This might be a stupid question.
> I have two web servers. One is my main web server which runs under linux and
> EMBPERL. (Web server-A)
> The other is a windows based web server. (Web server - B)
>
> I have ODBC connection setup between server B and unidata server. But can't
> have connection from server A because they don't have ODBC driver for Linux
> yet.
if server B can use (perl) DBI to access the database, DBD::Proxy
might be the cleanest solution.
otherwise (as andrew said), an LWP client to access a cgi on server B.
if you can write a custom script for B, you can probably return the
data in a more "helpful" format than HTML.
--
- Gus
---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org