This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Web Services and the fly likes Problems reading the request.inputStream() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problems reading the request.inputStream() " Watch "Problems reading the request.inputStream() " New topic

Problems reading the request.inputStream()

Ricuzzo Ric

Joined: Oct 25, 2005
Posts: 1
Hi to all!
I have this question on how to process some information of a SOAP message before it reaches the AxisServlet.
I have a Struts applicacion that can fire a web service, some client in some other computer and platform (.NET) executes this web service as usual.
In my struts action, if everything goes alright, i forward the request to axisServlet and execute my webservice.
But, i want to handle the soap message before forwading to the axis servlet, cause i want to check some soap message params.
The problem is that when i get the message from the request:

Message requestMsg = new Message(request.getInputStream(),false, ...)

And the I do something like getting the SOAP Part:


I am consuming the inputStream from the request, so if everything is ok, and then forwading to the axis servlet I get the following error:

faultString: org.xml.sax.SAXParseException: Premature end of file.

Which simply means that the inputStream is not closed, but it is locked and has no "available" bytes to read, so is very much the same like having no soap message, throwing that SAX exception because there is no a xml to read actually.
How coud i solve this issue? or is there any othr way to preprocess the soap message in my action?

TY very much!!!
Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
See whether you can use Axis Handler ??

Spritle Software Blogs
I agree. Here's the link:
subject: Problems reading the request.inputStream()
It's not a secret anymore!