As an enlisted Marine, I swore to defend the Constitution and obey the orders of the President and his officers. The question is, what does one do if the two conflict? I was never in a position where I had to decide, but I did think about it.
For me the deciding factors were:
The Constitution is the first item listed while the orders of the President is third after bearing faith and allegience to the Constitution.
Officers do not swear to obey the orders of the President, they only swear to defend the Constitution. They are expected to disobey illegal orders.
I would expect that an officer would never order me to violate the Constitution. But, for me, the Constitution trumps orders if in conflict.