Calling Web Service Asynchronously

Discussion in 'ASP .Net Web Services' started by Mike C#, Nov 12, 2006.

  1. Mike C#

    Mike C# Guest

    Hi all,

    Having an issue. I created a simple web service and a proxy class. I'm
    calling the web service asynchronously (from an ASP.NET page) using the
    Begin... and End... methods of the proxy class. It appears to work properly
    until I get to the callback function. As soon as I try to cast the
    IASyncResult and call the End... method it stops executing at the CType
    function and exits the callback procedure. The Web Service is very simple -
    basically it has one method called "GetSingle" that returns a string. The
    proxy class adds the BeginGetSingle and EndGetSingle methods. Here's the
    code for the callback:

    Private Sub Callback(ByVal iar As IAsyncResult)
    Dim p As localhost.AsyncWebSvc = CType(iar, localhost.AsyncWebSvc)
    ' It never gets to this line, where I would retrieve the results. The
    line above
    ' stops the processing for some reason. If I put a breakpoint on the
    line below
    ' it never gets to it.
    Dim s As String = p.EndGetSingle(iar)
    Dim status As String = "Done"
    End Sub

    Any help is appreciated. Thanks!
     
    Mike C#, Nov 12, 2006
    #1
    1. Advertising

  2. Mike C#

    Mike C# Guest

    "Mike C#" <> wrote in message
    news:OSN5h.616$...

    OK I think I resolved that particular issue. But now I have another. When
    I call my Web Service synchronously, or asynchronously 2, 3, or 4 times, it
    works fine. When I try to call it asynchronously 8 times, however, I get a
    "(403) Forbidden" error. I'm running it all on my localhost IIS server and
    ASP.NET installation. Does anyone know why this might happen? Is there a
    setting somewhere I need to adjust maybe?

    Thanks
     
    Mike C#, Nov 12, 2006
    #2
    1. Advertising

  3. Mike C#

    Mike C# Guest

    "Mike C#" <> wrote in message
    news:s5O5h.618$...
    > "Mike C#" <> wrote in message
    > news:OSN5h.616$...


    Some more info. - the Web Service is using HttpWebRequest to POST to, and
    retrieve data from, an ASPX page on my localhost web server. With up to 4
    asynchronous calls, it works. The exact cut-off appears to be at 5
    asynchronous calls, where I get the following error message:

    "The remote server returned an error: (403) Forbidden."

    Also I get a pop-up message with the following error:

    "An unhandled exception of type 'System.IO.IOException' occurred in
    system.dll
    Additional information: Unable to read data from the transport connection."

    I assume the second is probably a result of the connection being closed
    because of the (403) error, although I could be wrong. Any ideas are
    appreciated. Thanks!
     
    Mike C#, Nov 12, 2006
    #3
  4. "Mike C#" <> wrote in message
    news:gbO5h.840$...
    > "Mike C#" <> wrote in message
    > news:s5O5h.618$...
    >> "Mike C#" <> wrote in message
    >> news:OSN5h.616$...

    >
    > Some more info. - the Web Service is using HttpWebRequest to POST to, and
    > retrieve data from, an ASPX page on my localhost web server. With up to 4
    > asynchronous calls, it works. The exact cut-off appears to be at 5
    > asynchronous calls, where I get the following error message:
    >
    > "The remote server returned an error: (403) Forbidden."


    You can get this error when you have too many connections open in IIS.

    John
     
    John Saunders, Nov 14, 2006
    #4
  5. Mike C#

    Mike C# Guest

    "John Saunders" <john.saunders at trizetto.com> wrote in message
    news:e%...
    > You can get this error when you have too many connections open in IIS.


    That appears to be the problem :( Is it too many connections from one
    client? What's the best way to perform multiple asynchronous calls from
    ASP.NET? Or is it even possible?
     
    Mike C#, Nov 14, 2006
    #5
  6. "Mike C#" <> wrote in message
    news:VIa6h.784$...
    >
    > "John Saunders" <john.saunders at trizetto.com> wrote in message
    > news:e%...
    >> You can get this error when you have too many connections open in IIS.

    >
    > That appears to be the problem :( Is it too many connections from one
    > client? What's the best way to perform multiple asynchronous calls from
    > ASP.NET? Or is it even possible?


    If you're running IIS on Windows XP, then it's meant to be an upper limit.
    It's a license thing.

    Are you calling Dispose on your proxy objects? If not, then you're leaving
    the connections open.

    John
     
    John Saunders, Nov 14, 2006
    #6
  7. Mike C#

    Mike C# Guest

    "John Saunders" <john.saunders at trizetto.com> wrote in message
    news:uI3xnG$...
    > "Mike C#" <> wrote in message
    > news:VIa6h.784$...
    >>
    >> "John Saunders" <john.saunders at trizetto.com> wrote in message
    >> news:e%...
    >>> You can get this error when you have too many connections open in IIS.

    >>
    >> That appears to be the problem :( Is it too many connections from one
    >> client? What's the best way to perform multiple asynchronous calls from
    >> ASP.NET? Or is it even possible?

    >
    > If you're running IIS on Windows XP, then it's meant to be an upper limit.
    > It's a license thing.
    >
    > Are you calling Dispose on your proxy objects? If not, then you're leaving
    > the connections open.
    >
    > John


    Actually running it on Windows Server 2003, and properly disposing of all
    IDisposable objects. I've been told there may be a registry setting that
    needs to be modified and I'm trying to find info. on that to give it a
    shot... We'll see... Thanks.
     
    Mike C#, Nov 16, 2006
    #7
    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. Assaf
    Replies:
    1
    Views:
    513
    Justin Rogers
    Feb 7, 2004
  2. Ginny
    Replies:
    0
    Views:
    390
    Ginny
    Sep 8, 2006
  3. Edwin Gomez
    Replies:
    4
    Views:
    348
    Duncan Booth
    Nov 28, 2006
  4. shailesh

    Calling a WebService Method Asynchronously

    shailesh, Sep 1, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    131
    shailesh
    Sep 1, 2003
  5. Andy

    Problem in Calling Web service asynchronously

    Andy, Jul 21, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    143
Loading...

Share This Page