I have a JBossWS (1.2.0) web service bound to a SSB. I have specified the port-component in jboss.xml as follows:
This works great, and I the WS is bound to http://hostname/testWS/API.
Is there a way, programmatically to get the <port-component-uri> setting from my SessionBean in jboss.xml? I need to publish this URL in a different location in my application, and I know the JBossWS war file does this, but I'd like a code snippet from someone that knows how this works.
Any help would be appreciated.
If you are using EJB 2.1 then you can make your bean implement ServiceLifecycle, which will give you an init method. That method passes the ServletEndpointContext, which allows you to get at the ServletContext, and you can get the URL from that.