Example #1
0
 private void ValidateResponse(SwitchvoxResponse response)
 {
     if (response.GetElements("errors").Any())
         throw new SwitchvoxRequestException(response.GetAttribute("error", "message"));
 }
Example #2
0
        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;
        }