You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Martin Senger <se...@ebi.ac.uk> on 2002/05/20 15:18:01 UTC

more services represented by the same class

   I have this wish (or rather a problem):
   I would like to use the same class for several web services. The class
(or its instance or instances) would work slightly differently depending
on either an input parameter, or on the service name it was used for 
invoking a particular class instance.
   So I am looking for how my class can know which service name it was 
called as, or how my class can have access to its deployment descriptor 
and its <parameter...> stuff.
   I see several solutions - but none of them is clear or ideal - and I am
looking for help to find a better (more straightforward) solution or for
confirmation that there is none other:

   1) I can write my class as an extension of a BasicHandler - in such 
case the class will have access to a MessageContext - and through it to 
all information it needs. But what will be a real "target service"? Or how 
can a Handler produce a response to the requesting client?

   2) I can write my own version of RPCProvider and change there the
invocation method calling my class (so I can pass, for example, a
parameter in the constructor, or something similar). But the RPCProvider
seems to be written in a way that it is not straightfowrad to inherit from
and re-write only small part.  Also this may be changed in the future I
guess. Generally, this seems as a heavyweight solution. Should I go this
way anyway?

   3) If I get an access to the whole SOAP envelope there surely is a
service name (and that would be sufficinet for me). But how can I do it
(if I can at all)?

   Thanks for any help,
   regards, Martin

-- 
Martin Senger

EMBL Outstation - Hinxton                Senger@EBI.ac.uk     
European Bioinformatics Institute        Phone: (+44) 1223 494636      
Wellcome Trust Genome Campus             (Switchboard:     494444)
Hinxton                                  Fax  : (+44) 1223 494468
Cambridge CB10 1SD
United Kingdom                           http://industry.ebi.ac.uk/~senger


an access to a MessageContext

Posted by Martin Senger <se...@ebi.ac.uk>.
I haven't got any reply to my question posted earlier as "more services
represented by the same class". I am afraid that my question was not 
clear. So I am trying now in a simpler way:
   Is there a way how my class, loaded by a normal java:RPC provider, can
find in which context it was called?  For example, to get hand on the
MessageContext would be perfect. Note please that my provider is java:RPC,
not java:MSG.

   Thanks for any help or pointers.
   Martin

-- 
Martin Senger

EMBL Outstation - Hinxton                Senger@EBI.ac.uk     
European Bioinformatics Institute        Phone: (+44) 1223 494636      
Wellcome Trust Genome Campus             (Switchboard:     494444)
Hinxton                                  Fax  : (+44) 1223 494468
Cambridge CB10 1SD
United Kingdom                           http://industry.ebi.ac.uk/~senger