smtp service didn't disconnect file.

hi.

i have developed the client program which is using webmethod’s smtp service.

The cilent program works as below.
step1. The client program query data and save a excel file.
step2. The client program call the webmethod’s smtp service to send the excel file.
step3. after invoking the service ,if the result is success, move file to success folder.
if the result is fail, move file to fail folder.

but error occured at step3 as below statment.

"The program cannot access the file because it is being used by another process"

So I have checked all Step and I have found that step 2 has problem
which is about connecting smtp server.

Sometimes smtp service can’t connect smtp server,
after invoking, it is processing file still.

please advice.


Hi

From the error message “The program cannot access the file because it is being used by another process” it looks like before the service which is trying to create the file and save is completed , the other service is trying to connect to access the file to send it to the SMTP Server

Check the following

Make sure you close the file stream before you invoke the next service

Wrtie a test service which calls the webMethods SMTP service and sends a mail ( you can use this service to test if there is any problem with the SMTP server ,in this way you can isolate if the problem is with SMTP or with the file creation service )

Srini

Thanks for your reply.

But It only happened that SMTP server didn’t response.

if you can, set your stmp server ip to 1.1.1.1 then try to invoke stmp service and after invoking,check it for file moving.

maybe you’ll see error message.