webMethods

 View Only
  • 1.  IDataUtil string source

    Posted Tue January 22, 2013 10:13 PM

    I am very new to webMethods and apologize in advance for what I am sure is a really dumb question… In the code below, what is the source of the strings that IDataUtil.getString is returning?

    thanks,

    Rick

    Logger logger = Logger.getLogger( “fileHandling.copyFile” );

    IDataCursor cursor = pipeline.getCursor();

    String varName = { “sourceDirectory”, “sourceFileName”, “targetDirectory”, “targetFileName” };
    String temp = new String[ 4 ];
    for ( int i = 0; i < 4; i++ ) {

    temp[ i ] = IDataUtil.getString( cursor, varName[ i ] );
    if ( temp[ i ] == null || temp[ i ].trim().length() == 0 ) {
    
    throw new ServiceException( "Input parameter " + varName[ i ] + " is required." );
    }
    

    }

    String sourceDirectory = temp[ 0 ];
    String sourceFileName = temp[ 1 ];
    String targetDirectory = temp[ 2 ];
    String targetFileName = temp[ 3 ];


    #If-it-doesn-t-fit-anywhere-else
    #webMethods
    #webMethods-Archive


  • 2.  RE: IDataUtil string source

    Posted Wed January 23, 2013 03:27 PM

    Java services in IS accept inputs passed via the pipeline. The pipeline is basically a hashtable. The code is retrieving the values of named elements in the pipeline. The names (keys) of the variables being retrieved are in the varName array. So the source of the strings are the inputs the caller of this service is passing.


    #If-it-doesn-t-fit-anywhere-else
    #webMethods-Archive
    #webMethods


  • 3.  RE: IDataUtil string source

    Posted Wed January 23, 2013 07:47 PM

    Thanks for the reply… I now see the IData pipeline is input to this copyfile service. I’ve looked at how the pipeline is built using key/value pairs.

    If I am reading this correctly, it appears that one key value pair is SYSTEM_CONFIG_FILENAME, SYSTEM_CONFIG_FILENAME as seen below, however my guess would be that this value is just a default and might be set elsewhere to an actual filename. The root issue I am trying to solve is exactly where the value for MailHost is stored and then introduced to the pipeline.

    thanks,

    Rick

    IDataCursor cursor = pipeline.getCursor();

    IDataUtil.put( cursor, “SYSTEM_CONFIG_FILENAME”, SYSTEM_CONFIG_FILENAME );

    cursor.destroy();


    #webMethods-Archive
    #webMethods
    #If-it-doesn-t-fit-anywhere-else


  • 4.  RE: IDataUtil string source

    Posted Wed January 23, 2013 09:32 PM

    There are 4 input key/value pairs that the Java code is retrieving. Named in the varName array in the code you posted.

    The IDataUtil.put() call is putting a key/value pair into the pipeline. Presumably this is defined as an output of the service. The Java variable named SYSTEM_CONFIG_FILENAME is presumably set somewhere within the Java service.

    Instead of posting just bits and pieces of the Java service, post it all and ask exactly what you’re looking for.

    You may want to do a bit more reading of the docs to better understand the pipeline concept.


    #webMethods-Archive
    #If-it-doesn-t-fit-anywhere-else
    #webMethods


  • 5.  RE: IDataUtil string source

    Posted Wed January 23, 2013 10:10 PM

    I am definitely a newb and just beginning to understand the pipeline concept and how MAP and INVOKE work. Thanks for being so patient with me…

    I think I have found my answer… errrr… most of it anyway… The mailhost value looks like it resides in a physical XML file named SystemConfig.xml. I can now change the value to the new one I need to use, although I still need to find where the physical filename is called out in a WM service.

    Is there a search all for services?

    thanks very much!

    Rick


    #If-it-doesn-t-fit-anywhere-else
    #webMethods-Archive
    #webMethods