Пример #1
0
        internal override AcceptRejectResponse AcceptRejectRequest(string pfx, string rfc, string password, AceptacionRechazoItem[] uuid)
        {
            AcceptRejectResponseHandler handler = new AcceptRejectResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                var headers = GetHeaders();
                var proxy   = RequestHelper.ProxySettings(Proxy, ProxyPort);
                var content = RequestAcceptReject(pfx, rfc, password, uuid);
                return(handler.GetPostResponse(Url,
                                               "acceptreject/pfx", headers, content, proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
Пример #2
0
        internal override AcceptRejectResponse AcceptRejectRequest(byte[] xmlCancelation, EnumAcceptReject enumAcceptReject)
        {
            AcceptRejectResponseHandler handler = new AcceptRejectResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                var headers = GetHeaders();
                var proxy   = RequestHelper.ProxySettings(Proxy, ProxyPort);
                var content = RequestAcceptReject(xmlCancelation, enumAcceptReject);
                return(handler.GetPostResponse(Url,
                                               "acceptreject/xml", headers, content, proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }
Пример #3
0
        internal override AcceptRejectResponse AcceptRejectRequest(string rfc, string uuid, EnumAcceptReject enumAcceptReject)
        {
            AcceptRejectResponseHandler handler = new AcceptRejectResponseHandler();

            try
            {
                new Validation(Url, User, Password, Token).ValidateHeaderParameters();
                HttpWebRequest request = RequestAcceptReject(rfc, uuid, enumAcceptReject);
                request.ContentType   = "application/json";
                request.ContentLength = 0;
                request.Method        = WebRequestMethods.Http.Post;
                var headers = GetHeaders();
                var proxy   = RequestHelper.ProxySettings(Proxy, ProxyPort);
                return(handler.GetPostResponse(Url, headers, $"acceptreject/{rfc}/{uuid}/{enumAcceptReject.ToString()}", proxy));
            }
            catch (Exception e)
            {
                return(handler.HandleException(e));
            }
        }