My tablet does this too, it shows perfect WiFi connection but apps don't connect. I read in another forum that the date/time gets reset somehow, nobody can figure out how or why and Samsung is oblivious, but...
Go in and set your date/time to the correct one and voila, it connects! It will reset again eventually and you'll have to go in and do it again but it works.
I was shocked to see when I read that, that the setting was in fact at January 2012, but I did it and it worked. I also read about seeing the severity from the WPA to A..something, (AEP?) I'm not really familiar with security settings, and I couldn't find where to do it, but many people said that it corrected the problem for them. Lastly, the KIES has also worked for some, I guess turning it on with WiFi makes it connect. I have only tried the date/time setting, but they may all be connected somehow.
trying to obtain IP address
? The settings of your AP might have gotten messed up. If that's the case, long-tap the AP entry in that list, chose "remove". Switch WiFi off and on again, let it scan for available networks, and try re-adding yours. If there are any errors displayed, please edit your question and include the details.