After the adoption of the new Constitution of Norway on 17 May 1814, Prince Christian Frederick was elected king. The ensuing Swedish–Norwegian War (1814) and the Convention of Moss compelled Christian Frederick to abdicate after calling an extraordinary session of the Norwegian Parliament, the Storting, to revise the Constitution in order to allow for a personal union with Sweden. On 4 November the Storting elected Sweden's king, Charles XIII, as the King of Norway, thereby confirming the union. Continuing differences between the two realms led to a failed attempt to create a separate Norwegian consular service and then, on 7 June 1905, to a unilateral declaration of independence by the Storting. Sweden accepted the union's dissolution on 26 October. After a plebiscite confirming the election of Prince Carl of Denmark as the new king of Norway, he accepted the Storting's offer of the throne on 18 November and took the regnal name of Haakon VII.