FD=CREATEOBJECT("FacturaElectronica.Fe")
*FD.firmado("C:\CPESUNAT\DataCPE\10048042096-01-FF11-1.xml","C:\CPESUNAT\firma\usr0061.p12","usr0061")
fD.firmado("C:\CPESUNAT\DataCPE\10048042096-01-FF11-1.xml","C:\CPESUNAT\firma\certificado.cer","SOPF0197")
****
Alguien me podrá ayudar por favor
lcRuc_Cliente = PRuc
lcUser_Sol = PUser
lcPswd_Sol = PPswd
lcUserName = lcRuc_Cliente + lcUser_Sol
DO CASE
CASE CFProv.proceso="B"
lcUser_Sol = "MODDATOS"
lcPswd_Sol = "moddatos"
lcURL = "https://e-beta.sunat.gob.pe/ol-ti-itcpfegem-beta/billService"
CASE CFProv.proceso="H"
lcURL = "https://www.sunat.gob.pe/ol-ti-itcpgem-sqa/billService"
CASE CFProv.proceso="P"
lcURL = "https://e-factura.sunat.gob.pe/ol-ti-itcpfegem/billService"
ENDCASE
strSoapAction = "wsdl"
lcEnvioXML=""
TEXT TO lcEnvioXML TEXTMERGE NOSHOW ADDITIVE
<soapenv:Envelope xmlns:ser="http://service.sunat.gob.pe" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<soapenv:Header>
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username><<lcUserName>></wsse:Username>
<wsse:Password><<lcpswd_sol>></wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<ser:sendBill>
<fileName><<lmarchivo1>></fileName>
<contentFile><<lmarchivo2>></contentFile>
</ser:sendBill>
</soapenv:Body>
</soapenv:Envelope>
ENDTEXT
loXmlHttp = CREATEOBJECT("MSXML2.ServerXMLHTTP.6.0")
oxmlbody = CREATEOBJECT('MSXML2.DOMDocument.6.0')
IF .NOT. (oxmlbody.loadxml(lcEnvioXML))
oresp.mensaje = "No se cargo XML: "+oxmlbody.parseerror.reason
RETURN .F.
ENDIF
loXmlHttp.open('POST', lcurl, .F.)
loXmlHttp.setrequestheader("Content-Type", "text/xml")
loXmlHttp.setrequestheader("Content-Type", "text/xml;charset=ISO-8859-1")
loXmlHttp.setrequestheader("Content-Length", LEN(lcEnvioXML))
loXmlHttp.setrequestheader("SOAPAction", "sendBill")
loXmlHttp.setoption(2, 13056)
loXmlHttp.send(oxmlbody.documentelement.xml)
IF (loXmlHttp.status<>200)
ELSE
loxmlresp = CREATEOBJECT("MSXML2.DOMDocument.6.0")
loxmlresp.loadxml(loXmlHttp.responsetext)
ccontenidorptazip = STREXTRACT(loXmlHttp.responsetext, "<applicationResponse>", "</applicationResponse>")
STRTOFILE(STRCONV(rptazip, 14), _ruta+"R-"+_archivo+".zip")
MESSAGEBOX("OK")
ENDIF
| 201600639639130 | FF11-1 | 18/11/2016 06:20 | No aprobado | 2325 |