File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Distinguish calls to a stateless EJB annotated as Webservice also Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Distinguish calls to a stateless EJB annotated as Webservice also" Watch "Distinguish calls to a stateless EJB annotated as Webservice also" New topic
Author

Distinguish calls to a stateless EJB annotated as Webservice also

Karthik Krishnamurthy
Ranch Hand

Joined: Feb 04, 2005
Posts: 118
Hi,
I have a project, in which there is a stateless ejb, called as both a webservice and through a servlet as well.
I wanted to know if there is any way to distinguish the two calls.

Reason is that there is an interceptor that needs to be called only when the call is made through the webservice, and not through the servlet. Is there any way to do this?

Webservice class:



This gets automatically converted to NetWireService.wsd; by jboss.

There is also call from Servlets like so:

ServiceLocator.getNetWireServiceRemote().getNetwires();


The interceptor should NOT be called in the servlet call.

Any guidance greatly appreciated.

Thanks
KArthik
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I see that you have a @HandlerChain annotation in your code - didn't handlers turn out to be a viable alternative. Handers is the first solution I would try.
Second, if handlers failed, I would consider a servlet filter for the servlet that receives the web service calls. Note that such a servlet filter would have to be configured to ONLY filter calls to the servlet receiving the web service calls and not the other servlet(s).
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Distinguish calls to a stateless EJB annotated as Webservice also