"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host"
I am getting the above error in my desktop application when i call to webservice.
i ahve one method in webservice which searches the virtual path on server. when i call to this method , i have got the aboove error. I have checked the same path on my server and it is properly working
Webservice :-
<WebMethod(Description:="Retrieve an array of files with name, attributes and content.")> _
Public Function Browse(ByVal VirtualPath As String, ByVal FileExtension As FileExtensions) As FileInformation()
Dim i As Integer
Dim fi As FileInfo
Dim aFiles As FileInformation()
Dim mExtension As String
Select Case FileExtension
Case FileExtensions.asp
mExtension = "asp"
Case FileExtensions.aspx
mExtension = "aspx"
Case FileExtensions.gif
mExtension = "gif"
Case FileExtensions.htm
mExtension = "htm"
Case FileExtensions.html
mExtension = "html"
Case FileExtensions.jpg
mExtension = "jpg"
Case FileExtensions.dll
mExtension = "dll"
Case FileExtensions.exe
mExtension = "exe"
Case FileExtensions.all
mExtension = "*"
End Select
Dim di As New DirectoryInfo(WebServerPath & VirtualPath)
Dim afi As FileInfo() = _
di.GetFiles("*." & mExtension)
ReDim Preserve aFiles(afi.Length - 1)
For Each fi In afi
aFiles(i) = New FileInformation()
aFiles(i).Name = fi.Name
aFiles(i).Size = fi.Length
aFiles(i).LastAccess = fi.LastAccessTime
aFiles(i).CreadedDate = fi.CreationTime
aFiles(i).LastModified = fi.LastWriteTime
aFiles(i).FileType = fi.Extension
aFiles(i).FileLocation = fi.DirectoryName
aFiles(i).FileContent = ReadFile(WebServerPath & VirtualPath & "\" & fi.Name)
i += 1
Next
Return aFiles
End Function
in web.config of webservice:-
="1.0"="utf-8"
<configuration>
<appSettings>
<add key="WebServerRootPath" value="c:\inetpub\wwwroot\" />
</appSettings>
</configuration>
In my desktop application :-
mWSFileServer = New WSFileSever.FileServer()
mFileInformation = mWSFileServer.Browse("microt/MicroLNTS.net/Common/NewCarmsDownloads/MicroCramsLNTSWin7HomePre64bit", WSFileSever.FileExtensions.all)
Please help me its urgent