The following is an annotated version of the fairy tale. I recommend reading the entire story before exploring the annotations, especially if you have not read the tale recently.
THERE was once a cobbler who one day was so tired of cobbling that he said: "Now I will go and seek my fortune." He bought a little cheese and put it on the table. It got full of flies, and he took an old shoe, and hit the cheese and killed all the flies. He afterward counted them, and five hundred were killed, and four hundred wounded. He then girded on a sword, and put on a cocked hat, and went to the court, and said to the king: "I am the chief warrior of the flies. Four hundred I have killed, and five hundred I have wounded." The king answered: "Since you are a warrior, you will be brave enough to climb that mountain there, where there are two magicians, and kill them. If you kill them, you shall marry my daughter." Then he gave him a white flag to wave when he had killed them. "And sound the trumpet, you will put his head in a bag, both the heads, to show me." The cobbler then departed, and found a house, which was an inn, and the inn- keeper and his wife were none other than the magician and his wife. He asked for lodging and food, and all he needed. Afterward he went to his room; but before going to bed, he looked up at the ceiling. There he saw a great stone over the bed. Instead of getting into bed, he got into a corner. When a certain hour struck, the magicians let the stone drop and it crushed the whole bed. The next morning the cobbler went down and said that he could not sleep for the noise. They told him they would change his room. The same thing happened the next night, and in the morning they told him they would give him another room. When it was a certain hour, the husband and wife went to the forest to cut a bundle of fagots. Then the magician went home; and the cobbler, who had made ready a sickle, said: "Wait until I help you to take the bundle off your back." Then he gave the magician a blow with the sickle and cut off his head. He did the same thing when the magician's wife returned. Then he unfurled his flag, and sounded his trumpet, and the band went out to meet him. After he had arrived at the court, the king said to him: "Now that you have killed the two magicians, you shall marry my daughter." But the cobbler had got so used to drawing the thread that he did so in his sleep, and kept hitting his wife, so that she could not rest. Then the king gave him a great deal of money and sent him home.
Crane, Thomas Frederick. Italian Popular Tales. Boston: Houghton Mifflin Company, 1885.
Amazon.com: Buy the book in hardcover orpaperback.