Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB ASP.NET .NET service Web
Hi!
 
I have a web system built in ASP.Net and VB.Net (VS 2010), and the system has Web Service(.asmx). I call functions in web service from a desk top tool built in VB.Net to upload a file to the web site. Some of our clients get System.Net.Sockets.SocketException occasionally even though the web site is up and running and other users have no problem using the desk top tool. I googled about this issue and found that this might be because of a full 'backlog', but I'm not quite sure how to fix this problem on the server side (in web service). Is there any suggestion how to fix this? Theoretically, the desk top tool allows the users to upload any size of file (tested up to 1GB) and it takes for a while to finish uploading. I have not added 'retry' logic to the functions yet as uploading file will take some time and I thought retrying might not help this situation. By the way, I get the exact same exception when I run the desk top tool without having the website running. Thanks in advance.
 
The function call in the desk top tool is like this. The exception is thrown at the 2nd line.
 
myService = New ProjectManagement_FileUpload.FileUpload1()
objXML = myService.Get_Login_XML(strUserName, strPassword, strVersion)
 
The function in web service (.asmx.vb) is like this. (Omitted detailed code.)
 
<WebMethod()> _
Public Function Get_Login_XML(ByVal strUserName As String, ByVal strPassword As String, ByVal strVersion As String) As XmlDocument
    Dim objXML As XmlDocument
    Dim objXML_Error As XmlDocument
    Dim boolResult As Boolean
    Dim boolValid As Boolean
    Dim strFunctionResult As String
 
    objXML = Nothing
    objXML_Error = Nothing
 
    Try
        'Create XML document

        'Check the version

        'Validate Login

        'Get User Information

        strFunctionResult = "~P"
 
    Catch ex As Exception
 
        strFunctionResult = "~EGet_Login_XML Error: " & ex.ToString()
 
    End Try
 
    If strFunctionResult.StartsWith("~E") AndAlso objXML IsNot Nothing Then
        Set_XML_Element("Error", strFunctionResult.Substring(2), objXML_Error)
        Get_Login_XML = objXML_Error
        Exit Function
    End If
 
    Get_Login_XML = objXML
End Function
 
The error message is this.
System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:50897
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
   at System.Net.HttpWebRequest.GetRequestStream()
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at ProjectManagement_FileUpload.ProjectManagement_FileUpload.FileUpload1.Get_Login_XML(String strUserName, String strPassword, String strVersion) in C:\Client Projects\Project Management System\ProjectManagement_VBApp\ProjectManagement_UploadFile\ProjectManagement_FileUpload\ProjectManagement_FileUpload\Web References\ProjectManagement_FileUpload\Reference.vb:line 105
   at ProjectManagement_FileUpload.frmLogin.btnLogin_Click(Object sender, EventArgs e) in C:\Client Projects\Project Management System\ProjectManagement_VBApp\ProjectManagement_UploadFile\ProjectManagement_FileUpload\ProjectManagement_FileUpload\frmLogin.vb:line 118
Posted 10-Dec-12 3:40am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 480
1 mhegazy94 460
2 Ravi Bhavnani 190
3 Kornfeld Eliyahu Peter 185
4 Shemeemsha RA 160
0 Sergey Alexandrovich Kryukov 7,205
1 OriginalGriff 6,801
2 CPallini 5,350
3 George Jonsson 3,644
4 Gihan Liyanage 2,797


Advertise | Privacy | Mobile
Web01 | 2.8.140922.1 | Last Updated 10 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100