天津条约
In 1855, Williams was appointed Secretary of the United States Legation to China. During his stay in China, he wrote "A Tonic Dictionary Of The Chinese Language In The Canton Dialect" (英華分韻撮要) in 1856. After years of opposition from the Chinese government, Williams was instrumental in the negotiation of the Treaty of Tientsin, which provided for the toleration of both Chinese and foreign Christians.