Personally, I don't know how to 'dissolve' wax. I say that you ought to remove the trap-and-'S' completely and replace it. By melting the wax using hot water will only push the wax a little further down the pipe where it will solidify just beyond 'S'. Then, you'll have a clogging problem worst than you started with! Not knowing what other obstacles you might have in your sewer system (and who wants to know), the melted then re-hardened wax, may be the final straw in creating a clog that may require a plumber. (He'd love to hear your story.)
When you remove the S-pipe, bring it and the pipe-nuts (BOTH) with you to the store. Spend a few extra pennies and get the non-plastic piping (and and 'nuts' need replacing). Do NOT re-use the old pipe washers from the previous pipe! (Unless you're a masochist and willing to take your chances of disassembling and assembling the piping more than you have to). Now, BEFORE you install the new piping, you can heat the part of the pipe that comes straight down from the sink by, first, putting a bucket underneath it, and then pouring boiled (not tap) hot water down it to loosen the wax. I'm afraid if you use a torch or anything else, you'll heat it up way too much and way too fast that you'll damage the pipe AND/OR any rubber washers and gaskets holding the sink drain in place. Also, before you put things back together, check the pipe coming out of the floor too with a flashlight to see if there's any wax in it. If so, well, scrape out what you can and leave the rest! Over time, it should work its way out. Clean the 'ends' of the sink pipe and the floor pipe and away you go.