webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Firecommandexec service in WmSamples package

  • 1.  Firecommandexec service in WmSamples package

    Posted Tue February 04, 2003 10:51 PM

    Can someone tell me how this works? I have .bat file I can execute by double clicking just fine. Attempting to run it via this service using a fullcommand of “cmd batfile.bat” returns a success flag of “true” but the bat file is not running. Where does the .bat file need to reside? Is there something else I’m missing?


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Firecommandexec service in WmSamples package

    Posted Tue February 04, 2003 11:14 PM

    the fire exec command should run the command but not provide output. you can ensure this is going on my creating a batch file which produces a file or writes something etc.

    to get output
    you need to do something like this:
    Process child = Runtime.getRuntime().exec(fullCommand);

    InputStream in = child.getInputStream();

    // print out stream
    BufferedReader din = new BufferedReader ( new InputStreamReader ( in ) );
    String txt = null;
    StringBuffer strBuf = new StringBuffer ();
    while ( ( txt = din.readLine () ) != null )
    {
    strBuf.append ( txt + “\n” );
    }
    idcPipeline.insertAfter(“output”, strBuf.toString());

    remember also to handle the error stream


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 3.  RE: Firecommandexec service in WmSamples package

    Posted Wed February 05, 2003 03:51 PM

    The batch file I’m submitting does a CD to change to a directory where a program resides and runs an executable with command line parameters that encrypts a file to another file name. So I would expect a new file to show up, like it does when I run the .bat file manually, but it doesn’t when run via this service. Any thoughts? Does that .bat file need to reside where the executable is?


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Firecommandexec service in WmSamples package

    Posted Wed February 05, 2003 07:08 PM

    All items are executed from the perspective of the main webMethods directory. I suggest using absolute paths…


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 5.  RE: Firecommandexec service in WmSamples package

    Posted Wed February 05, 2003 07:22 PM

    Thanx for your assistance, I was able to get it to work…seems kinda silly now…


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 6.  RE: Firecommandexec service in WmSamples package

    Posted Wed February 05, 2003 07:22 PM

    I am trying to gauge how much memory will be used when loading XML documents into memory. Suppose I have an XML document of size X kilobytes or has Y kilobytes of information

    Is there a good way of determining how much memory would be used in loading it into a record structure?

    I want to determine the upper limit of how large an XML can be loaded into a wM record structure. I suppose this will depend on the heap size, but I need to understand this a bit more.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 7.  RE: Firecommandexec service in WmSamples package

    Posted Wed February 05, 2003 07:36 PM

    It depends how you load the XML into webMethods. For least memory consumption, load the file as a stream and use the NodeIterator to extract the data you want. The main memory culprit is documentToRecord if the ‘document’ is the entire file. By creating smaller nodes using the NodeIterator you minimize what is loaded into memory. Set your JVM memory allocation to at least 500MB.

    If you load a 5meg XML file, the getFile (using bytes) method will reduce the available memory by 5megs.

    Have a look at the large document handling docs.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 8.  RE: Firecommandexec service in WmSamples package

    Posted Thu February 27, 2003 10:04 PM

    I’m having the same issue with the fireCommandExec file… I try to invoke a shell script that works perfectly from the command line and I get the successFlag fo True but the command never runs…

    My shell script simply takes the output of the bdf command(disk space usage) and sends it to a log file. Again, this works fine from command line not from WM…

    What was your fix to get it to work correctly?? Script is located in IS46 dir on UNIX and Ive even used a fully qualified path with no results at all… I’m stumped at this point

    Here is what my shell script looks like:

    #!/usr/bin/sh

    bdf | grep ‘WD1’ >> /wm/WD1/disk.log


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 9.  RE: Firecommandexec service in WmSamples package

    Posted Thu February 27, 2003 11:12 PM

    Ignore my earlier post i have it workingnow


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 10.  RE: Firecommandexec service in WmSamples package

    Posted Thu February 27, 2003 11:15 PM

    Ignore my earlier post i have it workingnow


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 11.  RE: Firecommandexec service in WmSamples package

    Posted Wed March 12, 2003 07:05 PM

    Jim: Please add how you solved your own problem. Will help
    other users to NOT do it, also will save a future post.


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 12.  RE: Firecommandexec service in WmSamples package

    Posted Wed March 12, 2003 07:05 PM

    I honestly dont know how I solved it… I just started
    working all of a sudden… What I did do was add a sleep
    function to the flow to give the script time to run before
    looking for the output file… I dont think that was the
    solution however… Sorry I cant be more explicit…


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 13.  RE: Firecommandexec service in WmSamples package

    Posted Tue March 18, 2003 05:03 PM

    I have a same issue. The script file (does encryption) works fine at Unix command line. It doesn’t work in fireCommandExec. I tried the sleep function. It didn’t make differece. Any suggestion?


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 14.  RE: Firecommandexec service in WmSamples package

    Posted Thu August 28, 2003 05:53 AM

    I am having the same problem. I place a wzzip command in a bat file and place the bat filename in the command for the service (firecommand). The service ends immediately but there is no output at that point. The zip file is produced only after 9 mins. The timings is not consistent sometimes it is 1 mins and sometimes it is 5 mins. Initially I thought it is not working until I put a savepipeline service in the flow and it starts producing output. But i am not quite comfortable with this inconsistent timing. Any suggestions folks ?


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 15.  RE: Firecommandexec service in WmSamples package

    Posted Thu August 28, 2003 06:07 PM

    Hi Nick,

    My objectives of using the firecommand service is becasue I need to zip a file with a password. I have downloaded the zip package that Rob has developed but there is no password capability. I am not good in java which is why I tried to avoid having to code it. So I am thinking if the firecommands helps. What you have suggested sound abit complicated to me. But If come to worse I have to do Java, then modifying the zip service is more feasible to me. Do you think it is difficult to change the zip package to allow password capability ?Not sure if you have seen the code in the first place


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 16.  RE: Firecommandexec service in WmSamples package

    Posted Fri August 29, 2003 01:14 AM

    Gary,
    It’s a good question - I hunted a little on the net for you. Assuming that the code you’re talking about uses java.util.zip.* …

    Other people have had your problem:
    [url=“Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos”]Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos

     The general solution seems to be implement your own security for what you put within the zip. If you're comfortable doing this, great. Perhaps there's another way to solve your problem. 
    
    Have you contacted the author of the code you're using? Rob (Eamon?) would probably be interested in hearing about your requirement. 
    

    Nick


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 17.  RE: Firecommandexec service in WmSamples package

    Posted Tue September 02, 2003 02:29 AM

    Yes I have checked with Rob, he gave me some suggestion. It seems to him that java.util.zip does not support password. I didn’t expect this to be so complicated. I manage to do some flow service using the firecommand service and activating some bat file. Though it works but I am not too satisfied with the time delay of this firecommand.Thks for the url.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods