简体   繁体   中英

Handling invalid junk characters at the beginning of XML file in IIB

I am receiving an XML file with invalid junk characters at the beginning of the file as below: "MDE H"¸MQSTR AMQ COREDC.QM4 Ègcù; ÿÿÿÿ xml tag starts here-

The message is failing at IIB due to parsing errors. How do I handle this message successfully in IIB? without failing the message by extracting only the XML body and discarding the invalid junk characters at the beginning of the file?

First of all, just reading your question I am assuming you already tried to ask the sending application to send a proper XML message and they cannot for some reason. It looks like they are putting some header information in the XML payload (this should not happen). Second: If this is something unsolvable because you have no control over what you are receiving in the input node, you can always treat the message as a blob, then, inside a compute node you can cast it to a character and remove any part of it as u wish (you can also use Java for this). Then you can parse it as an XML from the Compute node or using a reset content descriptor node. I strongly recommend asking the sending application to send a proper XML message.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM