Better way to call the web service ?

P

Polaris

Hi Experts:

I have a web service which retrieves user profile from Active Directory and
a Database. Just wonder, which one is better way to use the web service if I
need to retrieve 100 users profile:

Choice-1: call the web service and retrieve all 100 users profile (with a
single thread);
Choice-2: start 100 thread, each thread retrieve one user profile.

What are your opinions on the Pros and Cons on the 2 methods above?

Thanks in advance !

Polaris
 
M

Martin Kulov

Polaris said:
Hi Experts:

I have a web service which retrieves user profile from Active Directory
and
a Database. Just wonder, which one is better way to use the web service if
I
need to retrieve 100 users profile:

Choice-1: call the web service and retrieve all 100 users profile (with a
single thread);
Choice-2: start 100 thread, each thread retrieve one user profile.

What are your opinions on the Pros and Cons on the 2 methods above?

Hi Polaris,
You should prefer the first method if you are calling web service. In
general when calling a web service use 'chunky' (that returns big chunk of
data) calls instead of 'chatty' ones. In the second method you will have a
great delay caused by round trips to the web service. Nevertheless be aware
that you should find the optimal size of returned data, for example a 100 MB
of xml response could choke on the Internet.

Best regards,
--
Martin Kulov
http://www.codeattest.com/blogs/martin

MCAD Charter Member
MCSD.NET Early Achiever
MCSD
 
M

Marvin Smit

Hi,

you could also consider (for performance, maintenance, layering) to
build a small NT-Service which does these 'retrievals of profiles' and
caches some. You're webservice will always use this service to do it's
requests and the service contact's AD and caches the results.

The NT-Service can now be made to accept "ranges", "entries", "dynamic
queries" etc etc.

Hope this helps,

Marvin Smit.
 

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

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top