We are trying to utilize the xpath router in conujunction with XMLBeans. We originally had a marshalling interceptor on the channel (commented out below) which seemed to work pretty well except the DefaultXmlPayloadConverter.convertToDocument method does not seem to handle payloads with xmlbean objects.
We are guessing we can implement a PayloadConverter for XMLBeans, but we could not find where to set it in configuraiton. Maybe we are just not looking in the correct place?
We tried to let the message path through to the router and let it parse it, but the message is not parse as the node object is null when it reaches the DefaultXmlPayloadConverter.convertToNode . No exception is thrown so not sure yet what the issue issue. Entity resolution maybe?
Any assistance would be great. Thanks again.
Code:
lt;int:channel id=quot;channelAquot;gt;
lt;!--
lt;int:interceptorsgt;
lt;bean id=quot;transformingInterceptorquot; class=quot;org..integration.transformer.MessageTransformingChannelInterceptorquot;gt; lt;constructor-arggt; lt;ref bean=quot;payloadUnMarshallingTransformerquot;/gt; lt;/constructor-arggt;
lt;/beangt;
lt;/int:interceptorsgt;
--gt;
lt;/int:channelgt;
lt;bean id=quot;payloadUnMarshallingTransformerquot; class=quot;org..integration.xml.transformer.UnmarshallingTransformerquot;gt; lt;constructor-arggt; lt;bean class=quot;org..oxm.xmlbeans.XmlBeansMarshallerquot;gt; lt;property name=quot;validatingquot; value=quot;truequot; /gt; lt;/beangt; lt;/constructor-arggt;
lt;/beangt;lt;int-xml:xpath-router id=quot;xpathRouterquot; input-channel=quot;channelAquot; resolution-required=quot;truequot; gt;
lt;int-xml:xpath-expression id=quot;xpathExpquot; expression=quot;/docroot/@typequot;/gt;
lt;int-xml:mapping value=quot;typeAquot; channel=quot;typeAChannelquot; /gt;
lt;int-xml:mapping value=quot;typeBquot; channel=quot;typeBChannelquot; /gt;
lt;/int-xml:xpath-routergt;The XPathRouter class does expose a setter for the converter however this is not currently exposed in the Spring Integration XML namespace. Therefore to make use of this you would need to define the router using the standard Spring beans namespace an set the property with a reference to your new strategy. Feel free to add an improvement to JIRA if you think exposing this would be helpful.Jonas |