Notifications
Announcements
No record found.
Hi all
I can serialize an object in this way :
public class CustomerRecord implements AifXmlSerializable { str customerId; str CustomerName; // Define Name Space & Root Element #define.CustomerNS ('http://schemas.contoso.com/samples/Customer') #define.CustomerRoot ('Customer') } void deserialize(AifXml xml) { XmlTextReader xmlReader; ; xmlReader = XmlTextReader::newXml(xml); // turn off Whitespace handling to avoid extra reads xmlReader.whitespaceHandling(XmlWhitespaceHandling::None); xmlReader.moveToContent(); while ((xmlReader.nodeType() != XmlNodeType::Element) && !xmlReader.eof()) { xmlReader.read(); } xmlReader.readStartElement3(#CustomerRoot, #CustomerNS); if (!xmlReader.eof() && xmlReader.isStartElement()) { customerId = xmlReader.readElementString3('CustomerId', #CustomerNS); customerName = xmlReader.readElementString3('CustomerName', #CustomerNS); } xmlReader.readEndElement(); xmlReader.close(); } public AifDocumentName getRootName() { return #CustomerRoot; } public AifXml getSchema() { str schema = @'<?xml version="1.0"?> <xsd:schema xmlns="http://schemas.contoso.com/samples/Customer" targetNamespace="http://schemas.contoso.com/samples/Customer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xsd:complexType name="CustomerType"> <xsd:sequence> <xsd:element name="CustomerId" type="xsd:string" /> <xsd:element name="CustomerName" type="xsd:string" /> </xsd:sequence> </xsd:complexType> <xsd:element name="Customer" type="CustomerType"/> </xsd:schema>' ; return schema; } public str parmCustomerId(str _customerId = '') { if (!prmisdefault(_customerId)) { customerId = _customerId; } return customerId; } public str parmCustomerName(str _customerName = '') { if (!prmisdefault(_customerName)) { customerName = _customerName; } return customerName; }
But I need to serialize a list of object.
Can anyone help or have any idea about this?
Serkan
*This post is locked for comments
See AifEntityKeyList class for an example.
Hi gl00mie
This will solve my problem.
Thank You
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Priya_K 4
Martin Dráb 4 Most Valuable Professional
Ali Zaidi 2