See Developers Guide (Chapt 14. Developing Client Code).
Developer will automatically generate the following code
(Tools–>GenerateCode…)
===========java service that calls a flow service (generated by Developer)
// input
IData input = IDataFactory.create();
IDataCursor inputCursor = input.getCursor();
IDataUtil.put( inputCursor, “flowInString”, “flowInString” );
inputCursor.destroy();
// output
IData output = IDataFactory.create();
try{
output = Service.doInvoke( “ladson_java2flow”, “flowCallee”, input );
}catch( Exception e){}
IDataCursor outputCursor = output.getCursor();
String flowOutString = IDataUtil.getString( outputCursor, “flowOutString” );
outputCursor.destroy();
===============hand coded java service that calls a flow service
String javaInString;
String javaOutString;
String folder = “ladson_java2flow”;
String service = “flowCallee”;
//get java input
IDataCursor idcPipeline = pipeline.getCursor();
if(idcPipeline.first(“javaInString”))
{
javaInString = (String)idcPipeline.getValue();
}
else
{
System.out.println(“genCSVFileLoop: javaInString is not in pipeline!”);
throw new ServiceException(“javaInString is not in pipeline!”);
}
//setup input for flow service
String flowInString = javaInString;
IDataCursor idcPipe = serviceIn.getCursor();
idcPipe.first(“flowInString”);
idcPipe.delete();
idcPipe.insertBefore(“flowInString”, flowInString);
idcPipe.destroy();
//call flow service
try
{
serviceOut = invokeISService(folder, service, serviceIn);
}
catch (Exception e)
{
throw new ServiceException(e);
}
//return output value
String flowOutString;
IDataCursor idcOutput = serviceOut.getCursor();
if(idcOutput.first(“flowOutString”))
{
flowOutString = (String)idcOutput.getValue();
}
else
{
System.out.println(“java2flow: flowOutString is not in pipeline!”);
throw new ServiceException(“flowOutString is not in returned pipeline!”);
}
System.out.println(“flowOutString=”+flowOutString);
#webMethods#webMethods-General#Integration-Server-and-ESB