Adieu O soldier,
You of the rude campaigning, (which we shared,)
The rapid march, the life of the camp,
The hot contention of opposing fronts, the long manoeuvre,
Although the war is unnamed, Whitman is surely thinking specifically of the American Civil War, during which he volunteered in military hospitals as a male nurse. 

Adieu to a Soldier