aspose file tools*
The moose likes Servlets and the fly likes Problem when using Servlet filter in front of a web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Problem when using Servlet filter in front of a web service" Watch "Problem when using Servlet filter in front of a web service" New topic
Author

Problem when using Servlet filter in front of a web service

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reading my post
Can some one pelase let me know what is wrong with this filter?



the above code return an exception like following one in the server:






in the client side which is a web service client (filter works on any
request come to my web applicaton)
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi,

can you put


before the 'read'?

Herman
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5


That is a very common error - available() is NOT the same as the total length of the request body - try the content length header or read into an expandable buffer - like ByteArrayOutputStream.

Bill
 
 
subject: Problem when using Servlet filter in front of a web service