Gianfranco,

ServiceMix doesn't really do any XML validation, but it does try to convert the message into an XML Source object. This will cause a check on well-formedness on most types of Source objects, because they attempt to parse the XML message (e.g. to create a DOM tree in a DomSource). The only exception is probably the StreamSource. If your component sends its payload as this type of Source object, you can get to the raw InputStream for the message. Be sure to send along a copy of the data, because your next component will not be able to re-read the InputStream again.

Many ServiceMix components will use a StreamSource for the payload, but you have to make that DEBUG logging has been disabled, otherwise the Source object will be automatically transformed into a DomSource while logging it. If you need more alternatives in handling these non-normalized payloads, you can always start using Camel inside ServiceMix, because Camel Messages are not limited to XML as a payload, but they can send along any kind of content or object.

Regards,

Gert

Gianfranco Boccalon wrote:
Hi,
I have a listener that trace all messages in the ESB.
The problem is that I'm not able to trace all messages, for example if a HTTP input component receives a invalid XML message and it sends this message to the next component, the listener is not able to trace the message because Servicemix performs a validation before providing it to the listener.
Is there a way to get the message, even if it's invalid ?

Thanks
Gianfranco



Reply via email to