Except that it wasn't their soil to begin with.
They fired on more than one ship before that, yet no cause for war.
Third time was a charm for them.
If I understand the conventions correctly, a ship could be fired upon without it automatically being considered an act of war. The attack and conquest of a military post flying the US flag was viewed entirely differently than ineffectively shooting at a ship.