Hi,
I have a (stupid) question on why web service class needs an instance.
Everybody knows its stateless then why cant it can be standardized that all
methos in web service class should be static. For eg I create an instance
websrv.
I have 2(set/get) methods and a private variable 'name'.
websrv.setName( "Hello"); and in next line if I call
websrv.getName( ) obviously it wont work. then why cant we make it static. 4 1469
Ravi <Ra**@discussio ns.microsoft.co m> wrote: I have a (stupid) question on why web service class needs an instance. Everybody knows its stateless then why cant it can be standardized that all methos in web service class should be static. For eg I create an instance websrv. I have 2(set/get) methods and a private variable 'name'. websrv.setName( "Hello"); and in next line if I call websrv.getName( ) obviously it wont work. then why cant we make it static.
Actually, I think it *might* work, depending on how the web service
deals with sessions.
More importantly though, the methods can't be static because of the
various instance properties to do with the web service class which are
needed to know what server to contact etc - things like the url, the
proxy etc.
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Ravi wrote: Hi, I have a (stupid) question on why web service class needs an instance. Everybody knows its stateless then why cant it can be standardized that all methos in web service class should be static. For eg I create an instance websrv. I have 2(set/get) methods and a private variable 'name'. websrv.setName( "Hello"); and in next line if I call websrv.getName( ) obviously it wont work. then why cant we make it static.
You should use remoting.
--
Texeme Textcasting Technology http://www.texeme.com
Ravi,
In addition what Jon wrote.
I am not sure about a webservice, however I would not know why it would
works different.
In any webapplication does the serverside application belongs to all active
clients.
For me it is a multitier especially if you use static/shared classes.
The application running in the Client inside IE is the client (it is a real
application running in IE, even if you don't think in it in that way)
The Dll on the serversides gives requested data (even if it is the first
time nothing) to the clients and processes returned data.
The database (whatever it is) holds the data.
When there are no more sessions active, than the program ends and you have
to initialize everything new.
I hope this gives an idea
Cor
Thanks for that. Yes what you said makes sense if its happening in web
applications then web service is no different.
"Cor Ligthert" wrote: Ravi,
In addition what Jon wrote.
I am not sure about a webservice, however I would not know why it would works different.
In any webapplication does the serverside application belongs to all active clients.
For me it is a multitier especially if you use static/shared classes.
The application running in the Client inside IE is the client (it is a real application running in IE, even if you don't think in it in that way)
The Dll on the serversides gives requested data (even if it is the first time nothing) to the clients and processes returned data.
The database (whatever it is) holds the data.
When there are no more sessions active, than the program ends and you have to initialize everything new.
I hope this gives an idea
Cor This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Liza |
last post by:
Hi guys, i'm trying to build a web service.......
is there such thing as polymorphism in web services? i mean could i
have two web services of the same name but different arguments such
that i could construct the following use case
Actor : WebServiceRequestor
|
by: annoyingmouse2002 |
last post by:
Hi there,
sorry if this a long post but I'm really just starting out. I've been
using MSXML to parse an OWL but would like to use a different
solution. Basically it reads the OWL (Based on XML) and puts values in
a number of arrays and then puts the contents of the array in a HTML
table. I'd like to keep the array structure. I've checked out all
sorts of different javascript parsers but have not met with a great
deal of success with any...
|
by: AMDIRT |
last post by:
I have a few questions about IssueVision (from WindowsForms) concerning its
scalability and performance. Rather, if I were to implement techniques
described here into another application, how would it perform, how well will
it scale, and what considerations should I be take into account?
First, let me say that I appreciate the work done to get this application
out there for me to look over. I continually refer to it and I think I am...
|
by: Zeng |
last post by:
I'm trying to comparing 2 objects (pointer to object) to see if they are the
"same" as each other. Here is what the definition of being the "same"
object type for both objects, object 1, object 2, same?
-----------------------------------------------------------
Decimal 199677 199677 yes
String "hello" "hello" yes
null null
yes
|
by: Chris Becker |
last post by:
This is my attempt to rephrase a question I asked earlier that got no
response. I suspect it was my poor/unplanned wording. Here is another
attempt:
I have a form with some drop down lists. I would like the user to be able
to start filling in the form, then get to one of the dropdown lists (ex:
Service Type) and realize that the dropdown list does not contain the entry
that they need. So next to the Service Type drop down list is a...
| |
by: Mike Miller |
last post by:
Question: How do you develop a web service that uses unknown types?
The ideas is that my web service performs a generic function. I want
anyone to be able to consume it, but I can't know what type of objects
they are going to pass to in (like I said it performs some generic
functionality - I don't want to recompile it ever).
So I create a simple web service with with a method like:
string GetTypeInfo(object t){
|
by: Ravi |
last post by:
Hi,
I have a (stupid) question on why web service class needs an instance.
Everybody knows its stateless then why cant it can be standardized that all
methos in web service class should be static. For eg I create an instance
websrv.
I have 2(set/get) methods and a private variable 'name'.
websrv.setName("Hello"); and in next line if I call
websrv.getName() obviously it wont work. then why cant we make it static.
|
by: et |
last post by:
I am new to asp.net. I am writing a program that will revolve around an
extensive client database, and wonder what the best way to design the
program is, using classes. I have about 10 different sections, or
categories if you will, about a client. For instance, some clients have
data regarding our Estate Planning section, some clients have data regarding
our Real Estate section, etc. Would it be better to have one object that...
|
by: =?Utf-8?B?SmVhbi1GcmFuY29pcyBCcmV0b24=?= |
last post by:
"siddharthkhare@hotmail.com" wrote:
The context is important in this kind of design concern : I assume there's a
lot of user and that application will evolve to add richer functionality.
My first concern would be to separate the business logic code from data
contener : the new code would look like that :
LineItemBusinessComponent.Delete(LineItemBusinessEntity)
Exposing CRUD component isn't the best thing to do because your presentation...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |