The actual origin of the term 'Doughboy' is still debated within both US historical and military circles, but it dates back to at least the American-Mexican War of 1846-7; an excellent summary of the theories can be found here. However, when US serviceman returned to Europe en masse during the Second World War, the term doughboy had vanished: these soldiers were now GI's.
You may be interested to note that 'doughboy' was also the nickname of an inanimate object, a form of flour based dumpling that partly developed into the doughnut, and was in use by the late eighteenth century.

