Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6063883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:13:05+00:00 2026-05-23T09:13:05+00:00

I have two ASMX web services consumed from javascript. The first service performs a

  • 0

I have two ASMX web services consumed from javascript. The first service performs a long operation and updates a database table on its progress. The second service polls that same database table in order to report the progress to the end user via a progress bar.

My problem is that the long process seems to be blocking the polling service. When I log the activity of the javascript, it seems to be requesting the long service correctly, and then starts to request the polling service once a second asynchronously (note: the long process is asynch as well). Both request types either use setInterval or setTimeout which shouldn’t halt the browser. Yet when I look at the activity of the javascript, none of the responses from the polling requests return until the long process completes. So it seems the long process is blocking the polling requests until it’s done.

Here’s the nitty gritty:

JavaScript:

var percentComplete = 0;
setTimeout(function ()
{
    MyWebService.CreateBulkOrder(serverVariable, function (result, eventArgs)
    {
        percentComplete = 100;
        completeOperation(result);
    });
}, 0);
var intID = setInterval(function ()
{
    if (percentComplete < 100)
    {
      MyWebService.GetStatus(serverVariable, callback);
    }
    else
    {
        clearInterval(intID);
    }
}, 1000);

Service Code (VB.NET – Note: code is changed to make it generic)

   <System.Web.Script.Services.ScriptService()>
<System.Web.Services.WebService(Namespace:="http://mydns.com/webservices")>
<System.Web.Services.WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)>
<ToolboxItem(False)>

Public Class MyWebServices
    Inherits System.Web.Services.WebService

<WebMethod(EnableSession:=True)>
Public Function GetStatus(serverVariable As Integer) As Object
    Dim currentPage As Integer = 0
    Dim totalPages As Integer = Math.Ceiling(CType(If(Session("Number of Records"), Double) / CType(ConstantsCommon.TOTAL_PER_PAGE, Double))
    Using clientDB As ClientDataContext = FunctionsOrderMgmt.ClientConnectionReadOnly
        Dim repeatPageQuery = From repeatPage In clientDB.RepeatPages
                              Where repeatPage.KEY = serverVariable
                              Select repeatPage
        Dim repeatPageData = repeatPageQuery.SingleOrDefault()
        If repeatPageData Is Nothing Then
            currentPage = 0
        Else
            currentPage = If(repeatPageData.REPEAT_PAGE, 0)
        End If
        Return New With {.TotalPages = totalPages, .CurrentPage = currentPage}
    End Using
End Function

<WebMethod(EnableSession:=True)>
Public Function CreateBulkOrder(serverVariable As Integer) As Boolean
    If Not TestsPass Then
        Return False
    End If
    Try
        'Do stuff that takes a long time
    Catch ex As Exception
        Return False
    End Try
    Return True
End Function

End Class
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:13:06+00:00Added an answer on May 23, 2026 at 9:13 am

    Add ‘OneWay = true’ to the CreateBulkOrder Webmethod otherwise it will be waiting for a response.

    http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapdocumentmethodattribute.oneway(v=vs.71).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application containing two web services, let's say PublicHello.asmx and RestrictedHello.asmx
I have a site in development with several web services (ASMX) that post important
I have a VS2008 solution containing two projects, a web service (the actual work
I have some basic questions related to the conversion of Web Service (.asmx) into
I have two identical tables and need to copy rows from table to another.
I trying to display image in picture box. The application have two part. First
The old ASP.NET ASMX Web services used to produce a Web page that allowed
I have numerous Web Services in my project that share types. For simplicity I
I have a have Winforms client that uses Web services on a IIS7 (W2008)
I have two tables in my database, table1 and table2. They are identical. But

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.