 James was elected as an Anti-Masonic candidate to the Twenty-sixth Congress and reelected as a Whig to the Twenty-seventh Congress.He served as chairman of the United States House Committee on Revisal and Unfinished Business during the Twenty-seventh Congress.He resumed the practice of his profession in West Chester, and served as chief burgess in 1850.