Yes, a ranged touch attack to hit the opening. Anyone know the ac of a arrow slit? I might base it on size, not how much ac it provides. But thats just my opinion, YMMV.
Throwing a fireball past a melee, I usually just allow it, but would not object to a reasonable "to hit" roll being required.