Open graghsaka opened 2 years ago
We probably need a type adapter to handle the Any elements. This is a long time pending issue.
As for the namespace, it is a bit strange, since the one that you said it works ant the other do not have significant differences.
This issue is similar to #39 and #41
Test case and a few exploration approaches have been pushed to: https://github.com/prowide/prowide-iso20022/pull/48
XmlAnyElement is expected to be parsed into a generic Element node.
The root cause is probably in our NamespaceAndElementFilter and MxReadImpl classes. But could not find a solution to fit al scenarios yet.
@zubri thanks. I have also attached my xml request for reference
I am facing issue while parsing AppHdr (BusinessAppHdrV01), specifically Sgntr (SignatureEnvelope).
In SignatureEnvelope there's a field "any" which is annotated by @XmlAnyElement.
My Xml string has a custom tag "XmlSgntr". So while parsing xml string, this "any" field is set as my custom tag. This is fine. But the problem is when my custom tag has XML namespace (xmlns), then it won't set. That is "any" field is set to null. This happens only when I set _xmlns="https://acb/chjhj"**_, but everything works fine when i set it as xmlns:xsi="https://acb/chjhj"**. i.e issue only exists when I set xml namespace without identifier (when xmlns value is URI).
What the reason behind this behaviour?
Edit: So I debugged, and found another finding. This only happens if use xmlns="https://acb/chihj". If change it to xmln="https://acb/chih" or maybe anything else. That is I changed "xmlns" (namespace name). Seems like "xmlns" is causing the issue.
My Header:
<AppHdr xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:head.001.001.01 head.001.001.01.xsd" xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
My Signarure:
<XMLSgntrs xmlns="http://www.w3.org/2000/09/xmldsig#">