He served in both the United States Senate and House of Representatives .
Frye spent most of his political career as a legislator , serving in the Maine House of Representatives and U.S. House of Representatives before being elected to the U.S. Senate , where he served for 30 years and died in office .