XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Bruce CantorSubject: Sending via SFTP returns unexpected exception
Author: Bruce Cantor
Date: 31 Aug 2021 01:19 PM

At my company we would like to exchange information about delivery via sftp as a logfile that can be read by our ERP system.
That way the user will be able to see whether an file has been delivered with success or not.

I therefore thought I would create a xquery script that should write a log file with the result of the transmission in XML format.

The log file is created successfully when the transmission goes well. However it is not possible for me to get it write the log file if anything fails.
The method (ddtekjava:com.ivitechnologies.pipeline.ext.net.SFTP.sendString) unexpectedly throws an exception instead of the expected boolean.

I did a test script, attached to this entry, if I change the login so that the credentials are wrong the script fails with:

[DataDirect][XQuery]Error at line 17, column 27. Error in call to extension function "public static boolean com.ivitechnologies.pipeline.ext.net.SFTP.sendString(org.w3c.dom.Element,java.lang.String,java.lang.String) throws java.lang.Throwable": Exception in extension function "com.jcraft.jsch.JSchException: Auth fail"

Making it impossible to create the failed transmission in a log file.

Is it possible to make a script that handles any errors and at least logs that something went wrong, even better what went wrong?

Kind regards

Project zipped

Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.