Add node programmatically including CCK field
First I would recommend using this type of structure for crating nodes progmatically

$node = new stdClass();
$node-&gt;type = 'story';
node_object_prepare($node);


If you're worried bout the content type being an issue use a switch statement by passing the content type in:

swicth($field_map['type'][$value['type']]){
  case 'story': //populate fields of story type;
    break;
  case 'page': //populate fields of page type;
    break;
}


Also if you are using a web service to import nodes I would suggest that you use the Feeds module http://drupal.org/project/feeds rather than creating them manually. I'm speaking from experience .