public static ProcessFormService.ProcessFormService getProcessFormService() { try { if (!string.IsNullOrEmpty(serverLiveCycle) && !string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password) && !string.IsNullOrEmpty(processForm) ) { //Creo il servizio processForm ProcessFormService.ProcessFormService serviceProcessForm = new ProcessFormService.ProcessFormService(); serviceProcessForm.Timeout = System.Threading.Timeout.Infinite; //Imposto l'URL dei web services //processFormPdf.Url = serverLiveCycle + "ProcessForm?wsdl&blob=base64"; serviceProcessForm.Url = processForm + "&blob=base64"; //Autenticazione serviceProcessForm.Credentials = new System.Net.NetworkCredential(username, password); return(serviceProcessForm); } else { return(null); } } catch (Exception e) { logger.Error("Errore in LiveCycle - LCServicesManager - metodo: getProcessFormService()", e); return(null); } }
public static DocsPaVO.LiveCycle.ProcessFormOutput processFormPdf(DocsPaVO.utente.InfoUtente infoUtente, DocsPaVO.LiveCycle.ProcessFormInput processFormInput) { try { //Istanzio il servizio ProcessFormService.ProcessFormService processFormPdf = LCServicesManager.getProcessFormService(); DocsPaVO.LiveCycle.ProcessFormOutput processFormOutput = new DocsPaVO.LiveCycle.ProcessFormOutput(); if (processFormPdf != null) { //Popolo il binaryData del BLOB ProcessFormService.BLOB inDoc = new ProcessFormService.BLOB(); inDoc.binaryData = processFormInput.fileDocumentoInput.content; //Invoco il processo per il file pdf ProcessFormService.XML xmlFile = null; //ProcessFormService.PDFSignatureVerificationResult resultSignature = null; //resultSignature = processFormPdf.invoke(inDoc, out xmlFile); bool signature = processFormPdf.invoke(inDoc, out xmlFile); processFormPdf.Dispose(); //Processo l'xml if (xmlFile != null && xmlFile.document != null) { //Leggo l'xml restituito XmlDocument xmlDoc = new XmlDocument(); xmlDoc.LoadXml(xmlFile.document.ToString()); //Processo la tipologia di documento DocumentiManager.compilaTipologiaDocumento(infoUtente, processFormInput, xmlDoc, ref processFormOutput); //Processo i campi standard del documento DocumentiManager.compilaCampiDocumento(infoUtente, processFormInput, xmlDoc, ref processFormOutput); /* * //Processo i campi nascosti della form * DocumentiManager.compilaCampiNascosti(infoUtente, xmlDoc, ref processFormOutput); */ } //Verifico se il documento è firmato o meno //if (resultSignature != null && resultSignature.signatureStatus == ProcessFormService.PDFSignatureStatus.VALIDANDUNMODIFIED) // DocumentiManager.setFirmaDocumento(infoUtente, resultSignature, ref processFormOutput); if (signature) { DocumentiManager.setFirmaDocumento(infoUtente, ref processFormOutput); } } else { return(null); } return(processFormOutput); } catch (Exception e) { logger.Error("Errore in LiveCycle - LCServices - metodo: processFormPdf()", e); return(null); } }