K
kpg
(Multi-post from microsoft.public.dotnet.framework.aspnet.webservices,
Please apply all applicable pardons.)
Hi all,
I have a web service that FTPs data it receives to a third party
FTP site.
The web service will upload to the FTP site 12 times. The 13th
time it will timeout. Once the web service is reset - that is
modified in some way that IIS is forced to unload and JIT, then
it will upload an additional 12 times. This behavior is
remarkably consistent.
Note it does not matter what FTP site I upload to. I tested
against a server on my local LAN and it fails the same way.
This behavior leads me to believe that some session limit is being
reached, however the FTP site will allow 100,000 connections, and
in the test I uploaded once each second, but in production the files
come in hours apart. Plenty of time for the FTP server to dump any
possible open sessions.
The Web service will function normally for many hours until 12
upload are done, then I get FTP server timeouts.
Just as remarkable however, after about 6 hours, the FTP site will
again be accessible and an additional 12 uploads can be processed.
Actually the number of uploads is 24, since each post to the web
service results in 2 uploads to the FTP site.
Note that the FTP server is up and running with no problems while
the web service is failing and reporting a timeout, and the FTP
logs show no activity at all.
All this on a server that has many other functioning web services,
although none dealing with FTP transfers.
Any ideas? This is driving me nuts.
Thanks,
kpg
Here is the FTP upload code:
Private Function Upload(ByVal FTPPath As String, ByVal Data As
String, Optional ByVal UserName As String = "", Optional ByVal Password
As String = "") As Boolean
Try
Dim buffer As Byte() = Encoding.UTF8.GetBytes(Data)
Dim ftp As FtpWebRequest = CType(FtpWebRequest.Create
(FTPPath), FtpWebRequest)
If UserName.Length <> 0 Then
ftp.Credentials = New NetworkCredential(UserName,
Password)
End If
ftp.KeepAlive = False
ftp.UseBinary = True
ftp.Method = WebRequestMethods.Ftp.UploadFile
ftp.GetRequestStream().Write(buffer, 0, buffer.Length)
Upload = True
Catch ex As Exception
WriteToLog("Upload Error: " & ex.Message)
End Try
End Function
Please apply all applicable pardons.)
Hi all,
I have a web service that FTPs data it receives to a third party
FTP site.
The web service will upload to the FTP site 12 times. The 13th
time it will timeout. Once the web service is reset - that is
modified in some way that IIS is forced to unload and JIT, then
it will upload an additional 12 times. This behavior is
remarkably consistent.
Note it does not matter what FTP site I upload to. I tested
against a server on my local LAN and it fails the same way.
This behavior leads me to believe that some session limit is being
reached, however the FTP site will allow 100,000 connections, and
in the test I uploaded once each second, but in production the files
come in hours apart. Plenty of time for the FTP server to dump any
possible open sessions.
The Web service will function normally for many hours until 12
upload are done, then I get FTP server timeouts.
Just as remarkable however, after about 6 hours, the FTP site will
again be accessible and an additional 12 uploads can be processed.
Actually the number of uploads is 24, since each post to the web
service results in 2 uploads to the FTP site.
Note that the FTP server is up and running with no problems while
the web service is failing and reporting a timeout, and the FTP
logs show no activity at all.
All this on a server that has many other functioning web services,
although none dealing with FTP transfers.
Any ideas? This is driving me nuts.
Thanks,
kpg
Here is the FTP upload code:
Private Function Upload(ByVal FTPPath As String, ByVal Data As
String, Optional ByVal UserName As String = "", Optional ByVal Password
As String = "") As Boolean
Try
Dim buffer As Byte() = Encoding.UTF8.GetBytes(Data)
Dim ftp As FtpWebRequest = CType(FtpWebRequest.Create
(FTPPath), FtpWebRequest)
If UserName.Length <> 0 Then
ftp.Credentials = New NetworkCredential(UserName,
Password)
End If
ftp.KeepAlive = False
ftp.UseBinary = True
ftp.Method = WebRequestMethods.Ftp.UploadFile
ftp.GetRequestStream().Write(buffer, 0, buffer.Length)
Upload = True
Catch ex As Exception
WriteToLog("Upload Error: " & ex.Message)
End Try
End Function