Skip to Content

How can I save content(set of .xml's) of .zip file downloaded from FTP by B1if

Aug 23, 2017 at 11:17 AM


avatar image


I've create integration scenario which downloads .zip-archive from FTP-server. 'FTP In' atom generates message, which contains whole the xml's structure. Next I want to save all zipped xmls.But I cannot extract it from 'FTP In' result message using xslt-atom(both outside and inside 'for-each'). It returns void. XPath to trying parce message: <xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom6']/vpf:ftp.file/bfa:io/bfa:zipentry">

<Msg xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:b1e="" xmlns:b1im="" xmlns:sim="" xmlns:jdbc="" xmlns:utils2="" xmlns:bfa="" xmlns:vpf="" xmlns:uplt="" xmlns:b1ie="" xmlns:js="" xmlns:xci="" xmlns="">
	<Payload delimiter="" protocol="SFTP" conmode="PASV" destination="" mode="getFile" password="" userName="" ftpPort="" ftpServer="" filePattern="/Export/" deleted="false" calltype="FTPP" status="ok" statusNo="0" id="atom6" Role="C">
		<bfa:io pltype="zip">
		  <bfa:zipentry pltype="xml" properties="" alias="" docname="" group="" dataset="" entryname="DebtTypes.xml">
			<ROOT xmlns="">
				<DebtType Cust_Id="400" DTLM="20170309 17:17"/>
				<DebtType Cust_Id="400" DTLM="20060424 12:23"/>
				<DebtType Cust_Id="400" DTLM="20060420 19:30"/>
				<DebtType Cust_Id="400" DTLM="20161214 11:06"/>
				<DebtType Cust_Id="400" DTLM="20090323 13:29"/>
				<DebtType Cust_Id="400" DTLM="20161214 11:06"/>
				<DebtType Cust_Id="400" DTLM="20150519 13:36"/>
				<DebtType Cust_Id="400" DTLM="20170309 17:17"/>
		  <bfa:zipentry pltype="xml" properties="" alias="" docname="" group="" dataset="" entryname="Merchandisers.xml">
			<ROOT xmlns="">
				<Merchandiser Cust_Id="400" DeviceSerialNumber="A-61976B231Bc0aEf226b85"/>
		  <bfa:zipentry pltype="xml" properties="" entryname="Operations.xml">
			<ROOT xmlns="">
				<Operation Cust_Id="400" DTLM="20140911 10:30" ExternalCode="prepayment"/>
				<Operation Cust_Id="400" DTLM="20140910 09:25" ExternalCode="cashimmediately"/>
				<Operation Cust_Id="400" DTLM="20140910 14:52" ExternalCode="wire"/>
				<Operation Cust_Id="400" DTLM="20140910 13:44" ExternalCode="cash"/>
		<!--trying parse message above with this loop:
		<xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@id='atom6']/vpf:ftp.file/bfa:io/bfa:zipentry">
				<xsl:attribute name="entryname"><xsl:value-of select="./@entryname"></xsl:value-of></xsl:attribute>
					<xsl:value-of select="/*"/> (also tried "/ROOT", "/ROOT/*" and so on)
		got following result
	<Payload id="atom10" Role="X" ts="2017/08/23 12:26:36">
	  <files xmlns="">
		<file entryname="DebtTypes.xml"/>
		<file entryname="Merchandisers.xml"/>
		<file entryname="Operations.xml"/>

Thanks in advance

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Gabriela Perez Nov 03, 2017 at 02:35 PM


You can save your xml files using a FileSystem in your SLD, and in your processing use an 'Upload File to file system' atom. To do it for each file in your results, you will need to do this inside a foreach proccesing that goes throws your files entries in the ftp result atom. You can check in the Integration Framework -> Help -> Documents menu how to use the atoms you need.

Hope it helps,

Best regards,

10 |10000 characters needed characters left characters exceeded