Rubber cement will offer a permanent flexible bond; I've used it successfully for the same purpose.
Spread a good amount on both surfaces and allow it to dry. Then, carefully line up the sole to the shoe and press firmly. Get the right alignment, though. Once it's together, you'll never pull it back apart. No re-do's.