During the Second Schleswig War of 1864, Werner commanded a corvette against Danish naval forces. Werner fought with distinction at the Battle of Jasmund, under the command of Eduard von Jachmann; Werner's ship, , was badly damaged during the engagement and her crew suffered 13 casualties. The Danes successfully blocked the Prussian attempt to break through the Danish blockade, however, and forced them to return to Swinemünde. Werner and the rest of the fleet stationed there remained in port for the rest of the war.