pub.client.ftp:login

Hi,

I would like to know why does pub.client.ftp:login is crashing (an error popup appears) instead of returning the details of the error into the output service.

I try to use a do-catch sequence but it does not work. When the error occurs, the service crash and that’s it.

If there is a work around of something I can use. It will be appreciate. I need to be able to identify which file(s) did not works.

P.S. I’m using version 6.1 of WM.

littlebird

The built-in FTP client does not throw a service or runtime exception. Instead it will output errors/messages to a message variable in the pipeline which you must interpret to determine whether you want to throw a runtime or service exception. Works like the WmDB adapter.

However I would be surprised to see a FTP login crashing the IS server. :eek: Maybe if you are past the login and getting a file that is filling up memory or something?

I should read the message more closer next time. :o You said the login service is crashing not the IS. Still the returnmsg field should have the error embedded in it. Have you tried stepping through the service?

In 6.5 the ftp client will throw exceptions that can be caught. But you probably don’t want to upgrade from 6.1 just for that. :slight_smile:

Here is the popup message that I’m having.

An error occured while tracing.
com.wm.net.ftpCException:[ISC.0064.9005] 530 Login incorrect.

N.B. I know that the login is incorrect. I’m using a wrong password to be able to test my service.

I’m not able to upgrade the version of WM for now.

Any other suggestion?

Actually I guess they fixed the ftp client in 6.1. That error is trappable by your catch statement. It should jump down into your catch when you hit that.

Do you have your try/catch seq. setup like this:

seq(success)[INDENT]seq(failure)

[INDENT]ftp:login
[/INDENT]seq(done)

[INDENT]getLastError
[/INDENT]

[/INDENT][INDENT]

[/INDENT]

Mark beat me to the same question. I just tried one of my FTP services that is set up this way and was able to catch the exception fine.

Tim

I just found my mistake. For the first “do”, it was setup to “exit on failure”. I change it by “exit on done” and it works.

do <---------------------- use exit on DONE instead of FAILURE
try (exit on failure)
login
exit (signal SUCCESS)
catch (exit on done)
getlasterror
exit (signal SUCCESS)

Sorry for the inconvenient.
littlebird

My two cents:

The services in the 6.1 pub.ftp.client folder can be a little misleading. If an error occurs, one would think that the error code and error message would be returned via the output variables (ie. returncode and returnmsg.) However, many times, the services themselves will check to see if the return code is greater than 300, and if so, they throw an exception.

This works out nicely (IMO) because you don’t need to litter your code with BRANCH statements after every FTP service call. Nevertheless, it would be nice if webMethods could document this behavior a little better so we don’t have to guess when to check the return code and when not to.

  • Percio

Oh… and littlebird, I just noticed something:

Your first SEQUENCE should be EXIT ON SUCCESS not DONE. If you use EXIT ON DONE for the parent SEQUENCE, then both your try and catch SEQUENCEs will always be executed.

  • Percio

Here is the way I’ve done to know if the login part is working or not.

I have made a service for the login part. At the beginning of the service, I set a field to 500 (it means error for me). After that, I’m trying to do the login command. If it fails, I still have the 500. If it works, I’m looking if the return code is 200. If it is the case I change the 500 by a 200. This way, it is easy to know if it works or not.

When I will upgrade my WM version, the ftp login service will continue to work.