After the finishing of his training, Riley was appointed a platoon leader within the 74th Company, 1st Battalion, 6th Marine Regiment and sailed for France in October 1917.
With the United States entry to World War II, Riley still served as Fleet Marine Officer with Atlantic Squadron under the command of Admiral Royal E. Ingersoll.
The citation for his Navy Distinguished Service Medal reads: The President of the United States of America takes pleasure in presenting the Navy Distinguished Service Medal to Brigadier General William E. Riley (MCSN: 0-829), United States Marine Corps, for exceptionally meritorious and distinguished service in a position of great responsibility to the Government of the United States as Assistant War Plans Officer and subsequently as Assistant Chief of Staff, War Plans, on the Staff of the Commander, South Pacific Area and South Pacific Force in the preparations for the operations of troops of that command from 22 July 1943 to 8 April 1944.
Displaying keen insight into the problems of amphibious warfare, painstaking care in planning, and shrewd and skillful judgment, Brigadier General Riley was instrumental in preparing plans for the assault of Vella Lavella, Bougainville, Green and Emirau Island which materially advanced the progress of the war and resulted in the saving of large numbers of lives of Allied troops.
The comprehensive knowledge, brilliant strategic planning, and careful preparation displayed by Brigadier General Riley throughout this period reflected great credit upon himself and upheld the highest traditions of the United States Naval Service.
[1]Riley later served again under admiral Halsey as assistant chief of staff of war plans within his United States Third Fleet.
On October 21, Graves was transferred back to the United States and Riley was appointed commanding general of the 3rd Marine Division.
During the August 1948, Riley was sent to Middle East and was appointed Commander of the United Nations Truce Supervision Organization (UNTSO).
After his retirement from the Marine Corps, Riley was appointed deputy director for management of United States Foreign Operations Administration in September 1953.
His son was also career Marine Corps officer, who served in Korea and Vietnam and was decorated multiple times, including award of the Legion of Merit with Combat "V".