Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

<?xml version="1.0" encoding="UTF-8"?>
<EfxTransmit
	xmlns="http://www.....abc"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www....def http://www....ghi">
	<EfxReport requestNumber="1" reportId="CNCONSUMERCREDITFILE">
		<CNConsumerCreditReports>
			....I only care about these
			....I only care about these
			....I only care about these
		</CNConsumerCreditReports>
	</EfxReport>
</EfxTransmit>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
198 views
Welcome To Ask or Share your Answers For Others

1 Answer

Given there's barely anything else, it would be easier to deserialize the whole document than to try and extract the fragment you want.

You also need to match the namespaces in your model attributes to the namespaces in your XML.

So something like:

[XmlRoot(Namespace="http://www.....abc")]
public class EfxTransmit
{
    public EfxReport EfxReport { get; set; }
}

public class EfxReport
{
    public CNConsumerCreditReports CNConsumerCreditReports { get; set; }
}

public class CNConsumerCreditReports
{
    public CNConsumerCreditReport CNConsumerCreditReport { get; set; }
}

public class CNConsumerCreditReport
{
    // ...
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...