Serialization of the invoke/response packets and headers.