The story goes that a gentleman by the name of Hiram Codd patented a bottle for fizzy drinks with a marble in the neck which kept the bottle shut by pressure of the gas until it was pressed inwards. Wallop was a slang term for beer and Codd's wallop came to be used by beer drinkers as a derogatory term for weak or gassy beer or for soft drinks.
This theory has appeared in Brewer's Dictionary of Phrase and Fable, but there are problems with it. Codswallop is not recorded until the mid-20th century, rather a long time after Codd's invention and there are no examples of the spelling Codd's wallop which might be expected as an early form. These are not conclusive disproof of the theory - it is conceivable that the term circulated by word of mouth like many slang terms and that the connection with Codd's bottle had been forgotten by the time that the term was written down - but they do shed doubt on the tale.