Hi,
There appears to be an issue when XML is set as representation and expected as output. This should probably be a PR instead of an issue, but here is explanation of the issue.
Minimal example:
const queryDef = {
schema: "nms:recipient",
operation: "select",
select: { node: [{ expr: "@id" }, { expr: "@email" }] },
lineCount: 50,
};
const query = client.NLWS.xml.xtkQueryDef.create(queryDef) // or xml set globally, same result
const result = await query.executeQuery()
Above throws error:
Error: TypeError: xmlRoot.hasAttribute is not a function
at Client._writeSoapCallParameters ([...]\@adobe\acc-js-sdk\src\client.js:1334:38)
Issue seems to be in @adobe\acc-js-sdk\src\client.js:1319 - function _writeSoapCallParameters:
var xmlValue = this._fromRepresentation(docName, paramValue, paramRepresentation || representation);
Issue is that at this point representation is SimpleJson. _fromRepresentation with 'xml' as representation always return paramValue without changes. If we instead convert to xml from SimpleJson the subsequent hasAttribute and rest of code works:
var xmlValue = this._convertToRepresentation(paramValue, "SimpleJson", paramRepresentation || representation);
Regards,
Jonas
Hi,
There appears to be an issue when XML is set as representation and expected as output. This should probably be a PR instead of an issue, but here is explanation of the issue.
Minimal example:
Above throws error:
Issue seems to be in @adobe\acc-js-sdk\src\client.js:1319 - function _writeSoapCallParameters:
Issue is that at this point representation is SimpleJson. _fromRepresentation with 'xml' as representation always return paramValue without changes. If we instead convert to xml from SimpleJson the subsequent hasAttribute and rest of code works:
Regards,
Jonas