Re: Detecting wich method was called in a WS contructor
From: Dino Chiesa [Microsoft] (dinoch_at_online.microsoft.com)
Date: 05/17/04
- Next message: Dino Chiesa [Microsoft]: "Re: AXIS Server returning null HELP"
- Previous message: Marina: "Re: ERROR calling webservice: Impossible to execute a program"
- In reply to: DDE: "Re: Detecting wich method was called in a WS contructor"
- Next in thread: DDE: "Re: Detecting wich method was called in a WS contructor"
- Reply: DDE: "Re: Detecting wich method was called in a WS contructor"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 17 May 2004 08:46:43 -0400
It's true there is a pending invocation of a webmethod when the constructor
is invoked but this is not explicit in the programming model. In other
words, your constructor does not know what method is being called. The
method may be known agt some lower level in the stack, but this information
is not provided to the constructor at the time it is invoked.
I get the point that you want to know the method that will be invoked before
it is actually invoked.
When I said, "tell us more, maybe we can help solve it in a different way",
what I meant was, why do you need to know the method before it is invoked?
You said you want to init the object differently depending on how it will be
used in the future. This runs a bit counter to the webservices model, which
is, there is a service that exists, and it exposes methods. Callers invoke
methods. callers generally do not get involved in directly managing the
lifecycle of the service.
But if you don't want to do only initialization (you said "special
treatment"), maybe there is another way.
If you want to do logging, for example, there are ways to do this without
adding a great deal of code, and without adding code to each method.
If there is some other purpose, maybe you could explain it and the group can
explore options.
-Dino
"DDE" <dde@aireinfo.com> wrote in message
news:uPZ5j4XOEHA.904@TK2MSFTNGP12.phx.gbl...
> Hi DIno,
>
> Thanks for your answer, I thought at the time the constructor is invoked,
> the method would be known, since at least it is included in the SOAP
> message, right?
> Anyway, my problem is the following: our development team has to write a
lot
> of Web Services, so I created a couple of standard classes in order to
make
> web service code itself as simple and compact as possible. I have build a
> kind of OurWebService class based on SystemWebservice that contains a
> constructor and a couple of properties and method. One of the things I
> couldn't figure out yet is how to make some initialization or treatment
> depending on the WebMethod which is invoked.
>
> Dominique
>
>
> "Dino Chiesa [Microsoft]" <dinoch@online.microsoft.com> wrote in message
> news:OXuJn3OOEHA.540@TK2MSFTNGP11.phx.gbl...
> > You don't know.
> > The constructor is called before any webmethod is called.
> >
> > If you tell us a bit more about the situation maybe we can help you
solve
> it
> > a different way.
> > -Dino
> >
> >
> > "DDE" <dde@aireinfo.com> wrote in message
> > news:OaSRYADOEHA.644@tk2msftngp13.phx.gbl...
> > > Hi everybody,
> > >
> > > I have a WebService with a constructor to initialize some values comon
> to
> > > all my WebMethods. In this constructor, I would like to identify which
> > > WebMethod was invoked. Is it possible and how?
> > >
> > > Thanks a lot
> > >
> > > Dominique
> > >
> > >
> >
> >
>
>
- Next message: Dino Chiesa [Microsoft]: "Re: AXIS Server returning null HELP"
- Previous message: Marina: "Re: ERROR calling webservice: Impossible to execute a program"
- In reply to: DDE: "Re: Detecting wich method was called in a WS contructor"
- Next in thread: DDE: "Re: Detecting wich method was called in a WS contructor"
- Reply: DDE: "Re: Detecting wich method was called in a WS contructor"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|