Acord Life 2.20.01 XML Data Binding  - Nuget packge LiquidTechnologies.XmlObjects.AcordLife2-20-01 Acord Life 2.20.01 XML Data Binding - Nuget packge LiquidTechnologies.XmlObjects.AcordLife2-20-01

Home > XML Data Binding Nuget Packages > Acord Life 2.20.01

 

Acord - Life, Annuity & Health Standards Program

ACORD's Life, Annuity & Health Standards Program supports the life, annuity, and health product lines as well as life reinsurance for individual and group lines of business. Through the Life, Annuity & Health Standards Program, and with membership support and the involvement of industry-sponsored volunteers, ACORD facilitates the development and maintenance of the ACORD Standards for Life, Annuity & Health.

NuGet Package ID LiquidTechnologies.XmlObjects.AcordLife2-20-01
Description An object model for the Acord Life standard providing strongly typed classes that can be serialized/deserializsed to XML.
Documentation Liquid XML Objects API
Schema Documentation https://schemas.liquid-technologies.com/Accord/Life Standards/2.20.01/
Official Schema Site http://www.acord.org/Standards/LifeMain.aspx
License EULA
Supported Platforms
  • .Net Standard 2.0 and above
  • .Net Core 2.0 and above
  • .Net Framework 4.0 and above

The following code shows how to create an XML document using the Accord-Life Standards nuget.

First the object is constructed and populated, then the LxSerializer is used to convert the object representation into XML.

using LiquidTechnologies.XmlObjects;
using LiquidTechnologies.XmlObjects.AcordLife220.Tns;
using System;
using System.Diagnostics;

namespace ConsoleApp7
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            LxSerializer<ReinsuranceRequestElm> s = new LxSerializer<ReinsuranceRequestElm>();
            ReinsuranceRequestElm elm = new ReinsuranceRequestElm();
            LxWriterSettings se = new LxWriterSettings();
            se.ErrorHandler = MyLxSerializerErrorHandler;

            elm.Id = "id123";
            elm.ReinsReportPeriodEndDate = LxDateTime.CreateDate(2000, 2, 2);
            elm.ReinsReportPeriodStartDate = LxDateTime.CreateDate(2000, 2, 2);

            PolicyActivityList_TypeCt policyActivity1 = new PolicyActivityList_TypeCt();
            policyActivity1.SeqNum = 0;
            policyActivity1.PolicyActivity = new PolicyActivityElm();
            policyActivity1.PolicyActivity.Tc = 123;
            policyActivity1.PolicyActivity.Value = "value1";
            elm.PolicyActivityList.Add(policyActivity1);

            PolicyActivityList_TypeCt policyActivity2 = new PolicyActivityList_TypeCt();
            policyActivity2.SeqNum = 1;
            policyActivity2.PolicyActivity = new PolicyActivityElm();
            policyActivity2.PolicyActivity.Tc = 123;
            policyActivity2.PolicyActivity.Value = "value2";
            elm.PolicyActivityList.Add(policyActivity2);

            s.Serialize(@"ReinsuranceRequest.xml", elm, se);
        }

        private static void MyLxSerializerErrorHandler(string msg, LxErrorSeverity severity, LxErrorCode errorCode, object targetObject)
        {
            if (severity == LxErrorSeverity.Error)
                throw new InvalidOperationException(msg);
            else
                Debug.WriteLine($"Warning : {msg}");
        }
    }
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid XML Objects - Unlicensed trial - For evaluation only - https://www.liquid-technologies.com/ -->
<ReinsuranceRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="id123" xmlns="http://ACORD.org/Standards/Life/2">
  <ReinsReportPeriodEndDate>2000-02-02Z</ReinsReportPeriodEndDate>
  <ReinsTranModel tc="0"></ReinsTranModel>
  <ReinsReportPeriodStartDate>2000-02-02Z</ReinsReportPeriodStartDate>
  <PolicyActivityList>
    <SeqNum>0</SeqNum>
    <PolicyActivity tc="123">value1</PolicyActivity>
  </PolicyActivityList>
  <PolicyActivityList>
    <SeqNum>1</SeqNum>
    <PolicyActivity tc="123">value2</PolicyActivity>
  </PolicyActivityList>
</ReinsuranceRequest>

Video Tutorial

This video tutorial demonstrates the basic usage of the XML Objects tool. It shows how to generated the code from an XML Schema, how to deserialize an XML document and then Serialize it back out.

Tools for Designing and Developing XML Schemas Free Trial