Web Service timeout from Sharepoint webpart

Discussion in 'ASP .Net' started by Joe L via .NET 247, Jun 17, 2004.

  1. I have written a web part. The webpart calls a web service toget info. I ran into problems with the webservice notresponding. We decided to have a cutoff for the time to waitfor a response from the web service. I am setting the Timeouton the webservice proxy before calling the webservice method. Iam not getting the results I expected. Below is the code andthe exception I get.

    ...
    Results results = null;

    try
    {
    MyWebService mws = new MyWebService();

    // Set Timeout
    mws.Timeout = 10000;

    //get ws results
    results = mws.getResults();
    }
    catch (Exception e)
    {
    // Throw exception to be caught in webpart control
    throw new ApplicationException("Error calling MyWebService: ",e);
    }
    ...

    When Timeout is set to 10,000 miliseconds:

    [WebPartPageUserException: The WebPart, Version=1.0.0.0,Culture=neutral, PublicKeyToken=750984491ffadf33 assemblyspecified in a Register directive of this page could not befound.]
    Microsoft.SharePoint.ac.a(h A_0)
    Microsoft.SharePoint.f.c()
    Microsoft.SharePoint.ac.c(Int32 A_0)
    Microsoft.SharePoint.ac.d(Int32 A_0)
    Microsoft.SharePoint.ac.a(Boolean A_0)
    Microsoft.SharePoint.f.a()
    Microsoft.SharePoint.SPWeb.a(Uri A_0, aj A_1, HttpContext A_2,Boolean A_3, Boolean A_4, Int64& A_5, SPWebPartCollection& A_6)
    Microsoft.SharePoint.ApplicationRuntime.SharePointHandler.SPProcessRequest(HttpContext context)

    [ApplicationException: Exception of typeSystem.ApplicationException was thrown.]
    Microsoft.SharePoint.ApplicationRuntime.SharePointHandler.SPProcessRequest(HttpContext context)
    Microsoft.SharePoint.ApplicationRuntime.SharePointHandler.SPProcessRequest(HttpContext context)
    Microsoft.SharePoint.ApplicationRuntime.SharePointHandler.ProcessRequest(HttpContext context)
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute() +179
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step,Boolean& completedSynchronously) +87

    When Timeout is set to 20,000 miliseconds:

    System.Web.HttpException (0x80004001) Request Timed Out. (what Iexpect)

    When Timeout is set to 30,000 miliseconds:

    Again Request Timed out and some successful webpart loads (alsowhat I expect)


    --------------------------------
    From: Joe L

    -----------------------
    Posted by a user from .NET 247 (http://www.dotnet247.com/)

    <Id>JQ83dEyO8Uib1/YXJj3pHw==</Id>
     
    Joe L via .NET 247, Jun 17, 2004
    #1
    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. susurla
    Replies:
    4
    Views:
    5,032
    Siva M
    Sep 6, 2005
  2. John
    Replies:
    2
    Views:
    721
  3. David Thielen

    ASP.NET -> Sharepoint webpart

    David Thielen, Jan 23, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    525
    Steven Cheng[MSFT]
    Jan 24, 2008
  4. JASV
    Replies:
    0
    Views:
    1,370
  5. Fowler
    Replies:
    5
    Views:
    238
    Joe Kaplan \(MVP - ADSI\)
    Dec 10, 2004
Loading...

Share This Page