here on Just Security, discusses "What the Law of Military Disobedience Can (and Can't) Do--What Happens if a President's Orders are Unlawful?" His conclusion:
. . . Expanding the circumstances in which members of the military could disobey superior orders would not only threaten good order and discipline, but it would also reduce the incentives for senior leadership to pay careful attention to the legality of their actions and potentially have a deleterious impact on civil-military relations. An elected president, Senate-confirmed military leadership, and strict adherence to the chain-of-command are the foundation of civilian control of the military, and being too quick to refuse orders from the president or the defense secretary threatens this bedrock tenant of American democracy. For, in the end, it is not individual members of the armed forces who bear the primary responsibility for stopping unwise military actions. Rather, it is the responsibility of other actors in our political system – Congress, through the exercise of its war powers; civil society; and, ultimately, all of us working to make our political vision a reality.