Monday, December 1, 2008

SAAJ Performance Issues

Java 1.6 comes with the SOAP with attachments API for Java (SAAJ). It's really easy to set up a stand alone web service endpoint using SAAJ and this tutorial (free registration required) tells you how to get one up and running.

For one of my projects I wanted a quick and dirty demo I could run from the command line, using Ant, that started a service and demonstrated a client call. What I ran into, though, was that it was taking forever for the client to access the response message body after the call. The result value was about 80K but it was still taking about three miniutes of wall time for the call to SOAPMessage::getSOAPBody to complete! It turns out that this is a bug in Java 1.6 (I'm running 1.6_0_06 but I believe I saw the same problem under release _10 as well). The fix posted here works. I now get my data back in milleseconds rather than minutes.

No comments:

 
Creative Commons License
finegameofnil by Clay Fink is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.