To create a synchronous client, you need the following API calls:
The client calls the static SoamFactory.initialize() to initialize the API.
The client calls the static SoamFactory.connect() to establish a connection with Symphony.
The method creates and returns a Connection object that represents the physical connection to Symphony.
The method creates and returns a session object, which acts as a conduit through which the client can send input to its service.
The client creates an input message called myMessage and invokes Session.sendTaskInput() on the session object. This starts the chain of events that eventually sends the input to the service for processing.
The call to sendTaskInput() causes an OutputStream to be internally created.
The session calls onSerialize() on the input message and passes the OutputStream to the method.
In the onSerialize() method, the input message writes itself to the provided OutputStream.
The byte array representation of the input message is sent to Symphony.
As a result of the initial sendTaskInput( ) call, Symphony returns a TaskInputHandle to the client, which contains an identifier that can help match the input to the output that will later return. At the same time, Symphony also sends the input message to the service for processing and obtains the output from the service invocation.
The client calls fetchTaskOutput( ) method on the session object.
Symphony sends the output back to the client as a result of the fetchTaskOutput( ) method call.
The output is put into an EnumItems object, which is basically a list of outputs, if multiple outputs are retrieved.
The client iterates over the EnumItems object to inspect each TaskOutputHandle. The TaskOutputHandle is a container for the output from the Service.
The client must call the static SoamFactory.uninitialize( ) method to uninitialize the API.