<results>
<result>
<egov_ref_no>20121203001</egov_ref_no>
<status>OK</status>
<err_code>01</err_code>
</result>
<result>
<egov_ref_no>20121203002</egov_ref_no>
<status>OK</status>
<err_code>02</err_code>
</result>
<result>
<egov_ref_no>20121203003</egov_ref_no>
<status>OK</status>
<err_code>03</err_code>
</result>
</results>
The code above shows that the root node is already an IEnumerable where as in online examples they are only elements.
If you have a results object you can just pass in a
XmlRootAttributeinto theXmlSerializerconstructor. In this case its “results”Example:
My result object:
This will return as
List<Result>