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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
- XQuery Help and Discussion (2017)
-> + Issue with Processing Instruct... (2)
-> + problem converting json to XML... (2)
-> + Problem base64 decoding string... (3)
-> + Problems posting multipart for... (5)
-> + trouble with download of price... (2)
-> + Problem with http-post not bei... (3)
-> + path problem, xps_file:writeAl... (9)
-> + Xquery update support? (2)
-> + problem with Stylus studio try... (5)
-> + adding dtd reference to xml ou... (4)
-> + xquery escaping ambarsand when... (3)
-> + Whitespace problem when return... (5)
-> + Problem with namespace prefix ... (5)
-> - Sending via SFTP returns unexp... (1)
-> + Query and Sftp clent (4)
-> + xquery and try - catch (3)
-> + Query + ddtek:http-post optio... (5)
-> + Example files referenced in do... (3)
-> + Automatic Error Detection and ... (3)
-> + Working with result of ddtek:h... (2)
-- [1-20] [21-40] [41-60] Next
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
Topic  
Postnext
(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
Hi

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:
xmlpipelineserver.jar
json-20090211.jar
commons-net-3.6.jar
jsch-0.1.53.jar

Postnext
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

Posttop
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.

   
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!  
go

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.