Can't access imessage and facetime
So my iphone has had immessage and face time and all of a sudden this week I'm not receiving texts. But I can send texts. That's when I noticed that for some reason my phone did not have access to Imessage and facetime anymore. However when I try to log in I keep getting a network error even though I'm connected to working wifi. Why is my phone doing this all of a sudden? Also I'm using the latest IOS settings, and I've tried restoring my phone to its factory settings and none of this is working.
iPhone 4S, iOS 8.4