Spring Web Services
  1. Spring Web Services
  2. SWS-302

Need to prevent parsing server-side responses and client-side requests into axiom trees if using axiom and payload caching is off

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5 RC1
    • Fix Version/s: 1.5.2
    • Component/s: Core
    • Labels:
      None

      Description

      If using the axiom message factory with payload caching turned off, spring-ws currently supports streaming a request on the server-side and a response on the client-side without parsing the stream into an axiom tree. But responses on the server-side and requests on the client-side do get parsed into axiom trees. So turning off payload caching is non-symmetrical.

      If this can be prevented, then spring-ws should be able to support large client requests and large server responses with much better performance. This also would even help with medium-sized messages in high volume scenarios.

      The AxiomSoapBody's getPayloadResult() method currently creates a custom SAX Content Handler that effectively builds an axiom tree for the payload during transforms involving the payload result. The proposed enhancement is to basically have getPayloadResult() return a subclass of StreamResult feeding a ByteArrayOutputStream, and then in the AxiomSoapMessage's writeTo() method insert an Axiom OMSourcedEle as the payload, containing a custom OMDataSource built around the above ByteArrayOutputStream. This allows a 'placeholder' for the payload in the axiom tree containing the raw payload XML, and when writeTo() serializes the axiom message to the transport's output stream, the raw payload XML is written to the output stream without ever getting parsed. It is a little more involved than the above, but that describes the highlights.

      If something like an interceptor, client-side callback, or logging code needs to access the contents of the payload, axiom will automatically parse the contents of the OMDataSource into a fully expanded Axiom tree. So this gives the flexibility of accessing the payload data if need be, but does not parse it into axiom nodes unless absolutely needed.

      I am preparing a patch of contribution files that does the above. I mainly just need to wrap up the unit tests and do some performance testing, and then I will attach the patch.

        Issue Links

          Activity

          Hide
          Arjen Poutsma added a comment -

          I downgraded to 1.2.6, because I couldn't find an announcement for 1.2.7 either.

          I am not so worried about requiring 1.2.6, because it is only applicable if you disable payload caching. For the default case, you can still use 1.2.5.

          Thanks!

          Show
          Arjen Poutsma added a comment - I downgraded to 1.2.6, because I couldn't find an announcement for 1.2.7 either. I am not so worried about requiring 1.2.6, because it is only applicable if you disable payload caching. For the default case, you can still use 1.2.5. Thanks!
          Hide
          Erik-Berndt Scheper added a comment -

          Axiom 1.2.7 contains a fix for Axis2 1.4 and is included in the Axis2 1.4 distribution. See http://markmail.org/message/brgnp5tb4vmq6ysu?q=axiom+dev+mail for more details.

          Therefore it should be fine to use Axiom 1.2.7. (though it's a bit sloppy not to officially announce it on the ws-commons site).

          Show
          Erik-Berndt Scheper added a comment - Axiom 1.2.7 contains a fix for Axis2 1.4 and is included in the Axis2 1.4 distribution. See http://markmail.org/message/brgnp5tb4vmq6ysu?q=axiom+dev+mail for more details. Therefore it should be fine to use Axiom 1.2.7. (though it's a bit sloppy not to officially announce it on the ws-commons site).
          Show
          Erik-Berndt Scheper added a comment - See also http://forum.springframework.org/showthread.php?t=54331
          Hide
          Arjen Poutsma added a comment -

          OK, i'll upgrade again .

          Show
          Arjen Poutsma added a comment - OK, i'll upgrade again .
          Hide
          Arjen Poutsma added a comment -

          Closing issues in 1.5.2

          Show
          Arjen Poutsma added a comment - Closing issues in 1.5.2

            People

            • Assignee:
              Arjen Poutsma
              Reporter:
              Jim Cummings
            • Votes:
              3 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5d
                5d
                Remaining:
                Remaining Estimate - 5d
                5d
                Logged:
                Time Spent - Not Specified
                Not Specified