C#反序列化CBISDDStsRptPhyMsg
C# deserialization CBISDDStsRptPhyMsg
我需要反序列化一个遵循 CBI 意大利标准的 XML,问题是我已经用命名空间标记了每个 class,但我仍然无法反序列化。
这是我要反序列化(内容已删除)的 xml 的一部分:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RISPOSTASDD:CBISDDStsRptPhyMsg xmlns:HE2E="urn:CBI:xsd:CBIHdrSrv.001.07" xmlns:BODY="urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00" xmlns:SGNT="urn:CBI:xsd:CBISgnInf.001.04" xmlns:RISPOSTASDD="urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00" xmlns:LMSG="urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00" xmlns:HTRT="urn:CBI:xsd:CBIHdrTrt.001.07">
<RISPOSTASDD:CBIHdrTrt>
<HTRT:IdCBISndrf></HTRT:IdCBISndrf>
<HTRT:IdCBIRcvrf></HTRT:IdCBIRcvrf>
<HTRT:SrvNm></HTRT:SrvNm>
<HTRT:IdMsgTrt></HTRT:IdMsgTrt>
<HTRT:XMLCrtDt></HTRT:XMLCrtDt>
<HTRT:RtrnAddrl></HTRT:RtrnAddrl>
</RISPOSTASDD:CBIHdrTrt>
<RISPOSTASDD:CBIHdrSrv>
<HE2E:SrvInfo>
<HE2E:SrvNm></HE2E:SrvNm>
<HE2E:IdE2EMsg></HE2E:IdE2EMsg>
<HE2E:XMLCrtDt></HE2E:XMLCrtDt>
</HE2E:SrvInfo>
<HE2E:Sender>
<HE2E:IdCBISend></HE2E:IdCBISend>
<HE2E:SendTyp></HE2E:SendTyp>
<HE2E:CBIRefrSend></HE2E:CBIRefrSend>
</HE2E:Sender>
<HE2E:Receiver>
<HE2E:IdCBIRecv></HE2E:IdCBIRecv>
<HE2E:RecvTyp></HE2E:RecvTyp>
<HE2E:CBIRefrRecv></HE2E:CBIRefrRecv>
</HE2E:Receiver>
<HE2E:DiagInfo>
<HE2E:UsrBnk></HE2E:UsrBnk>
<HE2E:DiagVers></HE2E:DiagVers>
<HE2E:ChkSbj></HE2E:ChkSbj>
<HE2E:ChkDt></HE2E:ChkDt>
</HE2E:DiagInfo>
<HE2E:CongrInfo>
<HE2E:SrvBdyNb></HE2E:SrvBdyNb>
</HE2E:CongrInfo>
</RISPOSTASDD:CBIHdrSrv>
<RISPOSTASDD:CBIBdySDDStsRpt>
<BODY:PhyMsgInf>
<BODY:PhyMsgTpCd></BODY:PhyMsgTpCd>
<BODY:NbOfLogMsg></BODY:NbOfLogMsg>
</BODY:PhyMsgInf>
<BODY:CBIEnvelSDDStsRptLogMsg>
<BODY:CBISDDStsRptLogMsg>...
这些是(一些)我为反序列化而编写的 classes:
[Serializable, XmlRoot(Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public class CBISDDStsRptPhyMsg
{
[XmlElement("CBIHdrTrt", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public CBIHdrTrt CBIHdrTrt {get;set;}
[XmlElement("CBIHdrSrv", Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public CBIHdrSrv CBIHdrSrv {get;set;}
[XmlElement("CBIBdySDDStsRpt", Namespace="urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00")]
public CBIBdySDDStsRpt CBIBdySDDStsRpt { get; set; }
}
[Serializable]
public class CBIHdrTrt
{
[XmlElement("IdCBISndrf", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string IdCBISndrf { get; set; }
[XmlElement("IdCBIRcvrf", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string IdCBIRcvrf { get; set; }
[XmlElement("SrvNm", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string SrvNm { get; set; }
[XmlElement("IdMsgTrt", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string IdMsgTrt { get; set; }
[XmlElement("XMLCrtDt", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public DateTime XMLCrtDt { get; set; }
[XmlElement("RtrnAddrl", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string RtrnAddrl { get; set; }
}
[Serializable]
public class CBIHdrSrv
{
[XmlElement("SrvInfo",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public SrvInfo SrvInfo { get; set; }
[XmlElement("Sender",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public Sender Sender { get; set; }
[XmlElement("Receiver",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public Receiver Receiver { get; set; }
[XmlElement("DiagInfo",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public DiagInfo DiagInfo { get; set; }
[XmlElement("CongrInfo",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public CongrInfo CongrInfo { get; set; }
}
[Serializable]
public class SrvInfo
{
[XmlElement("SrvNm",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string SrvNm { get; set; }
[XmlElement("IdE2EMsg",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string IdE2EMsg { get; set; }
[XmlElement("XMLCrtDt",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public DateTime XMLCrtDt { get; set; }
}
[Serializable]
public class Sender
{
[XmlElement("IdCBISend",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string IdCBISend { get; set; }
[XmlElement("SendTyp",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string SendTyp { get; set; }
[XmlElement("CBIRefrSend",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string CBIRefrSend { get; set; }
}
[Serializable]
public class Receiver
{
[XmlElement("IdCBIRecv",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string IdCBIRecv { get; set; }
[XmlElement("RecvTyp",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string RecvTyp { get; set; }
[XmlElement("CBIRefrRecv",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string CBIRefrRecv { get; set; }
}
[Serializable]
public class DiagInfo
{
[XmlElement("UsrBnk",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string UsrBnk { get; set; }
[XmlElement("DiagVers",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string DiagVers { get; set; }
[XmlElement("ChkSbj",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string ChkSbj { get; set; }
[XmlElement("ChkDt",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public DateTime ChkDt { get; set; }
}
[Serializable]
public class CongrInfo
{
[XmlElement("SrvBdyNb",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public int SrvBdyNb { get; set; }
}
[Serializable]
public class CBIBdySDDStsRpt
{
[XmlElement("PhyMsgInf", Namespace = "urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00")]
public PhyMsgInf PhyMsgInf { get; set; }
[XmlElement("CBIEnvelSDDStsRptLogMsg", Namespace = "urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00")]
public CBIEnvelSDDStsRptLogMsg CBIEnvelSDDStsRptLogMsg { get; set; }
}
[Serializable]
public class CBIEnvelSDDStsRptLogMsg
{
[XmlElement("CBISDDStsRptLogMsg", Namespace = "urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00")]
public CBISDDStsRptLogMsg CBISDDStsRptLogMsg { get; set; }
}
[Serializable]
public class CBISDDStsRptLogMsg
{
[XmlElement("GrpHdr", Namespace = "urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00")]
public GroupHeader GroupHeader { get; set; }
[XmlElement("OrgnlGrpInfAndSts", Namespace = "urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00")]
public OriginalGroupInformationAndStatus OriginalGroupInformationAndStatus { get; set; }
[XmlElement("OrgnlPmtInfAndSts", Namespace = "urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00")]
public List<OriginalPaymentInformationAndStatus> OriginalPaymentInformationAndStatus { get; set; }
}
我的反序列化非常简单:
var sITA = new XmlSerializer(typeof(CBISDDStsRptPhyMsg));
var xmlITA = new CBISDDStsRptPhyMsg();
using(var reader = XmlReader.Create(fileInput.InputStream))
{
xmlITA = (CBISDDStsRptPhyMsg)sITA.Deserialize(reader);
}
最后,我的 3 个主要对象都为空。
有人知道我做错了什么吗?我已经设法 serialize/deserialize 我找到的每个 SEPA 文件 (pain.00x),但是这个意大利标准让我头疼了一段时间。
有没有人拥有能够反序列化此意大利标准的 classes? (不要费心去寻找 .xsd 来生成它,因为我已经用谷歌搜索了很多,但 .xsd 无处可寻!)
提前致谢。
与根相同命名空间的根元素的三个子元素,前缀为 RISPOSTASDD
:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RISPOSTASDD:CBISDDStsRptPhyMsg xmlns:HE2E="urn:CBI:xsd:CBIHdrSrv.001.07" xmlns:BODY="urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00" xmlns:SGNT="urn:CBI:xsd:CBISgnInf.001.04" xmlns:RISPOSTASDD="urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00" xmlns:LMSG="urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00" xmlns:HTRT="urn:CBI:xsd:CBIHdrTrt.001.07">
<RISPOSTASDD:CBIHdrTrt>
<!-- Nested elements snipped -->
</RISPOSTASDD:CBIHdrTrt>
<RISPOSTASDD:CBIHdrSrv>
<!-- Nested elements snipped -->
</RISPOSTASDD:CBIHdrSrv>
<RISPOSTASDD:CBIBdySDDStsRpt>
<!-- Remaining XML not included in the question -->
因此你的rootclass需要修改如下:
[Serializable, XmlRoot(Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public class CBISDDStsRptPhyMsg
{
[XmlElement("CBIHdrTrt", Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public CBIHdrTrt CBIHdrTrt { get; set; }
[XmlElement("CBIHdrSrv", Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public CBIHdrSrv CBIHdrSrv { get; set; }
[XmlElement("CBIBdySDDStsRpt", Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public CBIBdySDDStsRpt CBIBdySDDStsRpt { get; set; }
}
(或者您可以省略属性中的 Namespace =
,因为它与 XmlRoot
属性中的相同。)
可能还有其他问题,但您的问题不包含完整的 mcve(XML 和 class 都不完整),但至少这看起来不正确.
我需要反序列化一个遵循 CBI 意大利标准的 XML,问题是我已经用命名空间标记了每个 class,但我仍然无法反序列化。
这是我要反序列化(内容已删除)的 xml 的一部分:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RISPOSTASDD:CBISDDStsRptPhyMsg xmlns:HE2E="urn:CBI:xsd:CBIHdrSrv.001.07" xmlns:BODY="urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00" xmlns:SGNT="urn:CBI:xsd:CBISgnInf.001.04" xmlns:RISPOSTASDD="urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00" xmlns:LMSG="urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00" xmlns:HTRT="urn:CBI:xsd:CBIHdrTrt.001.07">
<RISPOSTASDD:CBIHdrTrt>
<HTRT:IdCBISndrf></HTRT:IdCBISndrf>
<HTRT:IdCBIRcvrf></HTRT:IdCBIRcvrf>
<HTRT:SrvNm></HTRT:SrvNm>
<HTRT:IdMsgTrt></HTRT:IdMsgTrt>
<HTRT:XMLCrtDt></HTRT:XMLCrtDt>
<HTRT:RtrnAddrl></HTRT:RtrnAddrl>
</RISPOSTASDD:CBIHdrTrt>
<RISPOSTASDD:CBIHdrSrv>
<HE2E:SrvInfo>
<HE2E:SrvNm></HE2E:SrvNm>
<HE2E:IdE2EMsg></HE2E:IdE2EMsg>
<HE2E:XMLCrtDt></HE2E:XMLCrtDt>
</HE2E:SrvInfo>
<HE2E:Sender>
<HE2E:IdCBISend></HE2E:IdCBISend>
<HE2E:SendTyp></HE2E:SendTyp>
<HE2E:CBIRefrSend></HE2E:CBIRefrSend>
</HE2E:Sender>
<HE2E:Receiver>
<HE2E:IdCBIRecv></HE2E:IdCBIRecv>
<HE2E:RecvTyp></HE2E:RecvTyp>
<HE2E:CBIRefrRecv></HE2E:CBIRefrRecv>
</HE2E:Receiver>
<HE2E:DiagInfo>
<HE2E:UsrBnk></HE2E:UsrBnk>
<HE2E:DiagVers></HE2E:DiagVers>
<HE2E:ChkSbj></HE2E:ChkSbj>
<HE2E:ChkDt></HE2E:ChkDt>
</HE2E:DiagInfo>
<HE2E:CongrInfo>
<HE2E:SrvBdyNb></HE2E:SrvBdyNb>
</HE2E:CongrInfo>
</RISPOSTASDD:CBIHdrSrv>
<RISPOSTASDD:CBIBdySDDStsRpt>
<BODY:PhyMsgInf>
<BODY:PhyMsgTpCd></BODY:PhyMsgTpCd>
<BODY:NbOfLogMsg></BODY:NbOfLogMsg>
</BODY:PhyMsgInf>
<BODY:CBIEnvelSDDStsRptLogMsg>
<BODY:CBISDDStsRptLogMsg>...
这些是(一些)我为反序列化而编写的 classes:
[Serializable, XmlRoot(Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public class CBISDDStsRptPhyMsg
{
[XmlElement("CBIHdrTrt", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public CBIHdrTrt CBIHdrTrt {get;set;}
[XmlElement("CBIHdrSrv", Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public CBIHdrSrv CBIHdrSrv {get;set;}
[XmlElement("CBIBdySDDStsRpt", Namespace="urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00")]
public CBIBdySDDStsRpt CBIBdySDDStsRpt { get; set; }
}
[Serializable]
public class CBIHdrTrt
{
[XmlElement("IdCBISndrf", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string IdCBISndrf { get; set; }
[XmlElement("IdCBIRcvrf", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string IdCBIRcvrf { get; set; }
[XmlElement("SrvNm", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string SrvNm { get; set; }
[XmlElement("IdMsgTrt", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string IdMsgTrt { get; set; }
[XmlElement("XMLCrtDt", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public DateTime XMLCrtDt { get; set; }
[XmlElement("RtrnAddrl", Namespace = "urn:CBI:xsd:CBIHdrTrt.001.07")]
public string RtrnAddrl { get; set; }
}
[Serializable]
public class CBIHdrSrv
{
[XmlElement("SrvInfo",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public SrvInfo SrvInfo { get; set; }
[XmlElement("Sender",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public Sender Sender { get; set; }
[XmlElement("Receiver",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public Receiver Receiver { get; set; }
[XmlElement("DiagInfo",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public DiagInfo DiagInfo { get; set; }
[XmlElement("CongrInfo",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public CongrInfo CongrInfo { get; set; }
}
[Serializable]
public class SrvInfo
{
[XmlElement("SrvNm",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string SrvNm { get; set; }
[XmlElement("IdE2EMsg",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string IdE2EMsg { get; set; }
[XmlElement("XMLCrtDt",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public DateTime XMLCrtDt { get; set; }
}
[Serializable]
public class Sender
{
[XmlElement("IdCBISend",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string IdCBISend { get; set; }
[XmlElement("SendTyp",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string SendTyp { get; set; }
[XmlElement("CBIRefrSend",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string CBIRefrSend { get; set; }
}
[Serializable]
public class Receiver
{
[XmlElement("IdCBIRecv",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string IdCBIRecv { get; set; }
[XmlElement("RecvTyp",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string RecvTyp { get; set; }
[XmlElement("CBIRefrRecv",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string CBIRefrRecv { get; set; }
}
[Serializable]
public class DiagInfo
{
[XmlElement("UsrBnk",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string UsrBnk { get; set; }
[XmlElement("DiagVers",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string DiagVers { get; set; }
[XmlElement("ChkSbj",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public string ChkSbj { get; set; }
[XmlElement("ChkDt",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public DateTime ChkDt { get; set; }
}
[Serializable]
public class CongrInfo
{
[XmlElement("SrvBdyNb",Namespace="urn:CBI:xsd:CBIHdrSrv.001.07")]
public int SrvBdyNb { get; set; }
}
[Serializable]
public class CBIBdySDDStsRpt
{
[XmlElement("PhyMsgInf", Namespace = "urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00")]
public PhyMsgInf PhyMsgInf { get; set; }
[XmlElement("CBIEnvelSDDStsRptLogMsg", Namespace = "urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00")]
public CBIEnvelSDDStsRptLogMsg CBIEnvelSDDStsRptLogMsg { get; set; }
}
[Serializable]
public class CBIEnvelSDDStsRptLogMsg
{
[XmlElement("CBISDDStsRptLogMsg", Namespace = "urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00")]
public CBISDDStsRptLogMsg CBISDDStsRptLogMsg { get; set; }
}
[Serializable]
public class CBISDDStsRptLogMsg
{
[XmlElement("GrpHdr", Namespace = "urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00")]
public GroupHeader GroupHeader { get; set; }
[XmlElement("OrgnlGrpInfAndSts", Namespace = "urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00")]
public OriginalGroupInformationAndStatus OriginalGroupInformationAndStatus { get; set; }
[XmlElement("OrgnlPmtInfAndSts", Namespace = "urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00")]
public List<OriginalPaymentInformationAndStatus> OriginalPaymentInformationAndStatus { get; set; }
}
我的反序列化非常简单:
var sITA = new XmlSerializer(typeof(CBISDDStsRptPhyMsg));
var xmlITA = new CBISDDStsRptPhyMsg();
using(var reader = XmlReader.Create(fileInput.InputStream))
{
xmlITA = (CBISDDStsRptPhyMsg)sITA.Deserialize(reader);
}
最后,我的 3 个主要对象都为空。
有人知道我做错了什么吗?我已经设法 serialize/deserialize 我找到的每个 SEPA 文件 (pain.00x),但是这个意大利标准让我头疼了一段时间。
有没有人拥有能够反序列化此意大利标准的 classes? (不要费心去寻找 .xsd 来生成它,因为我已经用谷歌搜索了很多,但 .xsd 无处可寻!)
提前致谢。
与根相同命名空间的根元素的三个子元素,前缀为 RISPOSTASDD
:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RISPOSTASDD:CBISDDStsRptPhyMsg xmlns:HE2E="urn:CBI:xsd:CBIHdrSrv.001.07" xmlns:BODY="urn:CBI:xsd:CBIBdySDDStsRpt.00.01.00" xmlns:SGNT="urn:CBI:xsd:CBISgnInf.001.04" xmlns:RISPOSTASDD="urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00" xmlns:LMSG="urn:CBI:xsd:CBISDDStsRptLogMsg.00.01.00" xmlns:HTRT="urn:CBI:xsd:CBIHdrTrt.001.07">
<RISPOSTASDD:CBIHdrTrt>
<!-- Nested elements snipped -->
</RISPOSTASDD:CBIHdrTrt>
<RISPOSTASDD:CBIHdrSrv>
<!-- Nested elements snipped -->
</RISPOSTASDD:CBIHdrSrv>
<RISPOSTASDD:CBIBdySDDStsRpt>
<!-- Remaining XML not included in the question -->
因此你的rootclass需要修改如下:
[Serializable, XmlRoot(Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public class CBISDDStsRptPhyMsg
{
[XmlElement("CBIHdrTrt", Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public CBIHdrTrt CBIHdrTrt { get; set; }
[XmlElement("CBIHdrSrv", Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public CBIHdrSrv CBIHdrSrv { get; set; }
[XmlElement("CBIBdySDDStsRpt", Namespace = "urn:CBI:xsd:CBISDDStsRptPhyMsg.00.01.00")]
public CBIBdySDDStsRpt CBIBdySDDStsRpt { get; set; }
}
(或者您可以省略属性中的 Namespace =
,因为它与 XmlRoot
属性中的相同。)
可能还有其他问题,但您的问题不包含完整的 mcve(XML 和 class 都不完整),但至少这看起来不正确.