My Rest Service fails to parse the input XML with error:
SAXParseException2; lineNumber: 2; columnNumber: 1; unexpected element
(uri:”http://tempuri.org", local:"execution"). Expected elements are (none)]
<restConfiguration
component="servlet"
bindingMode="xml"
contextPath="{{context.path}}{{api.root.path}}"
port="{{port}}"
enableCORS="false">
<componentProperty key="matchOnUriPrefix" value="true"/>
<endpointProperty key="servletName" value=“restApiServlet"/>
<endpointProperty key="headerFilterStrategy"
value="#headerFilter" />
<dataFormatProperty key="contentTypeHeader" value="false" />
<dataFormatProperty key="objectFactory" value="true" />
<dataFormatProperty key="contextPath" value="org.test.schema"/>
</restConfiguration>
<post type=“org.test.schema.Execution"
outType="org.test.schema.ExecutionResource">
<to uri="direct:create-execution"/>
</post>
The client is posting this payload:
<ns2:execution xmlns:ns2="http://tempuri.org" >
<ns2:scheduledFor>2018-08-29T10:35:55.577-04:00</ns2:scheduledFor>
<ns2:query>cXVlcnkgYnl0ZXM=</ns2:query>
</ns2:execution>
The jaxb classes in package org.test.schema are generated with
maven-jaxb2-plugin, so the package contains ObjectFactory and all proper
annotations.
What else does Camel need to properly bind the XML to the Java class?
Why is it not parsing the XML correctly?
Best regards,
Alex soto