Re: Choosing between Mapping Options
1. For this option you can use Dozer to do the bean mapping and have better control using Java for more complicated transformation that cannot be done with xslt. 2. This option is more natural for xml processing, but some developers (including me) don't like working xslt. Also in one situation we found out that xslt transformation was the bottleneck in route, so changed it back to Java. I've seen it used both in the same project and cannot say whether one is better than the other. It is a matter of taste. HTH, On 21 January 2015 at 07:29, Satyam Maloo maloosat...@gmail.com wrote: We have a camel project requirement where 5 SOAP based CXF services needs to interact with each other. Among these 2 camel projects are consumer and 3 cxf providers. The integration framework used is JBoss Fuse ESB. At the Integration layer we have created a common canonical format xsd. Now we need to do transformations from consumer data format to the common canonical data format and form common data format to provider data format and vice versa. We have the below options available for data mapping: 1. Creating POJO classes from wsdl and common xsd using wsdl2java plugin on wsdl and then in the routes write java converters/mapping (something like targetStructure.set(incomingStructure.get())) 2. Use xslt/xquery for transformation Which is a better option? Java mapping or XLST mapping? Consider that we are using CXF framwork to push data to target system and writing integration flows using Spring DSL Kindly suggest with advantages over the other. Thanks in advance. Satyam - Satyam -- View this message in context: http://camel.465427.n5.nabble.com/Choosing-between-Mapping-Options-tp5761977.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Bilgin Ibryam Red Hat, Inc. Apache Camel Apache OFBiz committer Blog: ofbizian.com Twitter: @bibryam https://twitter.com/bibryam Author of Instant Apache Camel Message Routing http://www.amazon.com/dp/1783283475
Re: Choosing between Mapping Options
Hi I would only suggest xslt if you have experience using it and are comfortable using it. It can be really hard to understand and maintain if it gets big. Plain java code, even if its doing boiler plate get - set is something everybody understands and can maintain. And there is some libraries like dozer (and others) that can do POJO - POJO mapping, if that is required. That is just my thoughts. On Thu, Jan 22, 2015 at 3:20 PM, bharadwaj bharadwaj2...@gmail.com wrote: Camel - provides users java code free environment , it has various components to fulfill users requirement. The best way is to use XQuey?XSLT to form INBOUND / OUTBOUND messages. While XQuery can be used for simple transformations, it lacks the power and sofistication of XSLT (especially templates and the xsl:apply-templates instruction). XSLT is a language that was especially designed to process tree structures. It is still best at doing this. In cases when accessing an XML database it would be a good decision to use (the efficiency of) XQuery to extract the necessary XML nodes and then do the transformation with XSLT from here on. Some XSLT 2.x / XQuery processors do allow this (via extensions) even now. The next wave of XSLT 2.x/XQuery 1.x specifications will most probably make such interoperability an official feature of these languages. -- View this message in context: http://camel.465427.n5.nabble.com/Choosing-between-Mapping-Options-tp5761977p5762022.html Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen - Red Hat, Inc. Email: cib...@redhat.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
Re: Choosing between Mapping Options
Camel - provides users java code free environment , it has various components to fulfill users requirement. The best way is to use XQuey?XSLT to form INBOUND / OUTBOUND messages. While XQuery can be used for simple transformations, it lacks the power and sofistication of XSLT (especially templates and the xsl:apply-templates instruction). XSLT is a language that was especially designed to process tree structures. It is still best at doing this. In cases when accessing an XML database it would be a good decision to use (the efficiency of) XQuery to extract the necessary XML nodes and then do the transformation with XSLT from here on. Some XSLT 2.x / XQuery processors do allow this (via extensions) even now. The next wave of XSLT 2.x/XQuery 1.x specifications will most probably make such interoperability an official feature of these languages. -- View this message in context: http://camel.465427.n5.nabble.com/Choosing-between-Mapping-Options-tp5761977p5762022.html Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Choosing between Mapping Options
Hi Satyam XSLT/XQuery is cleaner, better performing and above all easy to update and maintain. Maintaining or making any change in java object based mapping is more time consuming and calls for code checkout edit , project re compiling / re bundling and re deployments . If xsd undergoes updates , then it might call for more efforts to maintain java mappings. Cheers Reji On 21 Jan 2015 13:00, Satyam Maloo maloosat...@gmail.com wrote: We have a camel project requirement where 5 SOAP based CXF services needs to interact with each other. Among these 2 camel projects are consumer and 3 cxf providers. The integration framework used is JBoss Fuse ESB. At the Integration layer we have created a common canonical format xsd. Now we need to do transformations from consumer data format to the common canonical data format and form common data format to provider data format and vice versa. We have the below options available for data mapping: 1. Creating POJO classes from wsdl and common xsd using wsdl2java plugin on wsdl and then in the routes write java converters/mapping (something like targetStructure.set(incomingStructure.get())) 2. Use xslt/xquery for transformation Which is a better option? Java mapping or XLST mapping? Consider that we are using CXF framwork to push data to target system and writing integration flows using Spring DSL Kindly suggest with advantages over the other. Thanks in advance. Satyam - Satyam -- View this message in context: http://camel.465427.n5.nabble.com/Choosing-between-Mapping-Options-tp5761977.html Sent from the Camel - Users mailing list archive at Nabble.com.