web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Receive Files from FTP - the remote server returned an error: (425)

(0) ShareShare
ReportReport
Posted on by 550

Hello,

we have a Problem of receiving files from an FTP - Server within our D365 FO UAT (Tier 2) Environmet.

On Tire1 DevBox it works fine.

When we try to receive Files from FTP - Server, we got the following exception:

System.Net.WebException: The remote server returned an error: (425) Can't open data connection. at System.Net.FtpWebRequest.SyncRequestCallback(Object obj) at System.Net.CommandStream.Dispose(Boolean disposing) at System.IO.Stream.Close() at System.Net.ConnectionPool.Destroy(PooledStream pooledStream) at System.Net.ConnectionPool.PutConnection(PooledStream pooledStream, Object owningObject, Int32 creationTimeout, Boolean canReuse) at System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage) at System.Net.FtpWebRequest.GetResponse() at Dynamics.AX.Application.ANXEdiTransmissionPathLogic_FTPIntern.`receiveFile(String _remoteFileName) in xppSource://Source/CargoSuiteTMS\AxClass_ANXEdiTransmissionPathLogic_FTPIntern.xpp:line 285 at Dynamics.AX.Application.ANXEdiTransmissionPathLogic_FTPIntern.receiveFile(String _remoteFileName) at Dynamics.AX.Application.ANXEdiTransmissionReceiveFile.`run() in xppSource://Source/CargoSuiteTMS\AxClass_ANXEdiTransmissionReceiveFile.xpp:line 129

The Code at this point is:

Filename ret, localFileName;
str remoteLocation;
FileIOPermission fileIOPermission;
InteropPermission interopPerm;
Set permissionSet;
System.Object dummyObject;
System.Net.FtpWebRequest ftpRequest;
System.Net.FtpWebResponse ftpResponse;
System.IO.Stream ftpStream, outStream;
ANXEdiParameters param = ANXEdiParameters::findOrCreate();

System.Byte[] buffer;
int bufferLength = 32 * 1024;
System.Int32 len;
int l;
;

try
{
dummyObject = System.Net.WebRequest::Create(remoteLocation);
ftpRequest = dummyObject;
ftpRequest.set_Credentials(new System.Net.NetworkCredential(transmissionPathTable.AccessIdentification, transmissionPathTable.AccessKey));
ftpRequest.set_UseBinary(true);
ftpRequest.set_KeepAlive(false);
ftpRequest.set_UsePassive(true);
//ftpRequest.set_Proxy(System.Net.GlobalProxySelection::GetEmptyWebProxy()); //Deprecated docs.microsoft.com/.../system.net.globalproxyselection
ftpRequest.set_Proxy(null);

// Problem mit .NET cast umgehen
dummyObject = ftpRequest.GetResponse();
ftpResponse = dummyObject;

ftpStream = ftpResponse.GetResponseStream();

......

Why does this exception just came at the UAT Environment?

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    Perhaps some outbound ports are blocked in the Tier 2 system.

    I recommend to use SFTP instead of FTP because in FTP you send username and password as cleartext and the communications are not encrypted. SFTP also uses different ports which might not be blocked in the Tier2 / prod systems.

  • Stefan Wojtas Profile Picture
    550 on at

    Thanks for your replay. I will try it and give you a feedback

  • Suggested answer
    A.Prasanna Profile Picture
    8,223 on at

    Better to check first with FTP client (like Filezilla)  whether you can access it or not . Normally default Port FTP port  21 ,  SFTP Port is 22 just check whether you allowed those (respective) port from Firewall(s).

    Hope this helps ,

    Regards,

    Amith Prasanna

  • Stefan Wojtas Profile Picture
    550 on at

    Hello,

    Filezilla works without Problems

  • nmaenpaa Profile Picture
    101,160 Moderator on at

    On which system did you try with FileZilla?

  • Suggested answer
    A.Prasanna Profile Picture
    8,223 on at

    with which protocol its working SFTP /FTP ? ,

    If it s Tier 2 then connect to server then just run Powershell as Administrator  then type tnc <FTP Server Name/IP> - Port<FTP Port> and then check you can reach it will give you connection details with the status.

    if you getting massage as TcpTestSucceeded       : True  ,  then your connection to the FTP server has no issue . the error 425 is mostly related to connection issues .

    Hope this will help ,

    Amith Prasanna

  • Stefan Wojtas Profile Picture
    550 on at

    Hello,

    what do you excactly mean with "If it s Tier 2 then connect to server"?

    If you mean that I have to connect via rdp to Tier 2 Environment, that is not possible. Only in Tier 1, I'm able to connect via rdp.

    I tried the tnc Powershell Way from my Laptop.

    Port 21 works, Port 22 doesn't work. With Filezilla on my Laptop its the same.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 663 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 540 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 348 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans