When reading this xml into the XML-Buffer. It does not read the MsgContent into the table.
<>
2ef78060-5c41-43b8-a35a-63dce8159333
DESADV
INSBOU
003
2020-10-20T01:17:31.737
<>
This is beause the reader reconizes it as CDATA and this is not in the else statement. It would be nice to have a event for me to catch this and handle this myself. It would be nice if MS fixed this by adding the XmlNodyType CDATA to the if statement.
local procedure ReadAndInsertXmlElement(var XMLBuffer: Record "XML Buffer"; ParentXMLBuffer: Record "XML Buffer"; var ElementNumber: Integer; var InsertedXMLBufferElement: Record "XML Buffer"; var ProcessingInstructionNumber: Integer)
var
TempXMLBuffer: Record "XML Buffer" temporary;
begin
XmlNodeType := XmlReader.NodeType;
if XmlNodeType.Equals(XmlNodeType.Element) then begin
ElementNumber += 1;
ProcessXmlElement(XMLBuffer, ParentXMLBuffer, ElementNumber, InsertedXMLBufferElement)
end else
if XmlNodeType.Equals(XmlNodeType.Text) then begin
if XMLBuffer.IsTemporary then begin
TempXMLBuffer.Copy(XMLBuffer, true);
TempXMLBuffer := ParentXMLBuffer;
AddXmlTextNodeIntoParentXMLBuffer(TempXMLBuffer);
end else
AddXmlTextNodeIntoParentXMLBuffer(ParentXMLBuffer);
end else
if XmlNodeType.Equals(XmlNodeType.ProcessingInstruction) then begin
ProcessingInstructionNumber += 1;
InsertXmlProcessingInstruction(XMLBuffer, ParentXMLBuffer, ProcessingInstructionNumber)
end else
if XmlNodeType.Equals(XmlNodeType.XmlDeclaration) or
XmlNodeType.Equals(XmlNodeType.Comment)
then
;
**INSERT EVENT HERE**
end;
So I would like an event that allows me process my own NodeType, but the problem here is ofcourse that the codeunit uses a lot of DotNet. So it would be lovely if this somehow convert to a AL Type.
[IntegrationEvent(false, false)]
local procedure OnAfterReadAndInsertXmlElement(var XMLBuffer: Record "XML Buffer"; ParentXMLBuffer: Record "XML Buffer"; var ElementNumber: Integer; var InsertedXMLBufferElement: Record "XML Buffer"; var ProcessingInstructionNumber: Integer);
begin
end;
Comments
ok, you cannot add xml to your post.it's a soap envelope with a xml inside that is wrapped in [CDATA].
Category: Development
you cannot edit your post! 2ef78060-5c41-43b8-a35a-63dce8159333 DESADV INSBOU 003 2020-10-20T01:17:31.737 ]]>
Category: Development

Business Central Team (administrator)
Thank you for this suggestion! Currently this is not on our roadmap. We are tracking this idea and if it gathers more votes and comments we will consider it in the future. Best regards, Business Central Team