The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

bato (12) [Avatar] Offline
#1
Example for XStream’s concept of custom aliases in chapter 4.4.3 XML object marshaling is wrong, The configuration uses DefaultMuleMessage instead ActivityReport class.

see: https://github.com/ddossot/mule-in-action-2e/blob/master/chapter04/src/test/resources/xstream.xml

<flow name="xstream_xml-to-object-alias-flow">
<vm:inbound-endpoint path="xstream_xml-to-object-alias.in" exchange-pattern="request-response" />
<!--<start id="lis_04_xstream_xml-to-object-alias"/>-->
<mulexml:object-to-xml-transformer>
<mulexml:alias >
class="org.mule.DefaultMuleMessage"
name="MuleMessage" />
</mulexml:object-to-xml-transformer>
<!--<end id="lis_04_xstream_xml-to-object-alias"/>-->
<mulexmlsmilieml-to-object-transformer/>
</flow>

It should be :

<flow name="xstream_xml-to-object-alias-flow">
<vm:inbound-endpoint path="xstream_xml-to-object-alias.in" exchange-pattern="request-response" />
<!--<start id="lis_04_xstream_xml-to-object-alias"/>-->
<mulexml:object-to-xml-transformer>
<mulexml:alias >
class="com.prancingdonkey.statistics.ActivityReport"
name="ActivityReport" />
</mulexml:object-to-xml-transformer>
<mulexmlsmilieml-to-object-transformer>
<mulexml:alias >
class="com.prancingdonkey.statistics.ActivityReport"
name="ActivityReport" />
</mulexmlsmilieml-to-object-transformer>
<!--<end id="lis_04_xstream_xml-to-object-alias"/>-->
</flow>
vromero (6) [Avatar] Offline
#2
Re: Example for XStream’s concept of custom aliases (CH4.4.3) is wrong
Hello Bato,

Off the top of my head looks like it should either use acceptMuleMessage="true" or do what you mention.

I'll take a look later and will update the examples.

Thanks!
bato (12) [Avatar] Offline
#3
Re: Example for XStream’s concept of custom aliases (CH4.4.3) is wrong
Thanks for the fast replay.

Perhaps you could check also the missing class com.prancingdonkey.model.jaxb.Friend (Example with jaxb).
Actually it could be created from chapter04/src/main/resources/friend.xsd but in the book is this not described.