File indexing completed on 2024-04-06 12:08:21
0001
0002
0003 die "Usage sendCmdToApp.pl host port cmdFile\n" if @ARGV != 3;
0004
0005 $host = $ARGV[0];
0006 $port = $ARGV[1];
0007 $cmdFile = $ARGV[2];
0008
0009 die "The file \"$cmdFile\" does not exist\n" unless -e $cmdFile;
0010
0011 $curlCmd = "curl --stderr /dev/null -H \"Content-Type: text/xml\" -H \"Content-Description: SOAP Message\" -H \"SOAPAction: urn:xdaq-application:lid=0\" http://$host:$port -d \@$cmdFile";
0012
0013 open CURL, "$curlCmd|";
0014
0015 print "Sending command to executive $host:$port ";
0016
0017 while(<CURL>) {
0018 chomp;
0019 $soapReply .= $_;
0020 }
0021
0022 if($soapReply =~ ) {
0023 print "OK\n";
0024 exit 0;
0025 } elsif($soapReply =~ ) {
0026 print "FAULT\n";
0027 print "$soapReply\n";
0028 exit 1;
0029 } elsif($soapReply eq "") {
0030 print "NONE\n";
0031 exit 1;
0032 } else {
0033 print "UNKNOWN response\n";
0034 print "$soapReply\n";
0035 exit 1;
0036 }