ASP.NET Concurrent users of Webservice causing overlapping results

In the interest of setting the right foundation for communication it's important to realize that my software designs skills/understanding are intermediate and do have limitations. That having been said I will describe my situation.

Basic Description & Developement Environment:
I have designed an ASP.NET (.NET Framework 4.x) webservice using Visual Studio 2010 that receives an xml document through a SOAP call made by the end user. The XML is then processed by 10-15 different classes. These classes retrieve data from 3rd party information providers, credit bureaus, OFAC repositories ect.... and subsequently parse the results. The final process simply constructs an XML document of the results and returns it to the end user.

The Problem:
Occassionally when two users make requests at the same time their XML results become "mixed". That is to say that user A may have data contained in the XML that belongs to the request of user B. It appears to be random and not consistently repeatable.

My Hypothesis:
My inital thought was that I have not properly designed the classes to be thread safe/isolated however after much code review I don't believe that to be the case. Unfortunately all my attemps (limited knowledge not withstanding) to correct the problem failed and consequently I am stuck.
Who is Participating?
Roopesh ReddyConnect With a Mentor IT AnalystCommented:

It's supposed to work that way! Once the process in running, other requests will be waiting until the first one finishes!

Hope it helps u...
Roopesh ReddyIT AnalystCommented:

You can lock the calls to Web Service like this -


In the web.config set this -

      <add address="*" maxconnection="2"/>

Open in new window

you can also try this -

  <autoconfig = "true">

Open in new window

Hope it helps u...
RobFarleyAuthor Commented:
Thanks for your reply. AM I correct in saying that by making these adjustments to the web.config file as shown above I would essentially "serialize" the web service so that only one request is processed at a time?

If this is the case does this process create a "virtual queue" for all requests that try to access the service WHILE the preceeding call is still being processed? Or..... will subsequent requests need to repeatidly call the web service until the preceeding call has completed?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.