Help with WmSamples idata sample - infinite loop issue in webMethods 6.5?

I’m trying to run WmSamples sample.idata:readAndWriteRecordList java service in webMethods 6.5. It seems to be involved in some “infinite loop” and doesn’t stop. I can run this service in webMethods 4.6 without any problems and the result is returned instantly.

Basically, what this service is trying to do is to take the content of an input document list (recordListIn) and copy the data to an output document list (recordListOut). In each loop of the input document list, the recordListIn/field(n) is mapped to recordListOut/field-out(n)
where (n) means that the number of fields in the document varies.

The content of this service is available in WmSamples (sample/idata folder). I’ve also included the Java service below (for reference).
I’m really confused why this service works in webMethods 4.6 but it keeps “looping” in webMethods 6.5 (even when I filled in only 1 record in recordListIn).


public static final void readAndWriteRecordList( IData pipeline ) throws ServiceException {

// Get IDataCursor to manipulate pipeline
IDataCursor idcPipeline = pipeline.getCursor();
// Get input objects from pipeline. If no such key/value pair exists, returns null.
// If more than one exists, returns the value part of the first pair.
// If the value is not an IData, returns null.
IData recordListIn = IDataUtil.getIDataArray( idcPipeline, “recordListIn” );
int i, j;
if ( recordListIn == null )
// Print to standard output an error message and exit processing
util.Log.log(“Input could not be found in pipeline!”, “sample.idata”);
// Instantiate array of recordListOut IData objects equal to the length of
// the recordListIn object. Now you have an array of recordListOut IData objects.
IData recordListOut = new IData[recordListIn.length];
// Loop over the input record list (recordListIn). If you were building a
// record list from a vector, you would loop over the enumeration object.
for (i = 0; i < recordListIn.length; i++)
// Each individual IData object in the array of recordListOut needs
// to be created.
recordListOut[i] = IDataFactory.create();
// Need to get cursors on each individual record in the array
IDataCursor idcRecordListIn = recordListIn[i].getCursor();
IDataCursor idcRecordListOut = recordListOut[i].getCursor();
// Loop over the recordIn object while there are values
while ( IDataUtil.getString( idcRecordListIn ) != null)
// getKey gets the name in the name/value pair.
String key = idcRecordListIn.getKey();
String keyOut = key + “-out”;
// Next get the value out of the name/value pair. Note: This is a big
// assumption that all elements in recordListIn are strings.
String value = IDataUtil.getString( idcRecordListIn );
// insert it into the recordOut cursor
IDataUtil.put( idcRecordListOut, keyOut, value);
// move to the next name/value pair in recordIn;
// Always destroy cursors
// Always destroy cursors
idcPipeline.insertAfter(“recordListOut”, recordListOut);


This issue is fixed…


What was the solution?