How to create nodes using node_save?
Instead of casting an array into a stdClass object, you could try creating a new stdClass() object and then using node_object_prepare() to prepare the object for creating a new node and then finally manually changing the values of uid, name, title, language, body, etc. Also, be sure to use node_submit() before saving the new node to the database.

Example: http://drupal.org/node/1173136