You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by jayasreeb <ja...@infosys.com> on 2008/07/02 13:36:08 UTC

XML to Java Transformation in Service Mix

Hi,

My requirement is to transform XML to Java objects in service mix.
How can I do this?Can you provide me an example for this?
-- 
View this message in context: http://www.nabble.com/XML-to-Java-Transformation-in-Service-Mix-tp18235528p18235528.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: XML to Java Transformation in Service Mix

Posted by Lars Heinemann <la...@compart.net>.
Hi,

you could write a servicemix-bean service unit using the
XStream library to serialize/deserialize Java objects to and from xml.

Have a look at: http://xstream.codehaus.org/

Regards
Lars



On Wednesday 02 July 2008 13:36:08 jayasreeb wrote:
> Hi,
>
> My requirement is to transform XML to Java objects in service mix.
> How can I do this?Can you provide me an example for this?


Re: XML to Java Transformation in Service Mix

Posted by jayasreeb <ja...@infosys.com>.
Hi

If i have created servicemix-bean as per steps suggested by you and after
that I want to use it as webservice using JMS then what do I need to do?

Jayasree



lhe77 wrote:
> 
> 1. create a servicemix-bean service unit (via mvn or via smx-arch tool)
> 2. change the dependencies of your SU's pom to use xstream
> 3. adapt the existing class (it's created automatically for you) to grab
> the 
> xml from the incoming message and transform it via xstream into java
> objects.
> 
> Hint: 
> - the java objects (if not J2SE objects) should be available to the bean
> - read the xstream user guide on how to do it
> 
> Btw. you can do the same with castor as well.
> 
> Lars
> 
> 
> 
> On Wednesday 02 July 2008 13:51:16 jayasreeb wrote:
>> HI
>>
>> can you give me an existing example to do this?
>> I have done xml to java transformation using castor  in java platform.
>> Will I be able to replicate same in service mix platform also..
>>
>> jayasreeb wrote:
>> > Hi,
>> >
>> > My requirement is to transform XML to Java objects in service mix.
>> > How can I do this?Can you provide me an example for this?
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/XML-to-Java-Transformation-in-Service-Mix-tp18235528p18237467.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: XML to Java Transformation in Service Mix

Posted by Lars Heinemann <la...@compart.net>.
1. create a servicemix-bean service unit (via mvn or via smx-arch tool)
2. change the dependencies of your SU's pom to use xstream
3. adapt the existing class (it's created automatically for you) to grab the 
xml from the incoming message and transform it via xstream into java objects.

Hint: 
- the java objects (if not J2SE objects) should be available to the bean
- read the xstream user guide on how to do it

Btw. you can do the same with castor as well.

Lars



On Wednesday 02 July 2008 13:51:16 jayasreeb wrote:
> HI
>
> can you give me an existing example to do this?
> I have done xml to java transformation using castor  in java platform.
> Will I be able to replicate same in service mix platform also..
>
> jayasreeb wrote:
> > Hi,
> >
> > My requirement is to transform XML to Java objects in service mix.
> > How can I do this?Can you provide me an example for this?


Re: XML to Java Transformation in Service Mix

Posted by jayasreeb <ja...@infosys.com>.
HI

can you give me an existing example to do this?
I have done xml to java transformation using castor  in java platform.
Will I be able to replicate same in service mix platform also..


jayasreeb wrote:
> 
> Hi,
> 
> My requirement is to transform XML to Java objects in service mix.
> How can I do this?Can you provide me an example for this?
> 

-- 
View this message in context: http://www.nabble.com/XML-to-Java-Transformation-in-Service-Mix-tp18235528p18235769.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.