Debuggen von serverseitigen Python Scripts
Die meisten der Debugging-Funktionen - mit Ausnahme von Server-spezifischen Callbacks - können in einem Standard-Pyhton-Interpreter oder einer (virtuellen) Umgebung verwendet werden, nachdem das RaptorXML Server-Modul mittels pip installiert wurde:
pip install –upgrade "/path/to/RaptorXML/application-folder/bin/raptorxml-version-cp37-cp37m-winversion.whl"
After installing the wheel, you should be able to use any Python IDE to debug a script. You could try to extract the main functionality into a separate function which takes an instance object. This can then be called (i) by the RaptorXML Server callbacks, or (ii) by directly executing the script with a Python interpreter.
from altova_api.v2 import xml, xsd, xbrl
def main(instance):
# Here goes the application specific logic
# Main entry point, will be called by RaptorXML after the XML instance validation job has finished
def on_xsi_finished(job, instance):
# instance object will be None if XML Schema validation was not successful
if instance:
main(instance)
# Main entry point, will be called by RaptorXML after the XBRL instance validation job has finished
def on_xbrl_finished(job, instance):
# instance object will be None if XBRL 2.1 validation was not successful
if instance:
main(instance)
if __name__ == ‘__main__’:
# parse arguments and create an instance
instance = …
main(instance)