camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Convert CXFRS XML Response To HL7 Format
Date Mon, 29 Mar 2010 10:30:31 GMT
Hi

Its just a lot to explain about data transformation.
I would suggest to read chapter 3 in the Camel in action book which
covers this concept in 30+ pages.



On Mon, Mar 29, 2010 at 11:42 AM, jejmaster <jejmaster@gmail.com> wrote:
>
> Hi,
>
> I would like to inquire regarding converting a CXFRS XML Response to HL7
> Format. Currently I have this cxfrs route:
>
> <cxf:rsServer id="restRouter" address="/restRouter/"
> serviceClass="com.project.service.impl.ServiceManagerImpl" />
>
> <cxf:rsClient id="restEndpoint"
> address="http://localhost:8080/services/rest"
> serviceClass="com.project.service.impl.ServiceManagerImpl" />
>
> <route>
>     <from uri="cxfrs:bean:restRouter"/>
>      <process ref="hl7Processor"/>
>     <to uri="cxfrs:bean:restEndpoint"/>
> </route>
>
> <bean id="hl7Processor" class="com.slmc.camel.processor.HL7Processor"/>
>
> What I am trying to do is to process the Exchange and getting the in message
> object then setting the out message with my parsed HL7 String.
>
> Here's my implementation of the HL7Processor:
>
> public class HL7Processor implements Processor {
>    private static Logger logger = Logger.getLogger(HL7Processor.class);
>
>    @Override
>    public void process(Exchange exchange) throws Exception {
>        logger.debug("entering `process` method...");
>        PatientTO patientTo = exchange.getIn().getBody(PatientTO.class);
>        String hl7XML = convertToHL7(patientTo);
>        exchange.getOut().setBody(hl7XML, String.class);
>    }
>
> }
>
> The current effect is that I am getting null on patientTO. Here are my
> questions:
>
> 1. During the exchange of two cxfrs endpoints, what should be the type of
> exchange.getIn().getBody(..)?
> 2. Is this the correct solution for my goal?
>
> Thanks in advance!
> --
> View this message in context: http://old.nabble.com/Convert-CXFRS-XML-Response-To-HL7-Format-tp28066971p28066971.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message