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