hmm , it should work :-/ any at the init method what did you get as your service name , or was the AxisServce null , if it is not null then you should be able to get the name.
Yariel Ramos Moreno wrote: > Hi Deepal: > > I have tried the procedure you recomended me, but doesn't work... It > didn't get the name of the WS... Have you another solution? > > Thanks for your help... > > > > On 2/22/06, *Deepal Jayasinghe* <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > yes you can do that , meaning if you want to get the name of the > service > at your service impl class level , you have to following procedure. > add a new method to service impl class called "init" > > class MyService { > String serviceName; > void init(MessageContext msgctx){ > serviceName = msgctx.getAxisService().getName(); > } > //rest o fthe code > > public String myMethod(){ > // you know the name of the sevrice this point > } > } > > > > Yariel Ramos Moreno wrote: > > > Thanks for your help Deepal... > > > > I know that. My problem is that I want to get the name of my WS > in the > > moment I invoke it, from one of the clases implemented in the WS. I > > want to know if there is a class in the Axis2 API that alows me > to do > > that (get my name from code if I'm the invoked WS). > > > > On 2/22/06, *Deepal Jayasinghe* < [EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]> > > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote: > > > > Hi Yariel; > > > > Name of the service will be the name of the archive file if the > > services.xml has only one service element meaning if the > services.xml > > look like below > > <service> > > ////////// service data > > <service> > > > > In the case of servicegroup name of the service will be the > name that > > you specified in services.xml as an example if the > services.xml is > > like > > below; > > <serviceGroup> > > <service name="foo"> > > </service> > > </serviceGroup> > > > > so name of the service will be foo in this case. > > > > Yariel Ramos Moreno wrote: > > > > > How can I retrieve the name of a Web Service deployed in > Axis2 sever > > > in runtime? I mean, when the service is invoked, I need to > get the > > > name of it from inside it in my code. > > > > > > Thanks in advance, > > > > > > Yariel. > > > > > > -- > > Thanks, > > Deepal > > ................................................................ > > ~Future is Open~ > > > > > > > > -- > Thanks, > Deepal > ................................................................ > ~Future is Open~ > > > -- Thanks, Deepal ................................................................ ~Future is Open~
