As the play begins, it is nighttime and very cold, and two named characters (Bernardo and Francisco) and two unnamed sentinels are on watch on a platform of the castle of Elsinore, Denmark. Francisco, who was just relieved by Bernardo exits after speaking only a few lines. We never see him again in the play.
Strangely and ironically, the only other single soldier referred to in the play is Hamlet, who is not really a soldier. So we have Francisco on the first page of the play and dead Hamlet on the very last page, and the very last lines of the play, soldiers both.
Let four captains
Bear Hamlet like a soldier to the stage;
For he was likely, had he been put on,
To have proved most royal; and, for his passage,
The soldiers' music and the rites of war
Speak loudly for him.
Take up the bodies. Such a sight as this
Becomes the field, but here shows much amiss.
Go, bid the soldiers shoot.
Fortinbras sees Hamlet as a soldier, for Hamlet fought valiantly against his own nature and for the soul of his suffering father.