You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Hubert H Leung <hk...@ca.ibm.com> on 2008/03/31 19:30:28 UTC

Getting service EPR programmatically


I am looking for a way to get the EPR of the service programmatically.  In
my service class, I added the init method:
 public void init(ServiceContext serviceContext)

I called serviceContext.getMyEPR() in this method, and the value is null.
(Note that I set the scope of my service to "application".)

However, serviceContext.getMyEPR() returns the right value if I call it in
the service call in an operation method.

When is the EPR set?  Is it possible for me to get the value in the init
method or somehow get notified when the EPR value is initialized?  In my
application, I like to have the ability to get the EPR on startup, and
register with a "broker" automatically.

I thought about formulated the EPR myself in the init method, since I can
get all "ingredients" for the EPR.  I can get the hostname from
AxisConfiguration, port number from TransportInDescription, and service
context parth from ConfigurationContext, and I know the service name.
However, since I am developing my web service using WTP, I noticed that the
context root is "axis2" in init(), but is set to a different value (the
eclipse project name) when I get the context root value in the operation
method.  So it seems like some context values are not finalized when the
init() method was called.  Is there another callback method that's invoked
*after* all initialization is done?

Any help would be appreciated.  Thank you.

_________________________
Hubert Leung
IBM Toronto Lab
hkyleung@ca.ibm.com
905-413-3382


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Getting service EPR programmatically

Posted by David Illsley <da...@gmail.com>.
Hubert,
I don't believe the Axis2 apis will do this for you, however the
JAX-WS 2.1 APIs will. They will be available in Axis2 1.4 which is due
real soon now.
David

On Tue, Apr 1, 2008 at 5:50 AM, Deepal jayasinghe <de...@gmail.com> wrote:
> Hubert H Leung wrote:
>
> > I am looking for a way to get the EPR of the service programmatically.  In
> > my service class, I added the init method:
> >  public void init(ServiceContext serviceContext)
> >
> > I called serviceContext.getMyEPR() in this method, and the value is null.
> > (Note that I set the scope of my service to "application".)
> >
> > However, serviceContext.getMyEPR() returns the right value if I call it in
> > the service call in an operation method.
> >
> > When is the EPR set?
> >
>  When a message receive , i am not quit sure whether we set that at the
> server side.
>  Any way if you are running inside an application severe , you can get the
> EPR as below;
>  configurationContext.getListenerManager().getEPR(service name)
>
>  Thank you!
>  Deepal
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>  For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>



-- 
David Illsley - IBM Web Services Development

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


Re: Getting service EPR programmatically

Posted by Deepal jayasinghe <de...@gmail.com>.
Hubert H Leung wrote:
> I am looking for a way to get the EPR of the service programmatically.  In
> my service class, I added the init method:
>  public void init(ServiceContext serviceContext)
>
> I called serviceContext.getMyEPR() in this method, and the value is null.
> (Note that I set the scope of my service to "application".)
>
> However, serviceContext.getMyEPR() returns the right value if I call it in
> the service call in an operation method.
>
> When is the EPR set?  
When a message receive , i am not quit sure whether we set that at the 
server side.
Any way if you are running inside an application severe , you can get 
the EPR as below;
configurationContext.getListenerManager().getEPR(service name)

Thank you!
Deepal

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org