Hello, before all please excuse my poor english.
I´ve got an aplication that comunicates via xml with another system,
so i have a binding file for every messages (when I started i didn´t
know about the binding selector :-P).
I have a new message that, inside, have another message that i have
already defined in other bindings; so i have to unmarshall that
message.
I´m trying to write a custom unmarshaller, but have some problems that
can´t solve.
I saw tjhis on the list:
" This makes complete sense: XML does not allow having "<" characters
in the XML stream except as the start of tags. If you have some XML
with this character in it, it is technically wrong.
I "fixed" an older version of JiBX to work around this problem, but it
required writing a custom (un)marshaller. If you are really interested
please contact me and I'll send you the code." I really, really need
this code... :-(. In my case i don´t believe it´s wrong to put an xml
inside another, because is an asynchronous response.
I put an example of what I'm tryin to do here:
<?xml version="1.0" encoding="UTF-8"?>
<Message>
<schedule>
<someThing>Any</someThing>
<txType>MessageName</txType>
<message>
<MessageName>
<body>
<Value/>
<AnotherValueBis/>
<AnotherValue>23438</AnotherValue>
</body>
</MessageName>
</message>
</schedule>
</Message>
I have a binding already compiled and working good for the message
"MessageName". Now, I need, in my custom deserializer, to unmarshall
"txType" and with that, call IBindingFactory bfact =
BindingDirectory.getFactory(MessageName, Message.class);.
I tried to define the binding like this:
<mapping name="schedule" class="ScheduledTask" ordered="false" flexible="true">
<value name="someThing" field="id"/>
<value name="MessageName" field="transaction"/>
<structure name="message" field="mensaje"
unmarshaller="MessageUnmarshaller" usage="optional"/>
</mapping>
But i always receive JibxException: Duplicate Element "message when
trying to test custom unmarshaller...
Thanks a lot.
--
[EMAIL PROTECTED]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users