Upon entering the palace, you will be escorted to a small room on the right just inside the door. On the table will be a guest register. You will then be permitted to sign the guest register. After signing you will be instructed to return directly to the gate from whence you came. Don't worry too much about wearing anything too formal when you do this.
Casual attire is fine.
I even saw someone else go in after us in Bermudas and a T-shirt.