IPhone won't turn off and won't dock properly?

I have an iPhone 4S that I got justa little over a year ago. I got a small sony dock for Christmas, and my phone would ot play music through it, but all the other devices I tried worked fine. I got an iHome id50 because it said it would work with the iPhone 4S, it works perfect on blutooth, sometimes when docked, and never does the auto-adjust time feature. I tried many other iPhones and they all worked, Including another iPhone 4S. I have the latest software on my phone and when docked it always shows that is is chargingso I know it docked correctly. Lately I have been getting an error saying that the dock is compatable with my phone, but if I take it off and put it back on it seems like the message never come back twice. My other Problem is that I can't turn my phone off. When I hold the power button, I get the slider to turn it off but after I turn my phone off it just starts up again without any buttons being pushed. I tried a hard reset and a software update but neither fixed the problem. Does anyone have answers to any of my questions?

Well, you've successfully tried other iPhones, so you know it's not your docking unit. So it's most likely a hardware or software failure on your iPhone.
So if your phone is just a little over a year old, you really should go back to the retailer and make them do the repair. It seems to me like you've done everything you can do to fix it yourself, and any iPhone can be difficult to fix by oneself whenever something gets tricky.