You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by "johnbarleycorn_81@libero.it" <jo...@libero.it> on 2009/01/10 13:35:27 UTC

Sending Object between cxf-se published in servicemix

Hi all,

I have to implement this type of communication:

external client <====> cxf-bc_1 <====> cxf-se_1 <====> bean-se <====> cxf-se_2

now I send message from cxf-se_1 to bean-se, and then to cxf-se_2, like this:

int in0 = 1;
String messageStringContent = "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
+ "  <part>"
+ "    <doLogin xmlns='http://myproject.com/NDWS3/types'>"
+ "      <arg0>" + in0 + "</arg0>"
+ "    </doLogin>"
+ "  </part>"
+ "</message>";
inOutExchange.getInMessage().setContent(new StringSource(messageStringContent));

So I had transformed in0 in a String.
If I have to send an Object, for example a  Person, 
from cxf-se_1, so that cxf-se_2 can recognize it, how I should transform it to a String to send through a Normalized Message and so that I can communicate it to cxf-se_2 (that is implemented as a simple POJO)?

I'll be very grateful for every suggestion you would send.
Thank you in advance. 
Best Regards,
anna




Re: Sending Object between cxf-se published in servicemix

Posted by Freeman Fang <fr...@gmail.com>.
johnbarleycorn_81@libero.it wrote:
> Hi all,
>
> I have to implement this type of communication:
>
> external client <====> cxf-bc_1 <====> cxf-se_1 <====> bean-se <====> cxf-se_2
>
> now I send message from cxf-se_1 to bean-se, and then to cxf-se_2, like this:
>
> int in0 = 1;
> String messageStringContent = "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
> + "  <part>"
> + "    <doLogin xmlns='http://myproject.com/NDWS3/types'>"
> + "      <arg0>" + in0 + "</arg0>"
> + "    </doLogin>"
> + "  </part>"
> + "</message>";
> inOutExchange.getInMessage().setContent(new StringSource(messageStringContent));
>
> So I had transformed in0 in a String.
> If I have to send an Object, for example a  Person, 
> from cxf-se_1, so that cxf-se_2 can recognize it, how I should transform it to a String to send through a Normalized Message and so that I can 
The marshalling from java object to xml message is based on your wsdl 
and delegated to JAXB.
Why you need do the marshalling yourself?
If you are not familiar with the jaxb and wsdl to java object mapping, 
one way you could know what's the jbi message looks like is do a simple 
project like we do for example cxf-wsdl-first (you need use your wsdl 
and your impl class, where the wsdl define your person object), and turn 
on the log, then you can see the jbi message in the flow.
Freeman
> communicate it to cxf-se_2 (that is implemented as a simple POJO)?
>
> I'll be very grateful for every suggestion you would send.
> Thank you in advance. 
> Best Regards,
> anna
>
>
>
>
>