Please see the Getting Started with HAFTA document and the accompaning example source code for working examples.