Is it (all are for melee attacks without reach/unarmed attacks):
1) When a successful attack is made
2) When an attack would have hit the warded character's touch AC
3) Every attack, successful or not
From the SRD:
"This spell wreathes the character in flame and causes damage to each creature...