Better way to call the web service ?

Discussion in 'ASP .Net Web Services' started by Polaris, Nov 8, 2005.

  1. Polaris

    Polaris Guest

    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
    Polaris, Nov 8, 2005
    #1
    1. Advertising

  2. Polaris

    Martin Kulov Guest

    "Polaris" <> wrote in message
    news:%...
    > 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
    Martin Kulov, Nov 9, 2005
    #2
    1. Advertising

  3. Polaris

    Marvin Smit Guest

    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.

    On Wed, 9 Nov 2005 03:16:46 +0200, "Martin Kulov"
    <> wrote:

    >"Polaris" <> wrote in message
    >news:%...
    >> 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,
    Marvin Smit, Nov 9, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Averstegge
    Replies:
    0
    Views:
    4,202
    Michael Averstegge
    Jan 10, 2006
  2. Not Me
    Replies:
    1
    Views:
    3,172
    Not Me
    Jun 5, 2007
  3. RJ
    Replies:
    4
    Views:
    748
    Brock Allen
    Sep 22, 2005
  4. Redhot
    Replies:
    0
    Views:
    757
    Redhot
    Jul 18, 2009
  5. Replies:
    2
    Views:
    44
    Mark H Harris
    May 13, 2014
Loading...

Share This Page