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
(Deleted User) Subject: Problems with FTP upload via XQuery
Author: (Deleted User)
Date: 05 Jun 2020 05:54 PM
Originally Posted: 04 Jun 2020 11:40 AM

I need to prefix outgoing files from my XML pipleline with a static value: 'S8000092.' and as far as I can see this is some I cannot achieve via the Pipeline Output node.
Am I right? Or is there an easier way to append a prefix to an outgoing file that needs to be placed on a FTP server?

So I am trying to make a xquery script that does the trick, but it is giving me some trouble.

I copied the sample script from the XML Pipeline server guide, added the needed jars.
The script is returning this error:

javax.xml.xquery.XQQueryException: [DataDirect][XQuery]Error at line 10, column 1. Error in call to extension function "public static boolean com.ivitechnologies.pipeline.ext.net.SFTP.sendFile(org.w3c.dom.Element,java.lang.String,java.lang.String) throws java.lang.Throwable": Exception in extension function "10: "
at com.ddtek.xquery.xqj.Util.createXQQueryException(Util.java:341)
at com.ddtek.xquery.xqj.Util.createXQQueryFromXPathException(Util.java:415)
at com.ddtek.xquery.xqj.Util.createXQException(Util.java:237)
at com.ddtek.xquery.xqj.DDXQAbstractSequence.writeSequence(DDXQAbstractSequence.java:466)

Can anyone tell me what it supposed to mean? The 10: refers to line 10 I think, this is where the cursor ends up.

The script:

declare namespace xps_sftp = "ddtekjava:com.ivitechnologies.pipeline.ext.net.SFTP";
declare function xps_sftp:sendFile($element as element(), $uriLocalFile as xs:string, $targetPath as xs:string) as xs:boolean external;
declare variable $sftp := <root host='ftp.eetgroup.com' port='22' path='/' user='<...>' password='<...>'/>
xps_sftp:sendFile(sftp,resolve-uri("../testdata/ORDERS_881141.xml", fn:static-base-uri()),"ORDERS_881141.xml")

added jars to project:

Ivan PedruzziSubject: Problems with FTP upload via XQuery
Author: Ivan Pedruzzi
Date: 05 Jun 2020 05:52 PM
After an offline conversation we discovered that the SFTP user does not have write access to folder EET_Outbox.

XML Pipeline Server SFTP client can connect successfully and upload file on different folders

Ivan Pedruzzi
Stylus Studio Team

Jennie HustSubject: Problems with FTP upload via XQuery
Author: Jennie Hust
Date: 16 Dec 2022 06:41 AM
EXPath File Transfer XQuery Extension ModuleEdit. This module does both FTP, SFTP (using the SSH protocol) using a standardized and consistent format. A zipfile is a binary file. That's probably why uploading it as .xml corrupts the file. Try specifying FTP_BINARY instead of FTP_ASCII.

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.