Please see the source code example available in the doc/api-examples/create_domain directory of your JSCAPE MFT Server installation.