I found the answer, It was because the third party webservice we were calling did not support TLS 1.0 they supported 1.1 and 1.2. So I had to change the security protocol.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;