webMethods 10.2 | Service Development Help | Building Java Services | Generating Java Code from Service Input and Output Parameters | Example of Java Code Generated from Service Signature
 
Example of Java Code Generated from Service Signature
Suppose you have a service that has the following input and output parameters:
Input Parameters
Output Parameters
String
Document
String
String
input1
inDoc
in1
in2
String
Document
String
String
output1
outDoc
out1
out2
The following shows code that Designer generated for the above input and output parameters:
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();
String input1 = IDataUtil.getString( pipelineCursor, "input1" );
 
// inDoc
IData inDoc = IDataUtil.getIData( pipelineCursor, "inDoc" );
if ( inDoc != null)
{
IDataCursor inDocCursor = inDoc.getCursor();
String in1 = IDataUtil.getString( inDocCursor, "in1" );
String  in2 = IDataUtil.getString( inDocCursor, "in2" );
inDocCursor.destroy();
}
pipelineCursor.destroy();
 
// pipeline
IDataCursor pipelineCursor_1 = pipeline.getCursor();
IDataUtil.put( pipelineCursor_1, "output1", "output1" );
 
// outputDoc
IData outputDoc = IDataFactory.create();
IDataCursor outputDocCursor = outputDoc.getCursor();
IDataUtil.put( outputDocCursor, "out1", "out1" );
IDataUtil.put( outputDocCursor, "out2", "out2" );
outputDocCursor.destroy();
IDataUtil.put( pipelineCursor_1, "outputDoc", outputDoc );
pipelineCursor_1.destroy();
Generating Java Code from Service Input and Output Parameters

Copyright © 2017-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release