/
Step - Digitally sign an XML.
Step - Digitally sign an XML.
Class: /EDGE/CL_FC_XML_SIGN_STEP
Type: 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, 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, 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.
Avvale 2024