When a man had 'taken the King's shilling' it meant that he had enlisted in the Army. In the eighteenth century, recruiting parties were a common sight in villages and at country fairs. Recruiting officers would persuade men to enlist with misleading tales of the glamour of army life, and the offer of a 'bounty'. This was a large sum of money, supposedly paid to the new recruit when he enlisted. In fact most of it disappeared in various 'deductions' and the recruit was lucky to see any of it.
Here, the new recruit takes the money or shakes hands to seal the bargain, with the officer. His wife or sweetheart, obviously less naive, is clearly distressed at the prospect of his 'going for a soldier'.