GeeCON Prague 2014*
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


JavaRanch » Java Forums » Java » Web Services
Bookmark "Problems reading the request.inputStream() " Watch "Problems reading the request.inputStream() " New topic
Author

Problems reading the request.inputStream()

Ricuzzo Ric
Greenhorn

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:

requestMsg.getSOAPPart();

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
Bartender

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


Spritle Software Blogs
 
GeeCON Prague 2014
 
subject: Problems reading the request.inputStream()