Announcement Announcement Module
Collapse
No announcement yet.
JAXB2 question Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 06:16 PM.

  • #2
    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.

    Comment


    • #3
      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.

      Comment


      • #4
        Yes, and the change is only really significant when you are dealing with large documents.

        Comment

        Working...
        X