I am having the problem too. Strangely, it had worked but now it won't connect. Very strange. I think it might be related to a setting change but I honestly can't tell which one I did trying to get internet sharing and SMS outgoing to work on TMOBILE. Anyone have this one solved?
Woops, just after writing the above post, I did something that worked previously. I put the phone right next to the router and it suddenly worked. I can't guarantee that being a couple of inches from the router really did it but that is three times now that it worked that way. Suggests it is the OS or the phone's reception although it has full wifi bars two rooms away now. Crazy.