In 1796 he was borne on the books of the Fairy sloop, commanded by his maternal uncle, John Irwin, whom, early in 1797, he followed to the Prince George; in this ship he was present at the battle of Cape St. Vincent.
On 6 November 1801 he was promoted to the rank of lieutenant; served in the Sophie sloop; in the Active, one of the ships which passed the Dardanelles in February 1807, and in the Spartan, with Captain Jahleel Brenton.
‘I was myself,’ wrote Brenton, ‘wounded about the middle of the action, which lasted two hours; but my place was most ably supplied by Mr. Willes, first lieutenant, whose merit becomes more brilliant by every opportunity he has of showing it.
He is, without exception, one of the best and most gallant officers I ever met with.’ Willes, who was himself severely wounded, was promoted on 2 June 1810 to be commander; he was also granted permission to accept and wear the order of St. Ferdinand and Merit, third class.
In 1811–12 he commanded the Leveret brig in the North Sea, where he captured several of the enemy's privateers; he was afterwards in the Bacchus on the Irish station, and on 7 June 1814 he was made a captain.