I'm surprised that you haven't received any replies on this.
Since both the web and ejb tiers are deployed in a single application unit, it appears that using a local interface would be the best solution. An EJB's local interface can be bound into global JNDI space using the <local-jndi-name> in jboss.xml.
This local interface is accessible from the web tier, but how you do this depends on exactly what you're trying to accomplish.
We might be able to offer more helpful information if you could provide a more complete description of what you're trying to do.
May be my question was not clear enough.
I have a web-service(WS) deployed on machine A. On machine B I have an enterprise application which includes web-app and jboss service sar.
It quite simple to access the webservice from the web-app. I can add a reference onto the ws into web.xml file, and the service will be accessible from java:comp/env namespace.
BUT, I could not find such way for jboss service. Is there a way to access my WS from the SAR without usage of direct JAX-RPC API?
Is there a way to access my WS from the SAR without usage of direct JAX-RPC API?
(I'm learning this as I go, but) I don't see how this can be done without writing the MBean as a WS client.
Are you using JBoss 4? Then (at the risk of telling you something obvious that you already know) you should be able to bind your WS endpoint on machine A using <service-ref>, and the SAR code on machine B could obtain the endpoint using a remote JNDI lookup on machine A.
MBeans don't have an environment context. It is indeed arguable that JBoss specific XMBeans (that already have a descriptor) could support JNDI lookup from java:comp/env, but currently we don't have it.
Is it not possible for you service mbean to go through a SLSB deployed on the same box to access the remote WS?
Yes, I suppose usage of the SLSB(StateLess Session Bean right?) via JNDI is the only right way.
Thanks for help.