Good Morning
I'm having trouble deserializing this document and give me the following error:
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.002.001.03"> It was not waiting
This is the document I want to deserialize:
<?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.002.001.03">
<CstmrPmtStsRpt>
<GrpHdr>
<MsgId>xxxx/2018-03-16T01:21:33</MsgId>
<CreDtTm>2018-03-16T01:21:33</CreDtTm>
</GrpHdr>
<OrgnlGrpInfAndSts>
<OrgnlMsgId>xxxxDD106</OrgnlMsgId>
<OrgnlMsgNmId>Pain.008.001.02</OrgnlMsgNmId>
<OrgnlNbOfTxs>xxx</OrgnlNbOfTxs>
<OrgnlCtrlSum>xxxxx.xx</OrgnlCtrlSum>
<StsRsnInf>
<Rsn><Prtry>M001</Prtry></Rsn>
</StsRsnInf>
</OrgnlGrpInfAndSts>
<OrgnlPmtInfAndSts>
<OrgnlPmtInfId>DD001</OrgnlPmtInfId>
<OrgnlNbOfTxs>xxx</OrgnlNbOfTxs>
<OrgnlCtrlSum>xxxxx.xx</OrgnlCtrlSum>
<StsRsnInf>
<Rsn><Prtry>L001</Prtry></Rsn>
</StsRsnInf>
<TxInfAndSts>
<StsId>301</StsId>
<OrgnlEndToEndId>2IC 18100283</OrgnlEndToEndId>
<StsRsnInf>
<Rsn><Cd>0000</Cd></Rsn>
</StsRsnInf>
<AcctSvcrRef>xxxx/301/xxxxxxxxxx/xxxxx/M/F</AcctSvcrRef>
<OrgnlTxRef>
<Amt>
<InstdAmt Ccy="EUR">x.xx</InstdAmt>
</Amt>
<ReqdColltnDt>2018-03-15</ReqdColltnDt>
<CdtrSchmeId>
<Id>
<PrvtId>
<Othr>
<Id>xxxxxxxxxxxxxxx</Id>
</Othr>
</PrvtId>
</Id>
</CdtrSchmeId>
<PmtTpInf>
<SeqTp>FRST</SeqTp>
</PmtTpInf>
<PmtMtd>DD</PmtMtd>
<MndtRltdInf>
<MndtId>xxxxxxxxxxx</MndtId>
<DtOfSgntr>2018-03-13</DtOfSgntr>
<AmdmntInd>False</AmdmntInd>
</MndtRltdInf>
<Dbtr><Nm>xxxxxxxxx xxxxxxxxx xxxxxxx</Nm></Dbtr>
<DbtrAcct>
<Id>
<IBAN>xxxxxxxxxxxxxxxxxxxxxxxxx</IBAN>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId><BIC>XXXXXXXXXXXXXX</BIC></FinInstnId>
</DbtrAgt>
<CdtrAgt>
<FinInstnId><BIC>XXXXXXXXXXXXXX</BIC></FinInstnId>
</CdtrAgt>
<Cdtr><Nm>xxxxxxxxxxxxx</Nm></Cdtr>
<CdtrAcct>
<Id>
<IBAN>xxxxxxxxxxxxxxxxxxxxxxxxx</IBAN>
</Id>
</CdtrAcct>
</OrgnlTxRef>
</TxInfAndSts>
...
</OrgnlPmtInfAndSts>
</CstmrPmtStsRpt>
</Document>
Any help thank you
my code in C#
public Document_EPC ReadReturnSepaXML(string filename)
{
string path = @"C:\Users\jcosta\Desktop\Testa_XSD\PrcessarRetorno\FicheiroSepaExemplo\" + filename + ".xml";
try
{
using (System.IO.FileStream stream = new System.IO.FileStream(path, System.IO.FileMode.Open))
{
XmlSerializer documentRetornoSEPA = new XmlSerializer(typeof(Document_EPC));
return (Document_EPC)documentRetornoSEPA.Deserialize(stream);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
//return myObjects;
}
I'm having trouble deserializing this document and give me the following error:
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.002.001.03"> It was not waiting
This is the document I want to deserialize:
<?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.002.001.03">
<CstmrPmtStsRpt>
<GrpHdr>
<MsgId>xxxx/2018-03-16T01:21:33</MsgId>
<CreDtTm>2018-03-16T01:21:33</CreDtTm>
</GrpHdr>
<OrgnlGrpInfAndSts>
<OrgnlMsgId>xxxxDD106</OrgnlMsgId>
<OrgnlMsgNmId>Pain.008.001.02</OrgnlMsgNmId>
<OrgnlNbOfTxs>xxx</OrgnlNbOfTxs>
<OrgnlCtrlSum>xxxxx.xx</OrgnlCtrlSum>
<StsRsnInf>
<Rsn><Prtry>M001</Prtry></Rsn>
</StsRsnInf>
</OrgnlGrpInfAndSts>
<OrgnlPmtInfAndSts>
<OrgnlPmtInfId>DD001</OrgnlPmtInfId>
<OrgnlNbOfTxs>xxx</OrgnlNbOfTxs>
<OrgnlCtrlSum>xxxxx.xx</OrgnlCtrlSum>
<StsRsnInf>
<Rsn><Prtry>L001</Prtry></Rsn>
</StsRsnInf>
<TxInfAndSts>
<StsId>301</StsId>
<OrgnlEndToEndId>2IC 18100283</OrgnlEndToEndId>
<StsRsnInf>
<Rsn><Cd>0000</Cd></Rsn>
</StsRsnInf>
<AcctSvcrRef>xxxx/301/xxxxxxxxxx/xxxxx/M/F</AcctSvcrRef>
<OrgnlTxRef>
<Amt>
<InstdAmt Ccy="EUR">x.xx</InstdAmt>
</Amt>
<ReqdColltnDt>2018-03-15</ReqdColltnDt>
<CdtrSchmeId>
<Id>
<PrvtId>
<Othr>
<Id>xxxxxxxxxxxxxxx</Id>
</Othr>
</PrvtId>
</Id>
</CdtrSchmeId>
<PmtTpInf>
<SeqTp>FRST</SeqTp>
</PmtTpInf>
<PmtMtd>DD</PmtMtd>
<MndtRltdInf>
<MndtId>xxxxxxxxxxx</MndtId>
<DtOfSgntr>2018-03-13</DtOfSgntr>
<AmdmntInd>False</AmdmntInd>
</MndtRltdInf>
<Dbtr><Nm>xxxxxxxxx xxxxxxxxx xxxxxxx</Nm></Dbtr>
<DbtrAcct>
<Id>
<IBAN>xxxxxxxxxxxxxxxxxxxxxxxxx</IBAN>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId><BIC>XXXXXXXXXXXXXX</BIC></FinInstnId>
</DbtrAgt>
<CdtrAgt>
<FinInstnId><BIC>XXXXXXXXXXXXXX</BIC></FinInstnId>
</CdtrAgt>
<Cdtr><Nm>xxxxxxxxxxxxx</Nm></Cdtr>
<CdtrAcct>
<Id>
<IBAN>xxxxxxxxxxxxxxxxxxxxxxxxx</IBAN>
</Id>
</CdtrAcct>
</OrgnlTxRef>
</TxInfAndSts>
...
</OrgnlPmtInfAndSts>
</CstmrPmtStsRpt>
</Document>
Any help thank you
my code in C#
public Document_EPC ReadReturnSepaXML(string filename)
{
string path = @"C:\Users\jcosta\Desktop\Testa_XSD\PrcessarRetorno\FicheiroSepaExemplo\" + filename + ".xml";
try
{
using (System.IO.FileStream stream = new System.IO.FileStream(path, System.IO.FileMode.Open))
{
XmlSerializer documentRetornoSEPA = new XmlSerializer(typeof(Document_EPC));
return (Document_EPC)documentRetornoSEPA.Deserialize(stream);
}
}
catch (Exception ex)
{
Console.WriteLine(ex);
throw;
}
//return myObjects;
}