473,383 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 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 1373

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bill Hauver | last post by:
I am attempting to use a web service from my work pc which is behind a firewall. I have used wsdl.exe to create the web service reference class and added it to my project. (this seems to work...
12
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded...
5
by: Nate | last post by:
We are attempting to make a request to a web service (we will refer to it as XXXServices) hosted on a Web Logic server from a C# SOAP client. The server responds with a 401 Unauthorized error...
1
by: Nestor | last post by:
Hello all, I'm begining in the web services world and I've reading about how to invoke them using javascript from Mozilla browser (version 2.0 in my case). I found a very interesting example...
3
by: =?Utf-8?B?c3JpZGhhcg==?= | last post by:
would like to know is it recommended to use techniques like object pooling or the using static instances of the proxy class of a web serivice highly appreciate your opinions and recommendations...
3
by: =?Utf-8?B?Q3JhaWc=?= | last post by:
Background: I am building a Windows enterprise application that has separate assemblies for UI, business logic/rules, and data access (i.e. typical N-tier architecture). Many of the assemblies...
4
by: Jon | last post by:
I wrote a VS 2005 C# express programme that accesses a web service. It works fine when there's a direct connection to the internet, but on two different PCs with internet access via a proxy, I get...
1
by: nathan.alden | last post by:
I have a Windows application that must "log in" to a remote service. Once logged in, for all subsequent service calls the Windows application should somehow pass a "session context" in each message...
2
by: | last post by:
Hi all, I have an asp.net 2.0 website that accesses a locally hosted web service. This works fine on servers that are connected to our network. However, I am having a problem with a laptop...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.