ref parameter in web service

J

John Lee

Hi,

Is there any performance hits by using ref in web service call?

method 1: void foo(ref DataSet ds, string key)
method 2: DataSet foo(DataSet ds, string key)

which one will have better performance for a web method?

Thanks!
John
 
M

[MSFT]

Hello John,

For better performace in web serivce, we recommend "one way" method call.
This can reduce the network communication and serialization. So method will
give better performance. By the way, in web service, we don't recommend use
large Dataset as parameter, this also will reduce the performance. You may
consider XML text instead.

Luke
 
J

John Lee

Thanks very much for your reply, Luke!

I understand your point but it did not answer my question related to method1
vs method2, is there any difference performance wise?

We also had a lots of debate of how to use web services (in some extent I
think web service is miss used) - here is the scenario I really want all of
your opinion on the following issue:

before .net web service, we either build 2-tier app or we host the com+ app
remotely and all client using proxy to access the com+ app remotely ...
now, we just the use web service to replace the com+ app, so every single
database call will be calling one of the web service method to get back data
from db or update back db so the dataset is heavily used to ship data
between client and web service ...

What other best practice/alternatives if this is not right thing to do?

All genius, please tell me you opinion.

Thanks very much!
John
 
M

[MSFT]

Hi John,

I think Method 2 should have better performance than method 1, because
method 1 have to keep refferences on both of server side and server side
and this impact the serialization during web method call.

Following are some best practices for web service, you may take a look to
see if they can help:

Improving Web Services Performance
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/
scalenetchapt10.asp

How To: Use ACT to Test Web Services Performance
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/
scalenethowto11.asp

Code Review: .NET Application Performance
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag/html/
scalenetchapt13.asp

Luke
 

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,241
Members
46,831
Latest member
RusselWill

Latest Threads

Top