public struct sFr
{
public sFe[] errorDetails;
public sFr(sFe[] _errorDetails)
{
// ?? whats code to initialise the array without getting error
// as this throws null ref when used later from client calling this webservice
errorDetails = _errorDetails;
// do we need to create the array of elements which we populate ?
}
}
public struct sFr { public sFe[] errorDetails; public sFr(sFe[] _errorDetails) { // ?? whats
Share
Very simple fix; don’t make it a struct.
Sorry, but a struct there is just plain wrong…
As are public fields, and usually arrays (prefer lists)
And overly abbreviated names (use things like
[XmlRoot("sFr"), XmlType("sFr")]if you need to control the serialization, but make the type-name meaningful).Re the error; the syntax should just be
this.fieldName = value;I’d have something like: