1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| PROCEDURE New_Method(sNombreArchivo is string,bufContenidoArchivo is Buffer,sdirectory is string)
fuentededato is sendBill
fuentededato.fileName=sNombreArchivo
fuentededato.contentFile=bufContenidoArchivo
hdr is string
hdr="<SOAP-ENV:Header>"
hdr+="<wsse:Security "
hdr+="xmlns:wsse=""http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"">"
hdr+="<wsse:UsernameToken>"
hdr+="<wsse:Username>99999999999moddatos</wsse:Username>"
hdr+="<wsse:Password>moddatos</wsse:Password>"
hdr+="</wsse:UsernameToken>"
hdr+="</wsse:Security>"
hdr+="</SOAP-ENV:Header>"
Xmlstring is string=SOAPPrepare(billService.sendBill,fuentededato)
Xmlstring=Replace(Xmlstring,"<SOAP-ENV:Header/>",hdr)
bRespuesta is boolean
bRespuesta =SOAPRunXML("https://www.sunat.gob.pe/ol-ti-itcpgem-beta/billService?wsdl", Xmlstring)
IF (bRespuesta = False)
WL.Trace(SOAPError(SOAPErrCode))
END
sRetorno2 is string=SOAPGetResult(SOAPHTTPResult)
sRetorno3 is string=SOAPGetResult(SOAPXMLResult)
l_ContenidoRepuestaSOAP is string=XMLExtraitChaine(
sRetorno3,"applicationResponse",1)
l_ContenidoCDR is string=Décrypte(
l_ContenidoRepuestaSOAP,"",compresseAucun+crypteAucun, encodeBASE64)
fSaveBuffer(
sdirectory+"\R-"+ExtractString(sNombreArchivo,1,".")+".zip",
l_ContenidoCDR) |
Partager