the doFilter method of Filter has this prototype
public void doFilter(ServletRequest request,
You can get the output stream using the following code
ServletOutputStream out = response.
It is the responsibility of the container (implementing servlet api 2.3 or above) to call the doFilter method with the correct args -- even in the case of a web service.
Hope it helps.