Hi, I have this problem and it occured when I was in the middle of using my 3ds XL.
It was fine and everything was connected (did some pokemon trades sucessfully) but then when I exit the game to add someone's FC it wouldn't let me anymore because it states am not 'online'. Since then it wouldn't let me go online in my game even though the Interenet test connection was sucessful. I've retried and on/off the 3ds a couple of times but it's still not working.
Basically, It says I am connected to the internet, but it won't let me go online for some reason.
Could anyone help out with this? [Most likely not able to call nintendo]