Fix issue where a GenericMessage cannot be encoded to XML.#21
Fix issue where a GenericMessage cannot be encoded to XML.#21kbalthaser wants to merge 1 commit intohapifhir:masterfrom
GenericMessage cannot be encoded to XML.#21Conversation
…e `$` in the class name. Added test to validate functionality.
ohr
left a comment
There was a problem hiding this comment.
XML encoding of GenericMessages (i.e. messages with unknown structures) is not supported (see XMLParser#doEncode(Message)), even with your fix.
If it was allowed, I doubt that these messages could ever be parsed back into XML.
|
Interesting. I can say from our experience, you will never actually see that If you look at the sample test I included, and run that against unmodified code, you can see that in this usage, you do not get the "nice" message referenced in Ex: In my use-case, we never actually have to go backwards from XML to a PipeMessage, so my thinking is obviously biased :) If this is truly unsupported in default HAPI, would you like me to make a PR which throws the proper exception out of |
Potential fix for issue where
GenericMessageinstances cannot be encoded to XML using theDefaultXmlParser. closes: #20This may not be an ideal solution from a performance perspective, but it was a simple way to address the issue.
We are currently using a custom
XmlParserwhich implements this same change. Having this within HAPI itself would certainly help streamline our code.