Execute perl script from CPO

                   Hi everyone,
Is it possible to execute a perl script directly from CPO without using a cgi or soap action, If yes, is there any documentation or model workflows that I can refer to...

Its a prewritten script hosted in a linux box(svc cat server), first we tried to invoke it as a soap request...
<?xml version="1.0" encoding="UTF-8"?>
http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema">
">
#username#
this worked but we want to discontinue this approach,
so we tried to host the script as cgi and invoke the cgi directly...
but this is not working, so wanted to see if we can execute the script from CPO either directly by using CLI or by hosting the script in a server

Similar Messages

  • Urgent Problem in Executing perl script from shell script

    Hello,
    I've a shell script on one server (source) and a perl script on another (target).
    My perl script will check whether the directoryname, filename provided by shell script exists on the target server or not.
    My shell script is as follows:
    #! bin/bash
    cmd=`ssh user@target "perl /home/user/test_dir/validate_file.pl"`
    echo $cmd
    And my perl script uses a package CU_Functions.pm, which is in the same directory as the perl script on the target server.
    But when I invoke the perl script from shell script, I get the following error:
    Source:user> (db:ias10g12_mid_db) /home/user/perl
    $ sh /home/user/arcs/arcs_conn.sh
    user@target's password:
    Can't locate CU_Functions.pm in @INC (@INC contains: /local/perl-5.6.1/lib/5.6.1/i686-linux /local/perl-5.6.1/lib/5.6.1 /local/perl-5.6.1/lib/site_perl/5.6.1/i686-linux /local/perl-5.6.1/lib/site_perl/5.6.1 /local/perl-5.6.1/lib/site_perl .) at /home/user/test_dir/validate_file.pl line 13.
    BEGIN failed--compilation aborted at /home/user/test_dir/validate_file.pl line 13.
    Please let me know if I need to do any configurations prior to call the perl script.

    As for the Perl INC, I cannot recall the environment variable that sets that but the following example should work:
    ssh user@host "export ENV_VAR=/path/to/include/files:$ENV_VAR ; /full/path/to/script"

  • Execute Perl Script from Forms

    Ji all, is there a way to execute a Perl Script out of Forms beside WEB.SHOW_DOCUMENT ?

    Depends on where the script should be executed. If its on the application-server and you can wrap it into a shell-script, then you can also use HOST.

  • How can I get firefox to execute perl scripts from local files

    I have created perl scripts on my local host (file type ".pl").
    In MS Windows I have associated that type to a perl interpreter installed on my local host.
    IE allows me to create links to them and to execute them (after asking for permission).
    How can I get firefox to do the same? It doesn't seem to allow me to add application types, only to change those that are already defined. As a result, in firefox, they just show up as text, instead of being executed.

    First guess is that you did not use an .html extension on the file. The file may well be ''name.html.txt''
    * see http://www.bbc.co.uk/webwise/guides/file-extensions
    *http://windows.microsoft.com/en-gb/windows/show-hide-file-name-extensions#show-hide-file-name-extensions=windows-vista
    Forum Note
    This is normally offtopic for this forum. I say normally because now we cover webmaker questions. I wonder if this is therefore on topic as a webmaker question?
    I have tagged with webmaker-contribution

  • Executing perl script from Apex

    Hi,
    I have a requirement, to post the form controls in the apex page onto a perl script.
    Can any one let me know whether this is feasible in Apex.
    If Yes, can anyone please give me the steps or the related documents to 'submit' the apex page to specific perl script.
    Any answers to this would be greatly helpful for us as we are dependent on this kind of architecture completely for
    our requirements.
    Thanks in advance,
    Sumanth

    Hi,
    I haven´t done this myself but I think the way to go is call perl from the database as an external procedure.
    You might want to google for extproc_perl which should be the extension to use perl as an external procedure/
    On the submit you can trigger PL/SQL to call the external procedure.
    Regards
    Bas

  • Executing a perl script from within java application

    Hi,
    Does anyone knows a way to execute a perl script from within java.
    ---kirk

    Runtime.exec("perl myscript.pl");
    Of course whether that "works" depends on what the script does and where the java program runs.

  • How to call a perl script from an apple script

    Hi All,
    How to Call a perl Script from an apple script.
    Pls Give Your comments.
    Thanx & Regards,
    Esther

    Applescript to call a perl script named "/tmp/x.pl" passing an argument "world"
    do shell script "/usr/bin/perl /tmp/x.pl world"
    or if the script is given the executable atttribute (chmod +x /tmp/x.pl),
    do shell script "/tmp/x.pl world"
    Perl script "/tmp/x.pl" that prints a string using a passed argument
    #!/usr/bin/perl
    print "Hello $ARGV[$1]\n";

  • Shell or perl script from OS command_Sender File Channel

    Hi All,
    I am trying to execute a perl script from the File Sender Channel(NFS), OS command Before Message Processing. The script works fine if i run it from the shell. But when PI calls the script,  the script does not get executed. The audit logs mention that the OS command has been called.
    I tried using:
    1) /<fullpath>perlScript.pl /<fullpath>filename.dat
    2) perl /<fullpath>perlScript.pl /<fullpath>filename.dat
    Both these commands work fine when i execute them on the shell.
    I am on solaris and PI 7.0. The permission for the perl script and input files are all 777.
    FYI.. i am using this perl script to transpose a complex file and make it # delimited file.
    I have already read the blogs for OS command and executed some sample scenarios successfully.
    I tried to call a shell script that does the same functionality as the perl script. Even that does not work.
    Also, wrote a shell script to call the perl script inside it. No luck.
    eg:
    touch /fullpath>/create_before.dat
    perl /<fullpath>perlScript.pl /<fullpath>filename.dat
    touch /<fullpath>/create_after.dat
    In this case, the create_before.dat and create_after.dat is getting created but the perl is not called. I know this because i cant see the output files of the perl script.
    Regards,
    Balaji
    Edited by: Balaji M on Oct 30, 2008 2:36 PM

    Hi,
    The problem is fixed. The shell or perl both have logic to transpose a non industry starndard file to the delimited file which PI can use an FCC to pick up.
    This was the fix:
    we need to mention the shell the script is going to be run in.
    In the shell script we mentioned --> *#!/usr/bin/bash* as the first line
    normally, when we use the command -- which bash on the unix command prompt, it tells us the path for the bash used.
    another option --> #!/usr/bin/ksh
    again, on the command prompt -- which ksh command will tell us what ksh is being used.
    If the script is a simple one that does copy or move commands, i believe we need not use the commands above. But is a good practice to have them in the script.
    Regards,
    Balaji
    Edited by: Balaji M on Nov 3, 2008 4:38 PM

  • How to run the perl script from java ?

    Hi , I need to run the pearl script from the server and to get the result of the script thro' java using SSH
    Is there any 3rd party SSH API in java ?
    Please help me out
    thanks in advance
    karthik

    This seems like a very strange thing to want to do.
    What is the perl script doing?
    Do other programs (not some shell script) access this server-side perl script from a different machine?
    If so how do they do it?
    What currently triggers the perl script to execute?
    What currently handles the output from the perl script?
    If you can answer these questions (and understand the answers) you should be able to come up with a different approach to this.
    You do not really want to call a remote perl script from a Java program, you want to achieve the effect you think that would have if you could do it.
    So find the answers to the above questions, write them on 3" x 5" cards and lay them out on your desk.
    What flow of control needs to happen? Which piece of code needs to produce or consume which piece of data?
    If that fails, ask you self or who ever is making you do this what are the use-cases?
    If you do not know what use-cases are or do not understand them well enough try reading
    Use Case Modeling (The Addison-Wesley Object Technology Series) by Kurt Bittner and Ian Spence (Paperback - Aug 30, 2002)
    http://www.amazon.com/s/ref=nb_ss_gw/002-7908514-4043267?url=search-alias%3Dstripbooks&field-keywords=use+cases&x=0&y=0
    It is a short and easy to read book on the subject and also one of the best.
    You MUST understand WHAT you are trying to achieve before you can decide HOW you are going to achieve it.

  • Execution of Perl Script from HTML DB page.

    Hi All,
    I have a Perl script which takes 5 parameters and fetches data from one database and insert that data into my database table which is a master table for my project.
    Is there any way to execute the perl script from a HTMLDB page by passing parameters.
    Pls. provide me inputs if any.
    Thanks & Regds.
    Kumaraswamy RJ.

    Check out MOS note 1515609.1.
    Regards,
    - Loc

  • Calling PERL script from scheduler

    Hello All,
    I am trying to call PERL script from dbms_scheduler which makes the database connection using DBD module to read some values to perform the operation. My scheduler job kept failing with the following error:
    ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory
    STANDARD_ERROR="install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file
    It can't open libclntsh.so.10.1 file when I run the job, I guess because in job session, it creates a new shell and doesn't inherit the .profile and none of the environmental variables get set. When I run the PERL script manually it works because of all the env variables, so I put all those variables from my .profile into PERL script itself using ENV function but it still doesn't work, failed with very same error. And yes I do set LD_LIBRARY_PATH to point to $ORACLE_HOME/lib directory. Moreover, if I run the PERL script manually from a shell where I dont inherit .profile, it fails with very same error, so it is related to the environment issues but I have no idea how to fix it. I read somewhere the setting those env variable in PERL script itself doesn't help because by the time PERL get executed all the compilers are already initialized and and they don't use those environement variables anymore then. So the question is how to make it work?
    I would really appreciate if someone can help me fixing this, it's gonna change my life here :)
    DB Version: 10.2.0.2 (also tested on 11R2, same problem)
    OS: SUSE Linux 64 bit
    And here is my libclntsh file in $ORACLE_HOME/lib
    $ls -l libclnt*
    lrwxrwxrwx 1 epsora epsdba 52 2009-09-15 13:39 libclntsh.so -> /u01/app/epsora/product/10.2.0/lib/libclntsh.so.10.1
    -rwxr-xr-- 1 epsora epsdba 20274415 2009-09-15 13:39 libclntsh.so.10.1
    -rw-r----- 1 epsora epsdba 36840968 2009-09-15 13:38 libclntst10.a
    Please let me know if you need more information about this setup.
    Thanks
    Daljit Singh
    Edited by: Daljit on Jul 6, 2010 10:06 AM

    Nothing in your post indicates that you created a directory object and granted privileges.
    http://www.morganslibrary.org/reference/directories.html
    did you?

  • How execute Unix script from java?

    Can I execute Unix script from java?

    Yes. Using ProcessBuilder. And read [When Runtime.exec() wont|http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html]. It's old, but pretty much all of it is still true.

  • Is it possible to execute SAPGUI scripts from java program?

    Hi everyone..
         I need to develop an java applications that executes the SAPGUI script or any technique that execute set of transaction as client.
         Is it possible to execute SAPGUI scripts from java program? if so, how it can be achieved? is there any other technique to achieve above mention scenario?.
         it will be more helpful, if docs related to that are shared..
         Thanks in advance

    Oh, bummer. Would be much more convenient if I could just use iTunes for everything. Can't stand WMP. I wonder if WinAmp might be a good compromise?
    Thanks for this answer . . .
    Sharon

  • How does execute PHP Script from SAP?

    I've already installed SAPRFC and run SAP Function from PHP successfully. But failed when tried execute PHP script from SAP (SM59). Anyone can help me for a clear instruction for this problem?
    Thanks

    Hi Max,
    here is the Source:
    [code]
    #!/usr/bin/php -q
    <?php
    // SAPRFC - Server example
    // PHP server function RFC_READ_REPORT
    // Require: CGI version PHP, RFC destination defined in SAP R/3 (SM59)
    // http://saprfc.sourceforge.net
    // Interface definiton for RFC_READ_REPORT
    // (generated by saprfc.php - option Generate PHP)
       $DEF_RFC_READ_REPORT = array (
                             array (
                                     "name"=>"SYSTEM",
                                     "type"=>"EXPORT",
                                     "optional"=>"0",
                                     "def"=> array (
                                             array ("name"=>"","abap"=>"C","len"=>8,"dec"=>0)
                             array (
                                     "name"=>"TRDIR",
                                     "type"=>"EXPORT",
                                     "optional"=>"0",
                                     "def"=> array (
                                             array ("name"=>"NAME","abap"=>"C","len"=>40,"dec"=>0),
                                             array ("name"=>"SQLX","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"EDTX","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"VARCL","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"DBAPL","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"DBNA","abap"=>"C","len"=>2,"dec"=>0),
                                             array ("name"=>"CLAS","abap"=>"C","len"=>4,"dec"=>0),
                                             array ("name"=>"TYPE","abap"=>"C","len"=>3,"dec"=>0),
                                             array ("name"=>"OCCURS","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"SUBC","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"APPL","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"SECU","abap"=>"C","len"=>8,"dec"=>0),
                                             array ("name"=>"CNAM","abap"=>"C","len"=>12,"dec"=>0),
                                             array ("name"=>"CDAT","abap"=>"D","len"=>8,"dec"=>0),
                                             array ("name"=>"UNAM","abap"=>"C","len"=>12,"dec"=>0),
                                             array ("name"=>"UDAT","abap"=>"D","len"=>8,"dec"=>0),
                                             array ("name"=>"VERN","abap"=>"C","len"=>6,"dec"=>0),
                                             array ("name"=>"LEVL","abap"=>"C","len"=>4,"dec"=>0),
                                             array ("name"=>"RSTAT","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"RMAND","abap"=>"C","len"=>3,"dec"=>0),
                                             array ("name"=>"RLOAD","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"FIXPT","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"SSET","abap"=>"C","len"=>1,"dec"=>0),
                                             array ("name"=>"SDATE","abap"=>"D","len"=>8,"dec"=>0),
                                             array ("name"=>"STIME","abap"=>"C","len"=>6,"dec"=>0),
                                             array ("name"=>"IDATE","abap"=>"D","len"=>8,"dec"=>0),
                                             array ("name"=>"ITIME","abap"=>"C","len"=>6,"dec"=>0),
                                             array ("name"=>"LDBNAME","abap"=>"C","len"=>20,"dec"=>0)
                             array (
                                     "name"=>"PROGRAM",
                                     "type"=>"IMPORT",
                                     "optional"=>"0",
                                     "def"=> array (
                                             array ("name"=>"","abap"=>"C","len"=>40,"dec"=>0)
                             array (
                                     "name"=>"QTAB",
                                     "type"=>"TABLE",
                                     "optional"=>"0",
                                     "def"=> array (
                                             array ("name"=>"LINE","abap"=>"C","len"=>72,"dec"=>0)
    // Create list of PHP server functions
       $GLOBAL_FCE_LIST[RFC_READ_REPORT] = saprfc_function_define(0,"RFC_READ_REPORT",$DEF_RFC_READ_REPORT);
    // PHP server function
       function RFC_READ_REPORT ($fce)
           $REPORT = saprfc_server_import ($fce,"PROGRAM");
           saprfc_table_init ($fce,"QTAB");
           $fd = fopen ($REPORT,"r");
           if (!$fd)
               return ("NOTFOUND");     // raise exception "NOTFOUND"
           while (!feof($fd))
               $LINE = fgets ($fd,73);
               saprfc_table_append ($fce,"QTAB",array("LINE"=>$LINE));
           fclose ($fd);
           saprfc_server_export ($fce,"SYSTEM","PHP");
           return (true);
    // Call script with: ./server.php -a phpgw -g hostname -x sapgw00
       $rfc = saprfc_server_accept ($argv);
    // Dispatch one function call
       $rc = saprfc_server_dispatch ($rfc,$GLOBAL_FCE_LIST);
       saprfc_close ($rfc);
    ?>
    [/code]
    Regards
    Gregor
    Message was edited by: Gregor Wolf

  • Calling perl script from labview

    Hi,
    I have a perl script and I would like to call the perl script from Labview
    anyone can help me with that?
    I used system exec but I'm getting an error.
    Anyone have a working example like calling a simple perl script from Labview.
    Thanks
    SL Ong

    Hi,
    Thanks for the reply from everyone.
    The attached is my code to call Perl script and after calling this, I need to query the Perl Script by sending command like @help. Do they have a way to query the Perl script by sending command like @help and get the return result. 
    I think Joseph you are right, but how do I get the return result if I invoke it in a separate dos session.
    SL Ong

Maybe you are looking for