Results 1 to 10 of 28

Thread: JiBX unmarshalling - DOM error

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Posts
    23

    Default JiBX unmarshalling - DOM error

    I am using the JiBX marshaller/unmarshaller - when the XML message reaches the the endpoint class [a type of AbstractMarshallingPayloadEndpoint] I get an error that reads: "JibxMarshaller does not support unmarshalling of DOM Nodes..." - am I missing a property setting in the bean(s)??

    I am using build .9 so I had to declare the JibxFactory bean (etc.) which is no longer required in 1.x, was this a bug that has been resolved in a more recent build?

    thanks!
    Ron

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

    Default

    It is not a bug, it is a feature of Jibx mentioned in both the Javadoc and the reference manual:

    Note that the JibxMarshaller only operates on raw I/O streams, and not on DOM nodes, nor SAX handlers.
    Since SAAJ is based on DOM, you cannot use it in combination with Jibx. Rather than convert the entire DOM tree to a byte buffer, and unmarshal from that, I decided to throw an exception and mention the behavior in the Javadocs, since the conversion process might be slow.

    I could add an option to the JibxMarshaller to allow for this conversion, but I think the whole speed advantage of Jibx will go away.

    It might be that this feature was fixes in the recently released Jibx 1.1, I have not checked that version out yet.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    Jun 2006
    Posts
    23

    Default how do I fix this problem then?

    OK- so how do I correct this? Is it a fix on the client side such that it does not send and XML SOAP block?? Or is it a fix on the server side not to convert the incoming XML to a SOAP message (so I should use a different dispatcher?)?

    Can I get some more help/guidance on this one please? Any example code/cofiguration would be great.

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

    Default

    Quote Originally Posted by rwilcom
    OK- so how do I correct this? Is it a fix on the client side such that it does not send and XML SOAP block?? Or is it a fix on the server side not to convert the incoming XML to a SOAP message (so I should use a different dispatcher?)?

    Can I get some more help/guidance on this one please? Any example code/cofiguration would be great.
    I'm sorry if I wasn't helpful before, let me improve on that.

    The current implementation of the JibxMarshaller does not work with DOM, and therefore SAAJ. So you can either use a different Marshaller such as the Jaxb2Marshaller, or you can wait until I provide a fix for this.

    My preferred way of fixing this is figuring out if Jibx 1.1 does support DOM, and use that. If that is not possible, I can convert incoming DOM documents to streams, and unmarshal from those. This conversion behavior will probably be optional, because it can decrease performance, and not all users will want that.

    I've created a JIRA issue for this here, which you can track for progress.

    Hope that makes things a little clearer,
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  5. #5
    Join Date
    Jun 2006
    Posts
    23

    Default

    Ok, thanks - so lets say I wanted to use JiBX to take advantage of the performance? How do I do that without using DOM/SAAJ? I have control of both client and server so I am not against sending an XML I/O stream - but the question is how does it get dispatched to the proper marshaller/endpoint on the server side? The examples I have must parse to the SOAP body (payload element name) then on to the endpoint based on the value of the first element (tag) - is there some direct way to dispatch to an endpoint?

    Correct me on this (?) - but the negative side to using JiBX is that it is not going to employ the standard web services protocol since the client can't send an XML SOAP (XML) message?

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

    Default

    Quote Originally Posted by rwilcom
    Ok, thanks - so lets say I wanted to use JiBX to take advantage of the performance? How do I do that without using DOM/SAAJ?
    I am currently working on a way to do this. The idea is to use Axiom instead of SAAJ for generating SOAP messages. Axiom is based on StAX, and JiBX supports StAX as well. However, the JibxMarshaller doesn't yet, but I'm working on it. So, when I'm done with this feature, you can use the AxiomSoapMessageContextFactory (instead of the SaajSoapMessageContextFactory), and all should be well.

    Quote Originally Posted by rwilcom
    I have control of both client and server so I am not against sending an XML I/O stream - but the question is how does it get dispatched to the proper marshaller/endpoint on the server side? The examples I have must parse to the SOAP body (payload element name) then on to the endpoint based on the value of the first element (tag) - is there some direct way to dispatch to an endpoint?
    You can use an endpoint mapping which is not based on the content, such as the SoapActionEndpointMapping, which uses the SOAPAction HTTP header. It is used in the airline sample.

    Cheers,
    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
  •