Hi, I've a mapping like this:

<binding>

<mapping name="c-message"
class="com.talent.cruiser.messaging.CruiserMessage" abstract="true">
    <value name="class-name" field="strClassName"/>
    <value name="user-hash" field="userHash"/>
</mapping>

<mapping name="dresp-message"
class="com.talent.cruiser.messaging.DataResponseMessage"
extends="com.talent.cruiser.messaging.CruiserMessage">
    <value name="data" field="data"
serializer="com.talent.data.XmlResultSet.toXml"
deserializer="com.talent.data.XmlResultSet.fromXml" />
</mapping>

</binding>

In code life, DataResponseMessage extends CruiserMessage, and always calls
super() in it's constructors. However, when I serialize a
DataResponseMessage I see none of the parent fields in the resulting Xml !
... can anyone help out ?

Another issue ... on the receiving end of a JiBX xml post, I might be
receiving any type of many types of messages, corresponding to subclasses of
CruiserMessage. From what I've seen in the examples, I need to call a
IBindingFactory bfact = BindingDirectory.getFactory(<resulting
class>.class); in order to proceed. But in this case, I don't really know
the class I'm being sent from the other side ! Is there a workaround ?

Personally, I include the class name within the message ( the strClassName
field of the CruiserMessage class ) and I do a quick xpath prior to
deserialization to get it. I'd think that this is a quite ... brute (?),
ugly (?) .. way of achieving my goal ... and I'd be grateful if someone
could point me to a more elegant solution.

Cheers, Angel
O:]




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to