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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only

Which is better...URL connection or Context with invoke

  • 1.  Which is better...URL connection or Context with invoke

    Posted 02/15/09 02:55 PM

    Hi,
    Our java client (webLogic app server) submit multiple documents to webMethods TN. Presently we use the following code to submit xml document.

        Context context = null;
    context = new Context();
    context.connect(server, userName, password);
    
    IData       id;
    IDataCursor rc;
    
    //Make 3 attempts to invoke webmethod service
    for(int count=1; count<=3 ; count++) {
    id = context.invoke(packageName, className, inputData);
    
    //READ STATUS OF SUBMISSION TO WEBMETHODS
    rc = id.getCursor();
    while(rc.next()) {
    if(rc.getKey().equals("StatusCode"))     statusCode = (String)rc.getValue();
    else if(rc.getKey().equals("StatusMsg")) statusMsg  = (String)rc.getValue();
    }
    //NOT SUCCESSFULLY SUBMITTED
    if(!statusCode.equals("0"))
    throw new wMException("Invoke failed. Message:"+statusMsg);
    }
    

    This takes about 9 to 17 seconds. This is very long. We want to reduce it to 3seconds. Is it possible?

    Is it better to use URL connection? Will it result in less time to submit document?

    Regards,
    Krishnan


    #B2B-Integration
    #webMethods
    #Integration-Server-and-ESB