RE: System.Net.WebException: The underlying connection was closed:

Discussion in 'ASP .Net' started by Steven Cheng[MSFT], Apr 1, 2004.

  1. Hi Tim,

    From your description, you've a ASP.NET webservcie and created a Winform
    client app to consume it. However, when calling the webservice, you found
    it worked well the first time but occured unexpected error the second time
    after a few minutes, yes?

    From the code you provided(calling the webservice), it seems all right and
    I don't think the problem is likely in the client application. I'm not sure
    about the webservice's detailed code logic in its webmethods but from the
    method's signature:

    WebSvcW.OMTestAddOrderXML(comboBox3.Text,int.Parse(textBox2.Text),comboBox4.
    Text);

    it takes simply type params, so I think we can test the webservice through
    IE, open the certain url (http://....... .asmx) in the IE and call the
    webservice thourgh it. It is better if you can use VS.NET to debug the
    webservice on the serverside to see whether the problem also occured when
    calling it from IE. If still remains, we can confirm that the problem is
    not caused by the winform client , do you think so?

    In addition, as for creating client application to consume webservice,
    below is the related web link in MSDN:
    #Creating Clients for XML Web Services
    http://msdn.microsoft.com/library/en-us/cpguide/html/cpconcreatingclientsfor
    webservices.asp?frame=true

    Hope also helps. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Apr 1, 2004
    #1
    1. Advertising

  2. Hi Tim,

    Have you had a chance to view the suggestions in my last reply or have you
    got any progresses on this issue? If there is anything else I can help,
    please feel free to post here. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Apr 5, 2004
    #2
    1. Advertising

  3. Thanks for your reply. However, when I try to go directly to the ..asmx url via IA, when I click on the name of the web service in order to test, I receive this message - Tes
    The test form is only available for requests from the local machine. Therefore, I am unclear on how to proceed. The server is in another state so I can't logon directly to it in order to test from my location. How shall I proceed

    Thank you
    Tim Reynold
    Verizon
     
    =?Utf-8?B?VGltIFJleW5vbGRz?=, Apr 5, 2004
    #3
  4. Hi Tim,

    From your reply, you haven't the certain permission to logon the server
    which host the webservice, yes? Then, I think we can do the following tests
    on the webservice:

    1. Creating a client proxy through the following guide(using wsdl.exe
    rather than via VS.NET) and consume the webservice by the geneated proxy to
    see whether the webservice still fail.
    #Creating an XML Web Service Proxy
    http://msdn.microsoft.com/library/en-us/cpguide/html/cpconCreatingWebService
    Proxy.asp?frame=true

    2. I'm not sure whether you have ever tried calling a webservice via
    javascript(DHTML) in a webpage, if not, you may have a look at the
    following reference:
    #Accessing Web Services From DHTML
    http://msdn.microsoft.com/library/en-us/dndude/html/dude01222001.asp?frame=t
    rue

    If you're able to perform a test via the DHTML way, we can further confirm
    whether the problem is with the serverside or not.

    In addtion, you can create a simple webservice( similiar with the one
    you're consuming, maybe just take 2 string parameters) on your local
    machine or a remote machine which you have full control on it. And then
    call it on the local machine to see whether the same problem occurs. If
    not, that also probably proof that the problem is likely due to the
    webservice's serverside processing.


    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Apr 6, 2004
    #4
  5. Hi Tim,

    Any progress on this issue? If you have any problems on this or if there're
    anything else I can help, please feel free to let me know. Thanks.

    Regards,

    Steven Cheng
    Microsoft Online Support

    Get Secure! www.microsoft.com/security
    (This posting is provided "AS IS", with no warranties, and confers no
    rights.)

    Get Preview at ASP.NET whidbey
    http://msdn.microsoft.com/asp.net/whidbey/default.aspx
     
    Steven Cheng[MSFT], Apr 8, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    2,860
    Kevin Spencer
    Sep 30, 2005
  2. Steven Harris
    Replies:
    0
    Views:
    201
    Steven Harris
    Aug 14, 2003
  3. Jeremy Ames
    Replies:
    1
    Views:
    289
    Jeremy Ames
    Jan 8, 2004
  4. Edgar@CCrane
    Replies:
    3
    Views:
    223
    feroze [msft]
    Jul 1, 2004
  5. Rob Snell
    Replies:
    5
    Views:
    477
    Joel Zhou
    Sep 28, 2004
Loading...

Share This Page