Software AG Products 10.7 | Integrating On-Premises and Cloud Applications | Service Development | Building Java Services | Generating Code a Java Service Can Use to Invoke a Specified Service
 
Generating Code a Java Service Can Use to Invoke a Specified Service
 
Generating Java Code to Invoke a Service
Example of Java Code Generated for Invoking a Service
You can have Designer generate Java code that invokes a selected service, which you can then add to a Java service. Designer generates code that:
*Creates an IData object based on the service’s declared input parameters
*Invokes the selected service passing it the IData object and catching exceptions
*Retrieves the returned IData object from the selected service
*Uses the key/value pairs in the returned IData object to assign variables based on the declared output parameters of the selected service
You do not have to generate code for all the input and output parameters. You can select to generate code for only the input parameters, only the output parameters, or you can select one or more input/output parameters for which to generate code.
When Designer generates code from the service input/output parameters, it puts the code on the clipboard. From there, you can paste it into a Java service and modify it as necessary.