ClaseClass: /EDGE/CL_FC_XML_SIGN_STEP
TipoType: clase abstracta, no se puede utilizar directamente en la configuración. Solo se puede utilizar como super clase de otra clase donde se implementen una serie de métodos abstractos.
Alcance: esta clase fue implementada siguiendo el patrón template, en el cual se espera que la subclase implemente ciertos métodos, mientras que la super clase va invocando la secuencia de métodos que considera pertinentes para lograr el objetivo de firmar un archivo XML.
Precondiciones:
...
Abstract class, cannot be used directly in the configuration. It can only be used as a superclass of another class where certain abstract methods are implemented.
Scope: This class was implemented following the template pattern, where the subclass is expected to implement certain methods, while the superclass calls the sequence of methods it considers relevant to achieve the objective of signing an XML file.
Preconditions:
- A document class must be configured to contain the unsigned XML. The subclass must implement the method GET_INFO_NOT_SIGNED_XML; el cual debe ser el responsable de retornar la información de archivado para el documetno XML no firmado.
Debe estar configurada una clase documental que pueda contener el XML firmado. Para esto la subclase debe implementar el método , which should be responsible for returning the archiving information for the unsigned XML document. - A document class must be configured to contain the signed XML. The subclass must implement the method GET_INFO_SIGNED_XML; el cual debe ser el responsable de retornar la información de archivado para el documetno XML firmado. Adicionalmente, este método deberá retornar la interfaz y método ABAP que permite hacer la serialización del XML. Según esto, entonces se debe importar la definición del XML, es decir, el XSD, como un WSDL al sistema SAP, de tal forma que se creen los proxies necesarios como si se estuviera publicando un servicio. Esta actividad solo se realiza una vez y debe ser transportada a cada ambiente. La idea es que el Framework ABAP genere una clase y una interfaz con un método, donde al método le entre como único parámetro la definición tal cual del XML. De esta forma se haría uso de herramientas estándar para serializar el XML con base en la estructura ABAP. También servirá para realizar la validación de la estructura del XML firmado.
En caso que el XML no firmado no se encuentre archivado o adjunto al Business Object del proceso de negocio, la super clase, invocará el método GET_NOT_SIGNED_XML; el cual debe ser el responsable de obtener el XML no firmado en bytes (xstring o binary). Éste deberá ser implementado por la subclase. - La subclase debe implementar el método SIGN_XML, el cual es el responsable de firmar el archivo XML que se le pasa por parámetro en formato xstring. Y debe retornar el XML firmado.
Post-condiciones:
- Si sucede alguna excepción en el proceso, está se captura y se propaga al orquestador para que se detenga el proceso.
Si el proceso es exitoso, se archiva el XML firmado con los datos de la clase documental de XML no firmado obtenido anteriormente, which should be responsible for returning the archiving information for the signed XML document. Additionally, this method should return the ABAP interface and method that allows XML serialization. Based on this, the XML definition (XSD) must be imported as a WSDL into the SAP system so that the necessary proxies are created as if publishing a service. This activity is only done once and should be transported to each environment. The idea is for the ABAP Framework to generate a class and an interface with a method, where the XML definition is passed as the only parameter to the method. This way, standard tools can be used to serialize the XML based on the ABAP structure. It will also serve to perform validation of the signed XML structure. - If the unsigned XML is not archived or attached to the Business Object of the business process, the superclass will invoke the method GET_NOT_SIGNED_XML, which should be responsible for obtaining the unsigned XML in bytes (xstring or binary). This method should be implemented by the subclass.
- The subclass must implement the method SIGN_XML, which is responsible for signing the XML file passed as a parameter in xstring format. It should return the signed XML.
Post-conditions:
- If any exception occurs during the process, it is captured and propagated to the orchestrator to stop the process.
- If the process is successful, the signed XML is archived with the data from the document class of the unsigned XML obtained previously.