Cannot parse XML message with JAXB org.springframework.oxm.UnmarshallingFailureException Cannot parse XML message with JAXB org.springframework.oxm.UnmarshallingFailureException spring spring

Cannot parse XML message with JAXB org.springframework.oxm.UnmarshallingFailureException


The error message states, that you are trying to parse the local node searchflightsresponse which you do not map within your classes as an annotation.

You have to declare this node as you have done it with the other before.

Please note that using jaxb here to parse a soap response is not advisable because the structure is (as you can see) not trivial. I suggest to download the wsdl and generate client stubs to match the webservice. You then won't need to annotate hundreds of members and classes.

See also here: How to generate java classes from WSDL file


It seems you are creating your beans manually or at least are editing them.Both cases should be avoided. Instead you should try to use available tools to generate Jaxb classes and Soap clients for you. Two very common options are spring webservices or the well known Apache CXF framework.


You need to use wsdl to generate response xml.Building a response xml, that also, so big, is bound to have elements missing.

Here is a tutorial you can use to get your started,

http://www.mkyong.com/webservices/jax-ws/jax-ws-wsgen-tool-example/http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example-document-style/