:)
ohhh , that you can get the location or the file once you have
AxisService in your hand.
by adding init method you can get AxisSrevice (as I told you) , so by
AxisService you can get the file that used to create AxisService
AxisService service = msg.getAxisService();
String location = service.getFileName();
Yariel Ramos Moreno wrote:
> OK... why do I need the service name? Maybe you can give me another
> solution...
>
> I have a XML file into my service, exactly in the root, where there
> are some configuration options for the service work. I most access
> this file from the service classes to get this configuration
> parameters. I'm using System.getProperty("user.dir") to step over the
> tomcat directory, but next I have to concat to this path the rest of
> the path to get the file:
> /webapps/axis2/WEB-INF/services/newsService/config.xml. Is there
> onother way to do this (get the path of an Axis2 web service from the
> service code)?
>
> Thanks again...
>
>
> On 3/18/06, *Deepal Jayasinghe* <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
> 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]>
> > <mailto:[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]>>
> > > <mailto:[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~
>
>
>
--
Thanks,
Deepal
................................................................
~Future is Open~