none
asynchronous call to web services timeouts - 'System.StackOverflowException' occurred in Microsoft.JScript.dll RRS feed

  • Question

  • Hi

    I need to call web services asynchronously inside a for each loop, however it raise exceptions don't complete, I'm calling code from ssis package-

                    foreach (DataRow drSource in dt.Rows)
                    {
                       ....................

                        if ("Y".Equals(strVal))
                        {
                            finalURLtoHit = RDSURL + SourceName + "&groupid=test&clientID=xxx";
                            .......
                            WebRequest request = HttpWebRequest.Create(finalURLtoHit); //fails here immediately with timeout...
                            IAsyncResult response =request.BeginGetResponse(null, null);
                            System.Threading.Thread.Sleep(5000)

                       }

              }

    to make sure not multiple request at the same time I have also added a delay of 5 sec which also not helping.

    excetion log--> An unhandled exception of type 'System.StackOverflowException' occurred in Microsoft.JScript.dll

    please advice.


    Dev




    • Edited by Dev_1 Sunday, June 17, 2012 11:46 PM code corrected in initial thread
    Sunday, June 17, 2012 6:55 PM

Answers

  • Hi, 

    This could be from finalURLtoHit page. What actually happening in the page?

    also Can you show us full stack trace?


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".

    • Marked as answer by Dev_1 Sunday, September 30, 2012 7:23 AM
    Monday, June 18, 2012 5:55 PM

All replies

  • Is the code failing the 1st time through the loop, or after a few times through the loop?

    Try putting the failed URL into a webbrowser to make sure the problem isn't with a bad URL.


    jdweng

    Sunday, June 17, 2012 11:40 PM
  • URL works fine over the browser,

    it fails even in first run, same peice of code used to work earlier.

    WebRequest request = HttpWebRequest.Create(finalURLtoHit);
    IAsyncResult response = request.BeginGetResponse(null, null);


    Dev

    Sunday, June 17, 2012 11:45 PM
  • I thought from you r previous posting that it failed on the Create() method.  Now it seems that is is failing on the BeginGetResponse().  which line is the code failing?

    jdweng

    Monday, June 18, 2012 8:41 AM
  • Hi, 

    This could be from finalURLtoHit page. What actually happening in the page?

    also Can you show us full stack trace?


    If this post answers your question, please click "Mark As Answer". If this post is helpful please click "Mark as Helpful".

    • Marked as answer by Dev_1 Sunday, September 30, 2012 7:23 AM
    Monday, June 18, 2012 5:55 PM
  • I tried with invalid URL and found out URL which I using has some invalid chars due to which server was not able to identify the request, upon removing those it worked fine. Thanks all!


    Dev

    Sunday, September 30, 2012 7:23 AM