Confederatecaptain got the wording closer to right than my quick answer - but the obligation to obey awful orders of lawfully appointed superiors is NOT by any means the same as taking an oath to an office 9or office holder). One of the things taht got the Germans (I speak of their militray) twisted up in WWII was the requirement that they take a PERSONAL oath to the Fuhrer. We don't do that, ours is to the Constitution. The obligation you accept (explicitly) as aprt of it to obey LAWFUL (I emphasize that for a reason) orders from your lawfully appointed superiors is an obligation that comes with the oath to accept, support and defend the Constitution. The distinction may seem subtle, but it is there and important.
By the way, the UCMJ actually imposes a duty, subject to criminal sanctions, if you do NOT disobey UNLAWFUL orders...