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
Expand all | Collapse all

How I could pass java objects from 1 java service to another in Flow service

  • 1.  How I could pass java objects from 1 java service to another in Flow service

    Posted Mon January 05, 2015 04:22 AM

    Hi All

    I have scenario like my 1st Java service returns java objects and the same needs to be used in the 2nd Java service.
    Both the services are in order inside the Flow service .

    Please suggest how to handle this

    Regards
    Sankalp


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Mon January 05, 2015 05:43 AM

    I believe its a normal case, where the first service output can be passed on to the second service. Can you please post the issue you are facing?

    /Naidu


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 3.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Mon January 05, 2015 05:48 AM

    The scenario is like that

    from 1st Java WS I have been getting an Map object and now I am putting this Map as :

    IDataUtil.put( pipelineCursor_1, “map”, map);

    and now in second Java WS I am fetching this map as :

    Object map = IDataUtil.getString( pipelineCursor, "map " );
    

    here the issue is the original Map is lost

    Please suggest

    Regards,
    Sankalp


    #webMethods
    #Integration-Server-and-ESB
    #webMethods-General


  • 4.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Mon January 05, 2015 06:26 AM

    Dont use getString, because that will cast to… String
    And you have an extra space “map” <> "map "


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 5.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Mon January 05, 2015 06:35 AM

    Just a thought, why cant you have all the implementation/logic implemented in one java service. Or create two java services and in a flow service invoke the two and map it accordingly.


    #webMethods
    #webMethods-General
    #Integration-Server-and-ESB


  • 6.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Mon January 05, 2015 07:36 AM

    Yes, Niek is correct in his observation.

    Try to use - get(IDataCursor cursor, java.lang.String key) instead of getString.

    /Naidu


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods


  • 7.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Mon January 05, 2015 07:52 AM


  • 8.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Mon January 05, 2015 12:41 PM

    In the second service, you have to use IDataUtil.get(…) (like proposed above). Then you have to downcas the returned object to the desired type (or, better said, to the type you know the object is of – a Map in your case).


    #webMethods-General
    #webMethods
    #Integration-Server-and-ESB


  • 9.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Tue January 20, 2015 03:22 PM

    In your 1ts service what is the output type of the map variable? It can either be Object or Map.
    Same applies to the second service input.

    Will also suggest to debug the service, or at least make sure the output of the first service is not null.

    If you want to see how to log debug info manually for java services have a look here:


    #Integration-Server-and-ESB
    #webMethods
    #webMethods-General


  • 10.  RE: How I could pass java objects from 1 java service to another in Flow service

    Posted Fri January 30, 2015 06:44 PM

    Are you trying to call one java service from the other or are you calling the java services individually from the flow service?

    If you are calling from the flow service, you may return the object from java as output and pass the same as input to the second java service… ?


    #Integration-Server-and-ESB
    #webMethods-General
    #webMethods