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

Error - Java service while passing Node

  • 1.  Error - Java service while passing Node

    Posted Tue July 08, 2008 03:38 PM

    Hi

    In my below code, i have input - object Node… ( which was converted from string to Node using the service XMLStringToNode service).

    Inthe java service, we are invoking the service nodeToDocument, where the input was the above Node.

    _________________________________________________________________
    IDataCursor pipelineCursor = pipeline.getCursor();

    Object node = IDataUtil.get( pipelineCursor, “node” );

    IData output = IDataFactory.create();
    IDataCursor outputCursor = output.getCursor();
    IDataUtil.put( outputCursor, “node”, node );

    [FONT=Arial][SIZE=2]
    IData output1 = IDataFactory.create();
    IDataCursor outputCursor1 = output1.getCursor();
    try
    {

    output1 = Service.doInvoke( “pub.xml”, “xmlNodeToDocument”, output );
    }
    catch( Exception e)
    {
    IDataUtil.put( pipelineCursor, “Exception”, e.getMessage() );
    }

    IData document = IDataUtil.getIData( outputCursor1, “document” );

    IDataUtil.put( pipelineCursor, “document”, document );
    [/size][/font]


    The problem is that, i get the null document as output.

    Please let me know wehre am i wrong


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


  • 2.  RE: Error - Java service while passing Node

    Posted Tue July 08, 2008 04:43 PM

    A couple of thoughts:

    • You’re creating a clone of the input var named “pipeline” into a var named “output.” What is the reasoning for doing this? Why not just pass “pipeline” to doInvoke?

    • You don’t need to create output1 yourself. The cursor you create on output1 is basically out of date since the assignment from the doInvoke call replaces output1. Get the cursor after the doInvoke call.

    • Why, oh, why are you doing this in Java?


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