-1

I have a web service which is created by using C#.

In this web service one config.inc file which stores all input data and it overrides as per new request. As per the input this web service gives a XML output on browser.

I need to make my web service to be accessible by multiple users simultaneously. And users should get XML output as per the input parameters to web service. XML output should not be conflicted among users.

Any guidelines to achieve this task.

Edit

Below is the problem in our web service implementation that's why I posted this questions.

We created web service which is deployed on IIS server. In the deployed directory there are two files config.inc and tempfile.xml. For each request config.inc file is overridden to store input parameters and as per the input parameters existing tempfile.xml file is overridden. and we display it on browser using C#.

The problem we are facing in our implementation is that when two users call for web service simultaneously, output desired by second user is send to first user and second user gets error message, I am not sure how to resolve this issue.

Please let me know if there is any way to implement this web service for multiple user access.

S R
  • 11
  • 6
  • The question doesn't make any sense. Web services are multi-user by definition. Each request is handled by a separate thread. Why are you asking about multiple users and what does the config file have to do with this? – Panagiotis Kanavos Sep 27 '16 at 10:18
  • Via web service we are connecting to Doors(IBM Requirement management tool) generating XML file of Doors module(document) and display that XML file on the browser using C#. We did not used any external database, For every request there are two files which are updated i.e. config.inc and XML file. If we run our web service with two users simultaneously with different input parameters, one user gets output as XML on the browser and other user gets error message. Input parameters of each request are stored in config.inc file. – S R Sep 27 '16 at 10:40
  • We want to handle multiple users such a way that each user will get XML output as per his input parameters to web service. – S R Sep 27 '16 at 10:45
  • 1
    This has nothing to do with web services. You'd have the same problem if you run two command-line scripts requesting the same data with the same output file. Don't. It's impossible to give a specific answer, since this is 100% about DOORS, but you should simply export the data to different files. Just pass a random name as the ouput file name. – Panagiotis Kanavos Sep 27 '16 at 10:56

1 Answers1

0

The only requirement to achieve this, is to avoid the use of any static variables that alter their value within the methods of the web service.

Apart the above, a web service is multi-user by default.

Trifon
  • 1,081
  • 9
  • 19
  • Actually we are not using any external database in out web service. we are using config.inc file to store input parameters. – S R Sep 27 '16 at 10:57
  • To put it another way, one has to actively try to create problems by storing data from multiple requests in static variables. – Panagiotis Kanavos Sep 27 '16 at 10:57
  • @PanagiotisKanavos: I applied that approach but It didn't work. – S R Oct 14 '16 at 07:12
  • I am facing problems for: When user specifies input parameters then XML generates as per the given input. And that input parameters stores into (temp.inc) file and overrides as per the new requests. But when Multiple requests are trying to access web service at a time then it gets conflicts and only first request gets XML output and remaining all gets an error. – S R Oct 14 '16 at 07:15