Skip to content

Service Capsule Consumption

INFORMACIÓN

Purpose: This script demonstrates how to consume a service capsule using PL/SQL, specifically for validating person information.

Introduction

This example shows the implementation of a PL/SQL procedure to consume a service capsule that validates person information. The script uses a specific package to perform the validation and returns a response in JSON format.

Example Script

sql
DECLARE
  PCL_REQUEST CLOB;
  PCL_RESPONSE CLOB;
BEGIN
  PCL_REQUEST := '[{"CV_PROCESO":"0006","CV_TIPO_OPERACION":"0023","CURP":"AAMO750125HDGLRM08","NSS":null,"NOMBRE":"OMAR ESTEBAN","APELLIDO_PATERNO":"ALVARADO","APELLIDO_MATERNO":"MARTINEZ","CV_AFORE":"552"}]';

  PROCNSARD.IRET_PKG_CAPSULAS_JS.PRC_R_VALIDA_PERSON_TTA_JS(
    PCL_REQUEST => PCL_REQUEST,
    PCL_RESPONSE => PCL_RESPONSE
  );
  
  DBMS_OUTPUT.PUT_LINE('PCL_RESPONSE = ' || PCL_RESPONSE);

  --- :PCL_RESPONSE := PCL_RESPONSE;
  --rollback;
END;

Script Description

Variables

  • PCL_REQUEST: CLOB containing the request in JSON format
  • PCL_RESPONSE: CLOB that will receive the service response

Request Parameters

  • CV_PROCESO: "0006" - Process code
  • CV_TIPO_OPERACION: "0023" - Operation type
  • CURP: "AAMO750125HDGLRM08" - Unique Population Registry Key
  • NSS: null - Social Security Number (not provided)
  • NOMBRE: "OMAR ESTEBAN" - Individual's name
  • APELLIDO_PATERNO: "ALVARADO" - Father's surname
  • APELLIDO_MATERNO: "MARTINEZ" - Mother's surname
  • CV_AFORE: "552" - AFORE key

Procedure

  • PROCNSARD.IRET_PKG_CAPSULAS_JS.PRC_R_VALIDA_PERSON_TTA_JS: Procedure that validates person information

Execution Considerations

ADVERTENCIA

Important warnings:

  • Ensure you have the necessary permissions to execute the package
  • Verify that the PROCNSARD schema is available in your environment
  • The procedure may require specific environment configuration
  • Consider error handling in production environments

Requirements

  • Access to the PROCNSARD schema
  • Permissions to execute the IRET_PKG_CAPSULAS_JS package
  • Proper session parameter configuration

Expected Results

  • PCL_RESPONSE: Will contain the service response in JSON format
  • The response will include validation results and any associated messages

Usage in Different Environments

Development

  • Use test data to validate functionality
  • Verify connection to the service package

Production

  • Implement proper error handling
  • Consider audit logging
  • Ensure schema and package availability

CONSEJO

Tip: Adapt the parameters according to your specific needs and ensure testing in controlled environments before using in production.

Documentación de Procesos