Results 1 to 4 of 4

Thread: JAXB2 question

  1. #1

    Default JAXB2 question

    I'm using JAXB2 along with @Endpoint & @Payload annotations. I've been told that using SAX (since it is a stream parser) is significantly faster and memory efficient than JAXB2. Is this true? I can't seem to find any good articles comparing JAXB2 and SAX. I've also been told that by using JAXB2 it is like using RPC and that one doesn't receive the benefits of using document driven services.
    Last edited by mmccaskill; Oct 19th, 2007 at 06:16 PM.

  2. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Well, JAXB2 parses the entire payload to create a Java object from your message. If incoming messages are large, and you don't need to read all of it, then using SAX or StAX directly might be more performing.

    With regard to XML marshalling being less document driven, see http://static.springframework.org/sp...st.html#d0e217. However, marshalling is also quite convenient.

    Luckily for you, Spring-WS offers you the choice: you can handle XML in any way you want to.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3

    Default

    Well I could just use Axiom to build the SOAP instead of SAAJ. But to really get the benefit of Axiom (StAX) I would need to turn off payloadCaching right? Otherwise its roughly the same as SAX or DOM.

  4. #4
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Yes, and the change is only really significant when you are dealing with large documents.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •