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)
        {
            IgnoreSSLCertificateProblems();

            var request = CreateHttpRequest(xmlRequestBytes);

            SendRequest(request, xmlRequestBytes);

            var response = new SwitchvoxResponse(GetResponse(request));

            ValidateResponse(response);

            return(response);
        }