When the validity of a marriage is denied or doubted, either or both of the parties to the marriage may bring an action for a declaratory judgment seeking a declaration of the validity or invalidity of the marriage and, upon proof of the validity or invalidity of the marriage, the marriage shall be declared valid or invalid by decree of the court and, unless reversed upon appeal, the declaration shall be conclusive upon all persons concerned.