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.  substring

    Posted Tue September 19, 2006 09:19 PM

    Given an ‘n’ character string, the pub.string:substring service in webMethods returns an empty string when I ask for substring with beginIndex=n and endIndex>n … shouldn’t this be giving me a StringIndexOutOfBoundsException ???

    for beginIndex=(n+1) and onward it gives StringIndexOutOfBounds … which is fine.

    Could someone please explain if this is the programmed behavior of this service and if so what is the logic in doing so?

    Thanks


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


  • 2.  RE: substring

    Posted Wed September 20, 2006 12:29 AM

    Hi,

    Yes, if end_index is greater then string.length then end_index is ignored. I agree with you that it should instead through an exception.

    The service seudo code goes like this

    if (begin_index == null || begin_index.length == 0 ) then
    begin_index = 0

    if (end_index == null || end_index.length == 0 || end_index.length > string.length)
    then
    return (string.subString(begin_index)
    else
    return (string.subString(begin_index, end_index))

    Ram Challuri


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


  • 3.  RE: substring

    Posted Wed September 20, 2006 03:41 PM

    Its just the way it is in wM, I guess. Will have to learn and live with it.


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


  • 4.  RE: substring

    Posted Wed September 20, 2006 07:18 PM

    That’s the way it is in Integration Server. How it is in other products from the company named webMethods may vary…


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


  • 5.  RE: substring

    Posted Thu September 21, 2006 12:43 AM