In the Symphony API, you need to implement methods to read messages from I/O streams. Symphony handles the serialization and deserialization of messages between the client application and the service.
Input to the onSerialize( ) method is an empty output stream. You must write the code that puts your data into that stream.
Input to the onDeserialize( ) method is an output stream that contains your serialized data. You must write the code to populate your message's member variables with the data from the stream.
When the client calls the appropriate API method to send a task input to the service, the input message is serialized to a binary form.
Symphony transports this binary data to the service with no knowledge of its content.
In order to do its work, the service needs to gain access to the input message. The service calls the appropriate API method to access the input message, which causes the binary data to be deserialized to an input message.
The service processes the input message and generates a processing result (an output message).
The service sets this output message to indicate its intent to return the result to the client. When the service calls the appropriate API method to set the output, the output message is serialized to a binary form.
When the service processing method returns, Symphony transports this binary data to the client with no knowledge of the data's content.
The client calls the appropriate API method to access the output message from the service, which causes the binary data to be deserialized to an output message. The client then proceeds to process the output.