looking for some solutions? You are welcome.

SOLVED:

mehdi S:

My XML file like these

<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pacs.008.001.01">
  <pacs.008.001.01>
    <GrpHdr>
      <MsgId>BMJSSHAP97121315012.CT</MsgId>
      <CreDtTm>1397-12-13T14:25:16</CreDtTm>
      <NbOfTxs>10</NbOfTxs>
      <TtlIntrBkSttlmAmt Ccy="IRR">47132394</TtlIntrBkSttlmAmt>
      <IntrBkSttlmDt>1397-12-13</IntrBkSttlmDt>
      <SttlmInf>
        <SttlmMtd>CLRG</SttlmMtd>
      </SttlmInf>
      <PmtTpInf>
        <SvcLvl>
          <Cd>SEPA</Cd>
        </SvcLvl>
      </PmtTpInf>
    </GrpHdr>
  </pacs.008.001.01>
</Document>

When i try to deserialization it give me an error

<Document xmlns='urn:iso:std:iso:20022:tech:xsd:pacs.008.001.01'> was not expected.

here is my code

   var s = new XmlSerializer(typeof(string), new XmlRootAttribute("Document"));
            using (var reader = new StreamReader(address))
            {
                var result = (ShopDepositFileHeader)(s).Deserialize(reader);
            }

I cant understand where is my fault ?

Its my ShopDepositFileHeader class

public class ShopDepositFileHeader
{
    public int Id { get; set; }
    public string MsgId { get; set; }
    public DateTime CrDtTm { get; set; }
    public long NbOfTxs { get; set; }
    public long TtllntrBkSttlmAmt { get; set; }
    public DateTime IntrBkSttlmDt { get; set; }
    public string SttlmMtd { get; set; }
    public string SvcLvl { get; set; }
    public DateTime CreateDate { get; set; }

}



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
Share:

No comments:

Recent