0

I'm using DataPower to connect with SFTP server and write XML file contains content of request to server as the following:

<xsl:variable name="targetUrl" select="'sftp://username:password@host:22/Test.xml'"/>
<xsl:variable name="response">
   <dp:url-open target="{$targetUrl}" response="responsecode"><xsl:copy-of select="current()"/></dp:url-open>
</xsl:variable>

I got following error:

 url-open: response code 3
url-open: Remote error on url 'sftp://host:22/Test.xml'

I search on this error, I find the following URL. Error Code 3 is meaning Resource not found (user may retry with different opener).

Details: If I used local SFTP server, the above code is working fine, Also If I used FileZilla to connect with remote SFTP server, it's working fine ?

So, It's weird the issue on my code .. or on Remote SFTP Server !!

What's the meaning of the above error .. how can I fix this error ??

Mohamed Yakout
  • 2,868
  • 1
  • 25
  • 45

2 Answers2

0

I seem to remember at some previous job that I hit this issue, and it turned out that for some SFTP servers, coming in via an sftp URL required you to give a full path even if that user has a default directory. Try some variation of:

sftp://username:password@host:22/full/path/to/file/Test.xml
bjimba
  • 928
  • 8
  • 13
0

Try using:

<xsl:variable name="targetUrl" select="'sftp://username:password@host:22/~/Test.xml'"/>
Anders
  • 3,198
  • 1
  • 20
  • 43