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.  Convert Object to String

    Posted Thu July 15, 2004 04:51 PM

    Greetings wmusers.

    I have an adapter that returns a record from database. The record contains an integer field, which WM regards as an Object in the resultset. How can I convert this Object to a string, or something that I can work with? Is there a function to convert an Object to something else? Or do I need to write a Java class? Seems like the most basic thing of all, but I can’t find it in documentation or any built in service.

    Thanks in advance.


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


  • 2.  RE: Convert Object to String

    Posted Thu July 15, 2004 05:05 PM

    PS…Of course it’s quite easy to create a java class that receives the
    Integer and converts it to a string…infact…just one line of code. But I’m just wondering if I’m missing something with webMethods, since I can only imagine every developer me has encountered this issue. Thanks for your insight.


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


  • 3.  RE: Convert Object to String

    Posted Thu July 15, 2004 05:09 PM

    Kayman,

    There is a simple way to do this in the Adapter service itself,In the JDBC OutputFieldType change that Integer variable to java.lang.string.
    So no manual coding necessary.

    Also check this thread and my comments.

    [url=“wmusers.com”]wmusers.com

    HTH,


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


  • 4.  RE: Convert Object to String

    Posted Thu July 15, 2004 05:32 PM

    and, if you are using old adapter in EI where you cannot convert directly at adapter level (depending upon which database adapter), you have to write that one line of code to convert it manually.

    HTH.


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


  • 5.  RE: Convert Object to String

    Posted Thu July 15, 2004 05:33 PM

    son of a gun. i’ll be darned. Thanks RMG!


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


  • 6.  RE: Convert Object to String

    Posted Thu July 15, 2004 05:37 PM

    I agree with RMG that it is best to have the adapter service output a string to begin with, but if you can’t do that, there is a package called WmTransformationServices (available for download from advantage utilities and samples section). There are many transformation services in this package, including IntegerToString.


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