IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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
  • 1.  Property File

    Posted Wed August 24, 2005 05:54 PM

    Hi,

    I am not familiar working with the Properties file but trying to develop some stuff based on PS Utilities in the forum and have a basic question on this.

    I am defining four fields in the Property file as below:
    #Property File
    Name1=wM1
    Name2=wM2
    Name3=wM3
    Name4=wM4

    When i’m reading the Property file using a Java Service(fileName as Input and Property as Output field); the result is displayed as follows:
    Property (Name) and
    {Name1=wM1, Name2=wM2, Name3=wM3, Name4=wM4} (value)

    I think the returned output “Property” is a string but when i try to tokenise the string, its throwing a “NullPointer Exception”. I wish to return the fields as a String List.

    Could someone tell me how to get the Property fields as a String List. In other words, how to define the Property File in the config folder that will return the output as a String List as wM1,wM2,wM3,wM4?

    Thanks for your help.


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


  • 2.  RE: Property File

    Posted Wed August 24, 2005 07:34 PM

    Raj,

    Here is the codesnippet of the JavaService this gives output as StringList,(see the attachment) and read the comments above the java code.
    Compile the java code and invoke this java service in a flow that reads the properties by specifying the inputs (propertyfilename,packagename,properties list that you want to retrieve) this gives the output Values(stringlist),so you can tokenize it as required wM1,wM2,wM3,wM4 etc…

    PS:Customize the service as per your requirement…

    HTH,
    RMG


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


  • 3.  RE: Property File

    Posted Wed August 24, 2005 08:38 PM

    Thanks alot RMG. but wondering what difference does that make placing the Properties file under config folder and pub folder (Just curious to know).


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


  • 4.  RE: Property File

    Posted Wed August 24, 2005 08:43 PM

    If you are putting the file inside package,then use pub folder,but i feel no diff as long as you are reading the properties from a certain location folder…In generanl config folder location is used by IS internally…

    HTH,
    RMG


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


  • 5.  RE: Property File

    Posted Wed August 24, 2005 10:59 PM

    If your properties have some environment dependent values like server names etc which differ as you migrate from test to production environments etc, I think its better to have them in config directory. By this way, the file in each of the config directories will have their own environment related values and can avoid possible migration mistakes.


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


  • 6.  RE: Property File

    Posted Wed August 24, 2005 11:14 PM

    Aneel,

    i agree with you…but some times we use property file specific to project (package)and this is not used globally,anyways when we move package no probs in missing.

    HTH,
    RMG


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


  • 7.  RE: Property File

    Posted Thu August 25, 2005 06:55 PM

    raj_preet,
    i rather would be extremely cautious in putting any config related file to the “pub” directory.

    If you want to put the config files within the package, create a new directory “config” under the package and use that dir.

    any files in the pub directory needs to be secured via the .access file. Putting the config files under the pub directory might result in security breach. Be CAUTIOUS and understand the implications before doing so.

    HTH,
    Saurabh


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


  • 8.  RE: Property File

    Posted Thu August 25, 2005 07:29 PM