private void ValidateResponse(SwitchvoxResponse response) { if (response.GetElements("errors").Any()) { throw new SwitchvoxRequestException(response.GetAttribute("error", "message")); } }
private SwitchvoxResponse ExecuteRequest(byte[] xmlRequestBytes) { IgnoreSSLCertificateProblems(); var request = CreateHttpRequest(xmlRequestBytes); SendRequest(request, xmlRequestBytes); var response = new SwitchvoxResponse(GetResponse(request)); ValidateResponse(response); return(response); }