(a) When service of the summons is made by publication and judgment is given for want of answer, upon application to the court at any time within two years from the entry of the judgment, the defendant, or his successors in interest as to the whole or any part of the property, shall be entitled to an order vacating the judgment and granting a new trial upon the payment of the costs of the action.
(b) If the plaintiff has taken possession of the property before the judgment is set aside and a new trial granted, as provided in subsection (a) of this section, such possession shall not be thereby affected in any way, and if judgment is given for the defendant in the new trial he shall be entitled to restitution by execution in the same manner as if he were plaintiff.