XML deserialize iso 20022 pain.001.001.03 from xsd using c# -


i want object xml file. in example using iso 2002 pain.001.001.03

iso 200022 pain.001.001.03

i have downloaded schema from

pain.001.001.03.xsd

and xml file from

pain.001.001.03.xml

i have validated xml against xsd using tool

validate xml

i have generated class using xsd

enter image description here

and using code below in order deserialize

   xmlserializer ser = new xmlserializer(typeof(customercredittransferinitiationv03),    new xmlrootattribute                                                   {                           elementname = "document",                         namespace = "urn:iso:std:iso:20022:tech:xsd:pain.001.001.03",                    });              filestream myfilestream = new filestream("c:\\001.001.03\\pain.001.001.03.xml", filemode.open);             customercredittransferinitiationv03 myobject = (customercredittransferinitiationv03) ser.deserialize(myfilestream); 

the code return null values xml has values

enter image description here

<?xml version="1.0" encoding="utf-8"?> <document xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03">     <cstmrcdttrfinitn> 

the root element document, , not cstmrcdttrfinitn :

var serializer = new xmlserializer(typeof(document)); using (var file = file.openread(path)) {     var document = (document)serializer.deserialize(file);     var transfer = document.cstmrcdttrfinitn; } 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -