You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Espen Falkevik <sp...@yahoo.com> on 2007/01/12 15:04:11 UTC

Servlet filter to retrieve username in call

Hi.
I'm quite new to Axis and webservices. I'm using Axis 1.4 on a weblogic 8.1 server.

I want the user of my webservices to send a username and password to me in their call (in stubfiles: _call.setUsername and _call.setPassword), and then I want to retrieve this in the webservice methods. 

I understood that this is possible by using a servlet filter, but I have very little knowledge of this. Can anyone please tell me which files that needs to be changed and how I should implement the changes.


Regards,
Espen




	
	
		
_________________________________________________________
Alt i én. Få Yahoo! Mail med adressekartotek, kalender og
notisblokk. http://no.mail.yahoo.com

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


Re: Servlet filter to retrieve username in call

Posted by Nilesh Ghorpade <ni...@yahoo.com>.
Hi,
  
  Hope I am not too late in responding to your query. :-)
  
  For the servlet filter you need to write your own class which is a  subclass of Filter and override the doFilter method. You would also  have to enter some configuration details like the filter class, filter  name etc in the web.xml file. If you refer to the Servlet/JSP  specification you would be find the details there.
  
  Secondly if you are using an AXIS service in WebLogic then AXIS does  provide a way of intercepting the requests before the same reaches the  Web Service. This can be achieved using the handler mechanism.   For the handler as well you would have to code a class which would  subclass the AXIS Handler class and its configurations would be entered  in the web.xml file. Using the Handler would be the best approach in my  opinion for an AXIS based service. Once you have the handler you can  retrieve the username and password from the messagecontext and do the  verification. If authenticated then you would be forwarding the request  to the WebService else would be returning a fault code from the Handler  itself.
  
  Hope that helps :-)
  
  
  Regards,
  
  Niles

Espen Falkevik <sp...@yahoo.com> wrote:  Hi.
I'm quite new to Axis and webservices. I'm using Axis 1.4 on a weblogic 8.1 server.

I  want the user of my webservices to send a username and password to me  in their call (in stubfiles: _call.setUsername and _call.setPassword),  and then I want to retrieve this in the webservice methods. 

I  understood that this is possible by using a servlet filter, but I have  very little knowledge of this. Can anyone please tell me which files  that needs to be changed and how I should implement the changes.


Regards,
Espen




 
 
  
_________________________________________________________
Alt i én. Få Yahoo! Mail med adressekartotek, kalender og
notisblokk. http://no.mail.yahoo.com

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



 __________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com