All soldiers, when on duty, are bound by the Military Code (UCMJ) as opposed to the Civilian Code (USC). Military code takes precedence over civilian code, when there is a conflict.
So, for example, while on military duty, if you break the speed limits on an Interstate, the state trooper...