You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by Christoph Ludwig <lu...@fh-worms.de> on 2008/01/27 16:47:17 UTC

WstxIOException on long base64Binary elements

Hello,

my apologies for cross-posting, but I don't know if the problem we  
face is an Axiom or an Axis2 issue.

We have a Web Service that returns some data as an element of XML  
Schema type base64Binary. The data may be large. (We will eventually  
have to look into MTOM, but right now the data is embedded into the  
SOAP document.)

We prepared the client stub using Axis2's code generator (Axis2 1.3,  
sync style only). For some reasons, we preferred a stub without  
databinding, whence we handle Axiom's OMElements directly. Everything  
seemed to work out ok until the data we sent became large: Suddenly  
we encountered WstxIOExceptions ("Attempted read on closed stream")  
in the client code when we call reponse.getFirstElement().getText().  
Is there anything special you need to be aware of when accessing  
large text nodes via the OMElement interface?

I put the code for a test service and client with junit test on the  
web at <URL:http://festus.textgrid.it.fh-worms.de/misc/testcases/ 
Axis2_LargeBase64.zip>. It shows the error appears as soon as the  
string that is base64 encoded is longer than 2850 bytes. Then we get  
the attached stacktrace.

The catch is: If we generate the client with ADB binding, then it has  
no problems parsing long messages. (The zip file at the URL above  
contains also a testcase for the ADB binding that is analogous to the  
"purely OM based" test case.) We did not dissect and re-engineer the  
generated code in detail yet, but it is obviously possible to handle  
large data with Axiom.

Can anyone tell if we do something wrong in our code? Or is there a  
bug in Axiom or Axis2 that the ADB binding happens to work around?

We appreciate any help.
Regards

Christoph


---
FH Worms - University of Applied Sciences
Erenburgerstr. 19, 67549 Worms, Germany


Re: WstxIOException on long base64Binary elements

Posted by Christoph Ludwig <lu...@fh-worms.de>.
Martin,

On Sun, Jan 27, 2008 at 05:53:49PM -0500, Martin Gainty wrote:
> this is an acknowledged synchronisation bug in Axis2 v1.2
> https://issues.apache.org/jira/browse/AXIS2-3311
> 
> please Upgrade to Axis 2 v1.3 and retest

we are already on Axis2 1.3, so if it is in fact the same bug, then it
persists in 1.3.

However, there are differences between the issue you referred to above and
what we face: For instance, the poster of issue #3311 experiences errors when
he re-sends a request (and he can circumvent them by modifying some bytes in
the request before re-sending). In our case the error is triggered by the
length of the response. Of course, this does not rule out that there is the
same problem at the core of this issue. To be honest, I did not fully
understand yet how Axiom and the Woodstox parser interact (or better: are
supposed to interact), whence I am not sure what exactly goes wrong.

Regards

Christoph


> ----- Original Message -----
> From: "Christoph Ludwig" <lu...@fh-worms.de>
> To: <co...@ws.apache.org>; <ax...@ws.apache.org>
> Sent: Sunday, January 27, 2008 10:47 AM
> Subject: WstxIOException on long base64Binary elements
> 
> 
> > Hello,
> >
> > my apologies for cross-posting, but I don't know if the problem we
> > face is an Axiom or an Axis2 issue.
> >
> > We have a Web Service that returns some data as an element of XML
> > Schema type base64Binary. The data may be large. (We will eventually
> > have to look into MTOM, but right now the data is embedded into the
> > SOAP document.)
> >
> > We prepared the client stub using Axis2's code generator (Axis2 1.3,
> > sync style only). For some reasons, we preferred a stub without
> > databinding, whence we handle Axiom's OMElements directly. Everything
> > seemed to work out ok until the data we sent became large: Suddenly
> > we encountered WstxIOExceptions ("Attempted read on closed stream")
> > in the client code when we call reponse.getFirstElement().getText().
> > Is there anything special you need to be aware of when accessing
> > large text nodes via the OMElement interface?
> >
> > I put the code for a test service and client with junit test on the
> > web at <URL:http://festus.textgrid.it.fh-worms.de/misc/testcases/
> > Axis2_LargeBase64.zip>. It shows the error appears as soon as the
> > string that is base64 encoded is longer than 2850 bytes. Then we get
> > the attached stacktrace.
> >
> > The catch is: If we generate the client with ADB binding, then it has
> > no problems parsing long messages. (The zip file at the URL above
> > contains also a testcase for the ADB binding that is analogous to the
> > "purely OM based" test case.) We did not dissect and re-engineer the
> > generated code in detail yet, but it is obviously possible to handle
> > large data with Axiom.
> >
> > Can anyone tell if we do something wrong in our code? Or is there a
> > bug in Axiom or Axis2 that the ADB binding happens to work around?
> >
> > We appreciate any help.
> > Regards
> >
> > Christoph
> >
> >
> > ---
> > FH Worms - University of Applied Sciences
> > Erenburgerstr. 19, 67549 Worms, Germany
> >
> >
> 
> 
> ----------------------------------------------------------------------------
> ----
> 
> 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 

-- 
FH Worms - University of Applied Sciences
Fachbereich Informatik / Telekommunikation
Erenburgerstr. 19, 67549 Worms, Germany

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