axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Kania (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (AXIS2-3007) RESTful services invocation self induces Input Stream Closed error
Date Thu, 26 Jul 2007 00:43:31 GMT

    [ https://issues.apache.org/jira/browse/AXIS2-3007?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12515460
] 

Jason Kania edited comment on AXIS2-3007 at 7/25/07 5:41 PM:
-------------------------------------------------------------

As an addendum, I have attempted to set the formatter within the client to define an appropriate
content-type for the server and have discovered that the XFormURLEncodedFormatter method getTargetAddress
references static method URLTemplatingUtil.appendQueryParameters which assumes an Envelope
and Body even in a GET method. It then busts when no Envelope is provided.

On the server side, in TransportUtils method creastSOAPMessage line 130, I also noticed that
there are attempts to convert REST messages to the application/xml format when receiving REST
messages which would again blow up for a RESTFUL request.


 was:
As an addendum, I have attempted to set the formatter within the client to define an appropriate
content-type for the server and have discovered that the XFormURLEncodedFormatter method getTargetAddress
references static method URLTemplatingUtil.appendQueryParameters which assumes an Envelope
and Body even in a GET method. It then busts when no Envelope is provided.

> RESTful services invocation self induces Input Stream Closed error
> ------------------------------------------------------------------
>
>                 Key: AXIS2-3007
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3007
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: Windows 2000, Eclipse IDE
>            Reporter: Jason Kania
>            Assignee: Keith Godwin Chapman
>
> When making REST GET calls to an API, Axis 2 core sets its input stream to null and then
complains later that its stream has been closed. The following partial stack trace demonstrates
the problem.
> ApplicationXMLBuilder.processDocument(InputStream, String, MessageContext) line: 49	
> TransportUtils.createSOAPMessage(MessageContext, InputStream, String) line: 130	
> RESTUtil.processURLRequest(MessageContext, OutputStream, String) line: 98	
> AxisServlet$ProcessRESTRequest.processURLRequest() line: 776	
> AxisServlet.doGet(HttpServletRequest, HttpServletResponse) line: 238	
> AxisServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 707	
> AxisServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 820	
> ServletHolder.handle(ServletRequest, ServletResponse) line: 487	
> ...
> In RESTUtil, method processURLRequest, the following call is made on line 98
>                 soapEnvelope = TransportUtils
>                         .createSOAPMessage(msgContext, null, contentType);
> where the null is supposed to be the input stream
> Thus, when line 49 of ApplicationXMLBuilder in method processDocument is encountered,
>             PushbackInputStream pushbackInputStream = new PushbackInputStream(inputStream);
> where inputStream is null,
> the exception "java.io.IOException: Stream closed" is generated once the empty stream
is read at line 51
> of ApplicationXMLBuilder:
>            if ((b = pushbackInputStream.read()) > 0) {
> For straight Axis use, this issue is a blocker, but I have worked around the problem
by filtering empty get methods at the servlet level and am populating them with content for
now.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Mime
View raw message