Every such writ or summons shall be served as provided in article two, chapter fifty-six of this code, and if it be against a corporation, it shall be served on some of the persons mentioned in sections thirteen and fourteen of article three, chapter fifty-six of this code; and if service thereof cannot otherwise be made upon any defendant named in such writ or summons, it may be made by publication as prescribed in said last-named article.