1 Reply Latest reply on Apr 8, 2005 8:20 PM by Jason Greene

    Does anybody know...

    Pawel Polyakov Newbie

      Does anybody know the extension point in which I can compress\decompress SOAP messages of my EJB-based rpc/literal webservice?
      I've tried a lot but I don't know where to put the compression. First I've try to extend GenericHandler and configure if trough webservices.xml. It didn't work because after my compression and inside jboss the RuntimeException of classcasting occured. I've looked through jboss src of HandlerChainImpl (and other classes around this problem) and point out that there are a lot of work after my compression was done in which the response message were retrieved as org.jboss.axis.Message but after compression it was not a Message.
      Next I proceed to extend BasicHandler and configure it in axis-server-config.xml in default\deploy\jboss-ws4ee.sar\META-INF. This didn't work too, in that time the exception was in
      org.xml.sax.SAXParseException: Content is not allowed in prolog.
      So I've looked through other classes and point out that after my compression response message(again) is treated as Message, not byte[] or something similar.
      I don't want to flood here with about 100 lines of code of different files which I use during my investigation :). Every time i know that in my handlers message was transformed into gzipped couple of bytes without any exceptions. I know this very well.
      So, I'm in trouble - on the one hand compression is very useful on other - in what place I must do it(what class to extend or what method to override etc)?

        • 1. Re: Does anybody know...
          Jason Greene Master

          When you modify the message it still has to be legitimate xml, so you really cant just gzip the entire xml section. The exception to this is attachments, those can be binary because the xml is sent in a multipart/related bundle. You are free to compress the data, then base64 it and put it in the document, but you will have to have JAX-RPC handlers on both sides.

          If all you really want is transport compression, then just enable compression in your tomcat config.