smg1827 has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I am trying to debug my colleague's code.
(1) When I run this on command line
# java '<XML string>' http://weburlThe output is
<XML string> Result = [OPERATION SUCCESSFUL]
Note: It takes few seconds between the output line-1 and output line-2
(2) The same web service call is coded in Perl CGI as below:
$java_res = `java '<XML string>' http://weburl 2>/err.dat 1>/out.dat` ;I have introduced debug logs in the CGI program just before and after this code.
(3) When this CGI program is tested on command line. It works as expected.
err.dat is empty file and
out.dat has
<XML string> Result = [OPERATION SUCCESSFUL]
(4) When this same CGI program is called from web browser and running on web server it doesn't work as expected.
err.dat is empty file and
out.dat has
<XML string>
Note:
err.dat file is empty which is correct and as expected But
out.dat doesn't have the Result = [OPERATION SUCCESSFUL] which is not correct.
Also, the program hangs at this call and I don’t see the log message after this call. It means the program doesn’t continue after this. Log message works while running the same CGI on the command line.
For debugging purpose I did hardcode the java parameters just to make sure they are same in command line and web server.
Only thing I could suspect is there is some delay (max 5 seconds) between the output line-1 and output line-2. Please confirm if that could be the issue.
Please let me know how do I go about and debug this Perl CGI code.
Please let me know if you need more details to help me on this.
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to debug CGI when response is slow
by Anonymous Monk on May 12, 2012 at 07:43 UTC | |
by smg1827 (Initiate) on May 17, 2012 at 14:50 UTC | |
by smg1827 (Initiate) on May 17, 2012 at 14:59 UTC | |
|
Re: how to debug CGI when response is slow
by Khen1950fx (Canon) on May 12, 2012 at 08:20 UTC | |
by Anonymous Monk on May 12, 2012 at 10:19 UTC |