Comp1 needs to create an Out message in XML format and put this on the workflow.
Typically with some setContent() or send() or done() method in your java code. This at a guess is maybe what’s missing. Check out the articles on the SM site that detail POJO support.
You could create your own POJO (by extending the helper classes) for your Comp1 and then create a custom Marshaler class to build the out message exchange XML. Then you could put this XML on the exchange using a send() method. And also why not out put that XML message so, you can see the entire message being passed on.
Now for Comp2 you could look at the Http binding example.
If you forget the binding part and look more at the TransformComponentSupport class you will see an abstract method defined as:
protected boolean transform( MessageExchange exchange, NormalizedMessage in, NormalizedMessage out ) throws MessagingException
So, you could in your Comp2 class extend the TransformComponentSupport class and override the transform method and access the IN message there.
You can use the IN to read in the XML that your Comp1 created by using its custom Comp1 Marshaler. Now you have the message sent in you can parse it and get the data out.
Later on if you look at the Http example you will see it uses this to execute the method of 'out.setContent( "put your XML text here" )'. You can the exchange to create an out message and then pass that on to the trace comp.
I hope that helps.
Regards Rick
"uday bhaskar" <[EMAIL PROTECTED]>
11/04/2006 15:41 | To: [email protected] cc: Subject: Re: property set in one component unavailable in the other component |
Hi Rick,
I am not using any Marshaler. Below is the code snippet from my esb file
(having 2 components).
<sm:activationSpec componentName="comp1" service="foo:comp1"
destinationService="foo:comp2">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="my.esb.component1">
<property name="prop1" value="val1"/>
<property name="prop2" value="val2"/>
<property name="prop3" value="val3"/>
<property name="prop4" value="val4"/>
<property name="prop5" value="val5"/>
<property name="prop6" value="val6"/>
</bean>
</sm:component>
</sm:activationSpec>
<sm:activationSpec componentName="comp2" service="foo:comp2"
destinationService="foo:tracer">
<sm:component>
<bean xmlns="http://xbean.org/schemas/spring/1.0"
class="my.esb.component2">
<property name="prop1" value="val1"/>
<property name="prop2" value="val2"/>
<property name="prop3" value="val3"/>
<property name="prop4" value="val4"/>
<!-- This value is set in the component1 using
normalizedmessage.setProperty("prop5","val5")
<property name="prop5" value="val5"/>
-->
</bean>
</sm:component>
</sm:activationSpec>
I am not able to access prop5 of the component2 , but i am getting only
prop1 - prop4 only.
i am getting prop5 as null in component2.
Where iam wrong ?
Thanks,
uday
On 4/11/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Are you creating a Marshaler to define the Output message to 2nd component
> which includes the details from the prop6?
> Then are you using the 2nd component to read/parse the In message (which
> is the Out message from the 1st is chained)?
>
> Regards Rick
>
>
> [image: Inactive hide details for "uday bhaskar" <[EMAIL PROTECTED]>]"uday
> bhaskar" <[EMAIL PROTECTED]>
>
>
>
>
>
> *"uday bhaskar" <[EMAIL PROTECTED]>*
>
> 11/04/2006 15:10
> Please respond to servicemix-users
>
>
>
> To: [email protected]
> cc:
> Subject: property set in one component unavailable in the other component
>
>
> Hi,
>
> I have two components. The second one is having 6 properties.
> prop1
> prop2
> prop3
> prop4
> prop5
> prop6
>
> I am setting the 'prop6' in the first component and sending
> the message out. The remaining 5 properties i am setting in
> the 2nd component (in esb.xml file). But the 'prop6' is
> unavailable in the 2nd one( which is set in 1st component).
>
> I dont have any clue on why this is happening ?
> Am i doing something wrong ? Anybody help !!
>
>
> --
> Thanks,
> Udaya Bhaskar Garikapati
>
> Direct Line Group Limited, registered in England
> with number 2811437, registered office 3 Edridge
> Road, Croydon, Surrey CR9 1AG. The following
> companies are members of the Direct Line Group:
> Direct Line Insurance plc, Direct Line Life
> Insurance Company Limited, Direct Line Unit
> Trusts Limited and Direct Line Financial Services
> Limited, all of which are authorised and regulated
> by the Financial Services Authority. All are
> members of The Royal Bank of Scotland Group.
>
> This email is intended for the addressee only and
> may contain confidential, proprietary or legally
> privileged information. If you are not the
> intended recipient of this email you should
> notify us immediately and delete it. You should
> not copy, print, distribute, disclose or use any
> part of it. We reserve the right to monitor and
> record all electronic communications through our
> networks. We cannot accept any liability for
> viruses transmitted via this e-mail once it has
> left our networks.
>
>
--
Thanks,
Udaya Bhaskar Garikapati
Direct Line Group Limited, registered in England with number 2811437, registered office 3 Edridge Road, Croydon, Surrey CR9 1AG. The following companies are members of the Direct Line Group: Direct Line Insurance plc, Direct Line Life Insurance Company Limited, Direct Line Unit Trusts Limited and Direct Line Financial Services Limited, all of which are authorised and regulated by the Financial Services Authority. All are members of The Royal Bank of Scotland Group. |
This email is intended for the addressee only and may contain confidential, proprietary or legally privileged information. If you are not the intended recipient of this email you should notify us immediately and delete it. You should not copy, print, distribute, disclose or use any part of it. We reserve the right to monitor and record all electronic communications through our networks. We cannot accept any liability for viruses transmitted via this e-mail once it has left our networks. |
