The IBM Integration Bus JavaScript Client API creates Java classes, which are used by IIB runtime to convert JSON to XML, see https://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ss26030_.htm for more information.
In the generated Java classes, the namespace is set only on the element and not subelements, which causes in some cases incorrect XML and subsequent incorrect message processing. When JavaScript client API is generated in the Toolkit, Java utility classes are generated as well.
MbElement firstChild = xmlnscElement.getFirstChild(); if (null != firstChild) { firstChild.setNamespace(TARGET_NAMESPACE); }
It depends on the XML schema whether this code is correct. If the schema specifies elementFormDefault=”qualified”, then all elements and subelements are in the targetNamespace of the schema. If the schema specifies elementFormDefault=”unqualified” or does not specify elementFormDefault, then only the top level element is in the targetNamespace of the schema. In case elementFormDefault=”qualified” in the schema, change the Java class as following: FROM: MbElement firstChild = xmlnscElement.getFirstChild();
} TO: MbElement firstChild = xmlnscElement.getFirstChild(); while (firstChild != null) { firstChild.setNamespace(TARGET_NAMESPACE); MbElement child = firstChild.getNextSibling(); while (child != null) { child.setNamespace(TARGET_NAMESPACE); child = child.getNextSibling(); }