Exemplo n.º 1
0
        private HttpsWebRequestsFunction maquetarSoapFactura(HttpsWebRequestsFunction httpwebrequestFunction)
        {
            string estado = string.Empty;

            httpwebrequestFunction._companyId = "860504882";
            httpwebrequestFunction._accountid = "860504882_01";
            httpwebrequestFunction._Username  = "******";
            httpwebrequestFunction._userId    = "UsernameToken-1";
            EncodingFacturacionElectronica coding = new EncodingFacturacionElectronica();

            httpwebrequestFunction._Password = coding.SHA256Encrypt("F935Cjm9262@");
            //httpwebrequestFunction._Password = coding.SHA256Encrypt("TranserFac@1");
            httpwebrequestFunction._HttpWebRequestFunction = "DownloadRequest";
            httpwebrequestFunction._create = coding.getCreate();
            httpwebrequestFunction._nonce  = coding.getNonce(httpwebrequestFunction._FileName);
            string documentType = "FE";

            if (httpwebrequestFunction._FileName.Contains("NC"))
            {
                documentType = "NC";
            }
            else
            {
                if (httpwebrequestFunction._FileName.Contains("ND"))
                {
                    documentType = "ND";
                }
            }
            switch (documentType)
            {
            case "NC":
            {
                httpwebrequestFunction._documentType = "NC";
                break;
            }

            case "ND":
            {
                httpwebrequestFunction._documentType = "ND";
                break;
            }

            case "FV":
            {
                httpwebrequestFunction._documentType = "FV";
                break;
            }

            default:
            {
                httpwebrequestFunction._documentType = "FE";
                break;
            }
            }
            httpwebrequestFunction._documentPrefix = httpwebrequestFunction._FileName.Substring(0, 4);
            httpwebrequestFunction._documentNumber = httpwebrequestFunction._FileName;
            httpwebrequestFunction._resourceType   = "PDF";
            httpWebSend xmlsend = new httpWebSend();

            httpwebrequestFunction._soapEnviado = xmlsend.getSoapEnvio(httpwebrequestFunction);

            //httpSendXmlDocument httpsSendXmlDocument = new httpSendXmlDocument(vgl);


            ////HttpWebResponseFunction httpWebResponseFunction = new HttpWebResponseFunction("Upload");

            //httpwebrequestFunction._httpWebResponseXml = httpsSendXmlDocument.httpsSendXmlDocument(httpwebrequestFunction._soapEnviado);
            //httpwebrequestFunction._RequestXmlf = httpsSendXmlDocument._vgp.httpwebrequestFunction._RequestXmlf;
            //httpwebrequestFunction._soapRecibido = httpwebrequestFunction._httpWebResponseXml;
            ////_vgp.informaciondian.INDI_XMLREC_BL = vgl.httpwebrequestFunction._soapRecibido;
            //httpWebRequestFunctionDownloadXML httpWebRequestFunctionDownloadXml = new httpWebRequestFunctionDownloadXML(_vgp);
            //httpWebRequestFunctionDownloadXml.httpwebRequestFunctionDownloadxml(vgl.httpwebrequestFunction._soapRecibido);
            return(httpwebrequestFunction);
        }
Exemplo n.º 2
0
        private HttpsWebRequestsFunction maquetarSoapCufe(HttpsWebRequestsFunction httpwebrequestFunction)
        {
            string estado = string.Empty;

            httpwebrequestFunction._companyId = "860504882";
            httpwebrequestFunction._accountid = "860504882_01";
            httpwebrequestFunction._Username  = "******";
            httpwebrequestFunction._userId    = "UsernameToken-1";
            EncodingFacturacionElectronica coding = new EncodingFacturacionElectronica();

            httpwebrequestFunction._Password = coding.SHA256Encrypt("F935Cjm9262@");
            //httpwebrequestFunction._Password = coding.SHA256Encrypt("TranserFac@1");
            httpwebrequestFunction._HttpWebRequestFunction = "DownloadRequest";
            httpwebrequestFunction._create = coding.getCreate();
            httpwebrequestFunction._nonce  = coding.getNonce(httpwebrequestFunction._FileName);
            string documentType = "FE";

            if (httpwebrequestFunction._FileName.Contains("NC"))
            {
                documentType = "NC";
            }
            else
            {
                if (httpwebrequestFunction._FileName.Contains("ND"))
                {
                    documentType = "ND";
                }
            }
            switch (documentType)
            {
            case "NC":
            {
                httpwebrequestFunction._documentType = "NC";
                break;
            }

            case "ND":
            {
                httpwebrequestFunction._documentType = "ND";
                break;
            }

            case "FV":
            {
                httpwebrequestFunction._documentType = "FV";
                break;
            }

            default:
            {
                httpwebrequestFunction._documentType = "FE";
                break;
            }
            }
            httpwebrequestFunction._documentPrefix = httpwebrequestFunction._FileName.Substring(0, 4);
            httpwebrequestFunction._documentNumber = httpwebrequestFunction._FileName;
            httpwebrequestFunction._resourceType   = "SIGNED_XML";
            httpWebSend xmlsend = new httpWebSend();

            httpwebrequestFunction._soapEnviado = xmlsend.getSoapEnvio(httpwebrequestFunction);
            return(httpwebrequestFunction);
        }