Some webservice connections

N

Nikolay Petrov

1. Can I use SSL for my web services?
2. How can implement some kind of security to my web services? My idea is to
implement some kind of licensing or user/password authentication for an web
service.
3. Do I have to make my web service multi threaded or IIS takes care for
simultaneous requests?
(I mean not multi threaded for accepting connections, that is done by
IIS, but multi threaded to the things it does, like file operations,
database connections and so on.)
 
S

Scott Allen

3) IIS and the ASP.NET runtime will manage simultaneous connections -
your app is multithreaded by default. This doesn't mean two
connections can both open the same file for writing at the same time -
the file system is an example of something where you have to manage
concurrent access. A database, on the other hand, is very good at
concurrent access. Your app can have multiple connections to the
database and the database engine will manage concurrent access to a
table or row (though it is possible to deadlock if queries are not
written carefully).
 
N

Nikolay Petrov

I was wondering is there going to be some lag if two users access the web
service at the same time.
If IIS and and ASP .NET manage this, I don't need to make all my web methods
threaded, right?
 
S

Scott Allen

Hi Nikolay:

In general you will not see a lag from two users hitting the service
at the same time - but this is where you have to look at a specific
application and environment to know what will happen. At some point
there will be a lag (10, 100, 10,000 users) but it depends on the CPU,
the RAM, and the actions of the code.

I'm not sure what you mean by "threaded" - there can be a thread per
request inside of the method. You might need to make your methods
thread-safe however.. In general - if the method uses only local
variables and parameters it is safe. If the method uses any static or
shared members you might need to synchronize threads to prevent
erroneous results. This is another case where you have to look at
specific code to make a 100% yes/no statement.
 
N

Nikolay Petrov

I got the point
Thank you

Scott Allen said:
Hi Nikolay:

In general you will not see a lag from two users hitting the service
at the same time - but this is where you have to look at a specific
application and environment to know what will happen. At some point
there will be a lag (10, 100, 10,000 users) but it depends on the CPU,
the RAM, and the actions of the code.

I'm not sure what you mean by "threaded" - there can be a thread per
request inside of the method. You might need to make your methods
thread-safe however.. In general - if the method uses only local
variables and parameters it is safe. If the method uses any static or
shared members you might need to synchronize threads to prevent
erroneous results. This is another case where you have to look at
specific code to make a 100% yes/no statement.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top