You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew McDowall <an...@edina.co.uk> on 2006/05/01 16:45:04 UTC

How to access WebService implementation from Context?

Hi,

I have a WebService that implements a specific interface (Registerable),
and a Valve who's actions depend upon whether the WebService dealing
with a given request implements this Registerable interface.  What I
need to be able to do, in the invoke method of the Valve, is somehow
say:

if(Request.getContext() ... instanceof Registerable)
{
   // Do some Registration stuff
}

Is there anyway to do this sort of operation?  I tried searching through
Javadocs, Source-Code, and mailing lists but could not find any answers.
Thanks in advance.

 

Andy McDowall. 



--- Disclaimer ---

Unless otherwise agreed expressly in writing by a Director of Edina Software, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. 

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

Re: How to access WebService implementation from Context?

Posted by Tim Funk <fu...@joedog.org>.
If you mean WebService ala SOAP - you are probably out of luck without a lot 
of work.

If you mean webservice as a webpage which does stuff that is intended to be 
called by an application - there might be hope.

If the ENTIRE webapp is considered the webservice, you can run the Valve at 
the Context level and the valve will run for all requests.

Otherwise you'll need to inspect the request to see if it will be mapped to 
your webservice. Of course with SOAP - you may need to inspect some of the 
POST content to determine this - so you'd have to get the content of post 
data in a non-destructive manner.

-Tim

Andrew McDowall wrote:

> Hi,
> 
> I have a WebService that implements a specific interface (Registerable),
> and a Valve who's actions depend upon whether the WebService dealing
> with a given request implements this Registerable interface.  What I
> need to be able to do, in the invoke method of the Valve, is somehow
> say:
> 
> if(Request.getContext() ... instanceof Registerable)
> {
>    // Do some Registration stuff
> }
> 
> Is there anyway to do this sort of operation?  I tried searching through
> Javadocs, Source-Code, and mailing lists but could not find any answers.
> Thanks in advance.
> 
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org