Note that you can still be attacked while under the Shield of Peace protection.
If you have a portal open anywhere on the Kingdom map, enemy players will be able to launch a march towards your portal. In this case, once their troops reach your portal, there will be a fight, while the enemy will ignore your City Walls and the Shield of Peace.