He represented Annapolis County in the Nova Scotia House of Assembly from 1859 to 1867 and again from 1874 to 1878, and he represented Annapolis in the House of Commons of Canada from 1878 to 1882 as a Conservative member.
He was born in Paradise, Nova Scotia, the son of Asaph Longley and Dorcas Poole.
Longley helped found the Nova Scotia Fruit Growers' Association and served as its president from 1883 to 1884.
Longley served on the board of governors for Acadia College from 1874 to 1884.
Still a temperance advocate, while in Ottawa, he attempted to have the bar in the House of Commons closed permanently.