471,122 Members | 923 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,122 software developers and data experts.

Web service proxy - best practices?

Hi

I would like some advice on how best to use web service proxy classes. Lets
say I have a web service with 3 methods to GetCustomer, DeleteCustomer and
UpdateCustomer. In my client code I might have a class that will call
GetCustomer and then depending on user input, I might want to DeleteCustomer
or UpdateCustomer. In my client code I will need an instance of a proxy
class for the web service I want to use and as I see it, there are 3 ways I
could use this proxy class.

a) Create a static class with a static instance of the web service proxy
and in my customer client class use the static instance of proxy in the
static class in my GetCustomer(), DeleteCustomer(), and UpdateCustomer()
methods.

b) Create a new private instance in my customer client class and re-use the
same private instance in my GetCustomer(), DeleteCustomer(),
andUpdateCustomer() methods.

c) In my customer client class, create a new local instance of the proxy in
each of the methods so GetCustomer() would instantiate a new instance of the
web service proxy, DeleteCustomer() would instantiate a new instance of the
web service proxy and so would UpdateCustomer().

What's the preferred way?

My second question is this: If I write a web service application that is
capable of retrieving/updating all sorts of data such as customers,
products, orders, stock etc should I create multiple web services, one for
each type of data, or is it better to create one large web service with all
the methods for creating and updating all the various data types (I will be
creating seperate class files for all the data access methods so the method
body of each web method will only be 1 or 2 lines)?

Your comments will be most welcome.

Thanks!

John

Nov 23 '05 #1
0 1288

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Bill Hauver | last post: by
1 post views Thread by Nestor | last post: by
3 posts views Thread by =?Utf-8?B?c3JpZGhhcg==?= | last post: by
3 posts views Thread by =?Utf-8?B?Q3JhaWc=?= | last post: by
1 post views Thread by nathan.alden | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.