TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/17Franco/CulturarteWeb/llms.txt
Use this file to discover all available pages before exploring further.
/GenerarConstancia servlet generates and streams a PDF collaboration certificate (known as a Constancia de Colaboración) directly to the client’s browser. It accepts the numeric ID of a collaboration, delegates PDF generation to the ControllerWS SOAP service via portU.generarPDF(idColaboracion), decodes the Base64-encoded result, and writes the raw bytes to the HTTP response as an inline PDF attachment. The SOAP endpoint is resolved at runtime from config.properties.
POST /GenerarConstancia
Generates a PDF certificate for the specified collaboration and streams it to the browser. OnlydoPost is implemented — GET requests to this endpoint will receive a 405 Method Not Allowed response.
Request parameters
The numeric ID of the collaboration for which the certificate should be generated. Internally parsed with
Long.parseLong(request.getParameter("idColaboracion")) and passed directly to portU.generarPDF(idColaboracion) on the SOAP service. Must correspond to a collaboration that has already been paid.Behavior
- Reads
WEB_SERVICES_HOST,WEB_SERVICES_PORT, andSERVICEfromconfig.propertiesto build the WSDL URL dynamically. - Instantiates
ControllerWS_Serviceand obtainsportUviaservice.getControllerWSPort(). - Parses
idColaboracionfrom the request as aLong. - Calls
portU.generarPDF(idColaboracion), which returns a Base64-encoded string representation of the PDF. - If the returned string is
nullor empty, responds with HTTP500and the message"Error al generar el PDF.". - Decodes the Base64 string with
Base64.getDecoder().decode(pdfFile)to obtain raw PDF bytes. - Sets the following HTTP response headers:
| Header | Value |
|---|---|
Content-Type | application/pdf |
Content-Disposition | inline; filename = documento.pdf |
Content-Length | Length of the decoded PDF byte array |
- Writes the PDF bytes to
response.getOutputStream()and flushes the stream. - On any unhandled exception, responds with HTTP
500and the message"Ocurrió un error al generar la constancia de pago.".
Example form POST
The certificate is typically requested from the preview modal embedded inColaboraciones.jsp or directly from Constancia.jsp:
Response on success
Content-Disposition is set to inline.
Response on error
Only paid collaborations can generate a certificate. A collaboration is considered paid when its
DtoPago record is non-null (i.e., acreditarColaboracion has been successfully called via /PagarColaboracion). Attempting to generate a certificate for an unpaid collaboration will result in an error from the SOAP service, which the servlet catches and surfaces as an HTTP 500 response.