[email protected] wrote:
Hello,
thank you for your answer.
Lower I give you some further information.
Could you help me please?
You asked:
Why you need do the marshalling yourself?
There is an external client that make a request to a service inside the bus
(cxf-se_1) also exposed externally by a cxf-bc_1.
When the client invoke an operation on cxf-se_1 it has to take the parameter received as input and send to the normalized message router that deliver the message to a service-mix bean.
To send a message through the NMR, if I understood well is necessary transform the data to send to Xml.
When I have to send a String on a int or a boolean I can make a transformation
in one direction to the another easly.
But How I should work with Objects?
I explain a bit more:
The servicemix-bean that has received the message choose with some logics
another cxf-se to invoke and also the method to invoke. This cxf-se_2 is
exposed internally in the bus.
When the bean has decided the serice and the method, it has to make an
invocation to this service and so send a message of the form:
String messageStringContent = "<message
xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
+ " <part>"
+ " <doLogin xmlns='http://myproject.com/NDWS3/types'>"
+ " <arg0>" + ???????? + "</arg0>"
+ " </doLogin>"
+ " </part>"
+ "</message>";
inOutExchange.getInMessage().setContent(new StringSource(messageStringContent));
I have found this in the examples and it makes me able to make an invocation to
the cxf-se exposed internally by another service exposed internally.
What should stay in the place of ?????? is some String that is tha result of
sime kind of marshalling applied to an Object.
How the type of unmarshalling is done by the cxf-se when is invoked internally
in the bus?
If I know that, I can call every method in my services, by now only methods
that has as input and output parameter only String and primitive types.
The cxf-se_2 has to send back the result to the bean and this has to send back
the same to cxf-se_1 and this communication is all inside the bus.
Then cxf-se_1 turn back the result to the external client and this made
automatically by the library and I'm not really interested now in understanding
how this works, but this is important to understand what I need.
For your scenario, I believe you can inject the proxy of your cxfse
into your bean, then invoke the cxfse2 from your bean, just like normal
java method invocation, it will do the marshalling from java object (the
argument) to the JBI message (passed by the NMR) automatically for you,
and on the cxfse2 in your flow, will do the unmarshalling (from JBI
message to the java object based on the servicemodel, the servicemodel
is generated from your wsdl used in cxfse2)
By this way, you needn't care the details of marshalling/unmarshalling
yourself.
Take a look at [1], the Proxies part.
[1]http://servicemix.apache.org/servicemix-cxf-se.html
Freeman
Please help me with some suggestion,
thank you very much
best regards
anna
---------- Initial Header -----------
>From : "Freeman Fang" [email protected]
To : [email protected]
Cc :
Date : Mon, 12 Jan 2009 09:51:34 +0800
Subject : Re: Sending Object between cxf-se published in servicemix
[email protected] 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