Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > problem calling perl script from SOAP server perl script

Reply
Thread Tools

problem calling perl script from SOAP server perl script

 
 
pj
Guest
Posts: n/a
 
      04-09-2004
Hi

I am trying to call a perl script from SOAP server side perl script,
but no luck.

following is the SOAP server perl script where I call other perl
script. read_query function writes to a file okay, but does nothing
for the two system calls after that. Any ideas? thanks in advance

#!/usr/bin/perl

use lib '../lib';

use SOAP::Transport::HTTP;

SOAP::Transport::HTTP::CGI
-> dispatch_to('predictor')
-> handle;

package predictor;

sub read_query{
my $file=$_[0];
open (fileOUT, "> dBDataFiles/$file");

foreach $line (@_)
{
print fileOUT "$line";
}
close (fileOUT);

# Problem:: nothing happens for the nest two system commands.

system ("/bin/echo hello > dBDataFiles/test");
system ("/usr/bin/perl /home/nsf470/out.pl");

return "done"."\n\n";
}
 
Reply With Quote
 
 
 
 
pj
Guest
Posts: n/a
 
      04-09-2004
http://www.velocityreviews.com/forums/(E-Mail Removed) (pj) wrote in message news:<(E-Mail Removed). com>...
> Hi
>
> I am trying to call a perl script from SOAP server side perl script,
> but no luck.
>
> following is the SOAP server perl script where I call other perl
> script. read_query function writes to a file okay, but does nothing
> for the two system calls after that. Any ideas? thanks in advance
>
> #!/usr/bin/perl
>
> use lib '../lib';
>
> use SOAP::Transport::HTTP;
>
> SOAP::Transport::HTTP::CGI
> -> dispatch_to('predictor')
> -> handle;
>
> package predictor;
>
> sub read_query{
> my $file=$_[0];
> open (fileOUT, "> dBDataFiles/$file");
>
> foreach $line (@_)
> {
> print fileOUT "$line";
> }
> close (fileOUT);
>
> # Problem:: nothing happens for the nest two system commands.
>
> system ("/bin/echo hello > dBDataFiles/test");
> system ("/usr/bin/perl /home/nsf470/out.pl");


The return value of the system calls are 256. Why are they not working ?
 
Reply With Quote
 
 
 
 
Tad McClellan
Guest
Posts: n/a
 
      04-09-2004
pj <(E-Mail Removed)> wrote:

> #!/usr/bin/perl



You should ask for all the help you can get:

use warnings;
use strict;


> sub read_query{
> my $file=$_[0];
> open (fileOUT, "> dBDataFiles/$file");



You should always, yes *always*, check the return value from open():

open(fileOUT, "> dBDataFiles/$file") or
die "could not open 'dBDataFiles/$file' $!";


> foreach $line (@_)



Do you _want_ the first iteration to have the same value as what
you put into $file?

Writing the name of the file into the file seems strange to me...


> {
> print fileOUT "$line";

^ ^
^ ^

You should avoid useless uses of double quotes:

print fileOUT $line;


> return "done"."\n\n";



return "done\n\n";


--
Tad McClellan SGML consulting
(E-Mail Removed) Perl programming
Fort Worth, Texas
 
Reply With Quote
 
pj
Guest
Posts: n/a
 
      04-09-2004
Tad McClellan <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>.. .
> pj <(E-Mail Removed)> wrote:
>
> > #!/usr/bin/perl

>
>
> You should ask for all the help you can get:
>
> use warnings;
> use strict;
>
>
> > sub read_query{
> > my $file=$_[0];
> > open (fileOUT, "> dBDataFiles/$file");

>
>
> You should always, yes *always*, check the return value from open():
>
> open(fileOUT, "> dBDataFiles/$file") or
> die "could not open 'dBDataFiles/$file' $!";
>
>
> > foreach $line (@_)

>
>
> Do you _want_ the first iteration to have the same value as what
> you put into $file?
>
> Writing the name of the file into the file seems strange to me...
>
>
> > {
> > print fileOUT "$line";

> ^ ^
> ^ ^
>
> You should avoid useless uses of double quotes:
>
> print fileOUT $line;
>
>
> > return "done"."\n\n";

>
>
> return "done\n\n";



Thanks for the tips. It's still not working, that is system calll is
returning 256. any ideas why? please let me know.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ calling perl script - Not able to get the stack arguments pushedrom XPUSH in perl script Yogi Perl Misc 1 09-13-2012 11:30 AM
what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server? kath Perl Misc 4 04-09-2007 09:21 PM
Soap Extension problem (seems that soap request is not sent to server) Frederik Vanderhaegen ASP .Net Web Services 0 10-20-2006 09:18 AM
Problem of using apache soap to consume WSE 2.0 soap attachment Mullin Yu ASP .Net Web Services 0 10-08-2003 08:09 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments