I've spent 1.5 days trying to create an object parsing XML:
<EnvelopeStatus>
<RecipientStatuses>
<RecipientStatus>
<Type>Signer</Type>
<Email>johndoe@gmail.com</Email>
<UserName>Doe, John</UserName>
<Status>Completed</Status>
<CustomFields>
<CustomField>1001</CustomField>
</CustomFields>
</RecipientStatus>
<RecipientStatus>
<Type>Signer</Type>
<Email>maryjane@gmail.com</Email>
<UserName>Jane, Mary</UserName>
<Status>Sent</Status>
<CustomFields>
<CustomField>1002</CustomField>
</CustomFields>
</RecipientStatus>
</RecipientStatuses>
<Status>Completed</Status>
<Id>25b9b7e8-c4c0-4711-a80c-24663f0dc6ed</Id>
<CustomFields>
<CustomField>
<Name>Url</Name>
<Required>False</Required>
<Value>http://google.com</Value>
</CustomField>
<CustomField>
<Name>List</Name>
<Required>False</Required>
<Value>Blue</Value>
</CustomField>
<CustomField>
<Name>ItemId</Name>
<Required>False</Required>
<Value>2</Value>
</CustomField>
</EnvelopeStatus>
RecipientStatuses can contain many RecipientStatus. Inside of RecipientStatus there is a collection of CustomFields. Ideally, the single CustomField would move up to same level as Type, Email, UserName, etc.
Status, ID are under EnvelopeStatus, which also contain a collection of CustomFields. The only node really needed in this collection is 'Value' node, so theoretically, Value could move up to same level as Status and Id.
I have tried many different things and am back to square one. Is there a way to parse this xml, so that properties in these classes are set:
public class Request
{
public string Id { get; set; }
public string Status { get; set; }
public string Url { get; set; }
public string List { get; set; }
public string ItemId { get; set; }
public List<Signer> Signers { get; set; }
}
public class Signer
{
public string Type { get; set; }
public string Email { get; set; }
public string UserName { get; set; }
public int UserId { get; set; }
}