Possible Duplicate:
VS2003 Web Reference for a WCF Service has Extra "IdSpecified" Parameter
Thanks everyone. I totally missed that. Yes, the class name is awful.
I have a web service (ASMX) that returns an object which contains an array.
I first define my response object:
APIResponse response = new APIResponse();
Fill a datatable:
dtHolder = SqlHelper.ExecuteDatatable(connstring, CommandType.StoredProcedure, strSelect, aParams);
Create a holder for the results of my query:
    API036RsBkgDetRec[] BkgDetRec_Array = new API036RsBkgDetRec[dtHolder.Rows.Count];
            int i = 0;
            foreach (DataRow row in dtHolder.Rows)
            {
                BkgDetRec_Array[i] = new API036RsBkgDetRec();
                BkgDetRec_Array[i].eqoEqszId = row[0].ToString();
                BkgDetRec_Array[i].eqoEqtpId = row[1].ToString();
                BkgDetRec_Array[i].eqoEqhtId = row[2].ToString();
                BkgDetRec_Array[i].qty = Convert.ToInt32(row[3]);
                BkgDetRec_Array[i].receiveQty = Convert.ToInt32(row[4]);
                BkgDetRec_Array[i].emptyTally = Convert.ToInt32(row[5]);
                BkgDetRec_Array[i].maxEmpty = Convert.ToInt32(row[6]);
                BkgDetRec_Array[i].chsQty = Convert.ToInt32(row[7]);
                BkgDetRec_Array[i].chsTally = Convert.ToInt32(row[8]);
                i++;
            }
and populate the array I am returning (bkgDetTable) with the holder array I just populated above:
response.bkgDetTable = BkgDetRec_Array;
When I capture the output, I see that none of the integer fields are being created even though when I step through the code, they are being populated with real numbers. The object API036RsBkgDetRec also has them defined as integer values. Only the ones defined as string are coming across.
<bkgDetTable xmlns="http://sdfsd/xsd">
<eqoEqhtId>96</eqoEqhtId>
<eqoEqszId>40</eqoEqszId>
<eqoEqtpId>DR</eqoEqtpId>
</bkgDetTable>
Here is the definition of API036RsBkgDetRec:
public partial class API036RsBkgDetRec
{    
private int chsQtyField;
private bool chsQtyFieldSpecified;
private int chsTallyField;
private bool chsTallyFieldSpecified;
private int emptyTallyField;
private bool emptyTallyFieldSpecified;
private string eqoEqhtIdField;
private string eqoEqszIdField;
private string eqoEqtpIdField;
private int maxEmptyField;
private bool maxEmptyFieldSpecified;
private int qtyField;
private bool qtyFieldSpecified;
private int receiveQtyField;
private bool receiveQtyFieldSpecified;
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=0)]
public int chsQty
{
    get
    {
        return this.chsQtyField;
    }
    set
    {
        this.chsQtyField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool chsQtySpecified
{
    get
    {
        return this.chsQtyFieldSpecified;
    }
    set
    {
        this.chsQtyFieldSpecified = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=1)]
public int chsTally
{
    get
    {
        return this.chsTallyField;
    }
    set
    {
        this.chsTallyField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool chsTallySpecified
{
    get
    {
        return this.chsTallyFieldSpecified;
    }
    set
    {
        this.chsTallyFieldSpecified = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=2)]
public int emptyTally
{
    get
    {
        return this.emptyTallyField;
    }
    set
    {
        this.emptyTallyField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool emptyTallySpecified
{
    get
    {
        return this.emptyTallyFieldSpecified;
    }
    set
    {
        this.emptyTallyFieldSpecified = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true, Order=3)]
public string eqoEqhtId
{
    get
    {
        return this.eqoEqhtIdField;
    }
    set
    {
        this.eqoEqhtIdField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true, Order=4)]
public string eqoEqszId
{
    get
    {
        return this.eqoEqszIdField;
    }
    set
    {
        this.eqoEqszIdField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true, Order=5)]
public string eqoEqtpId
{
    get
    {
        return this.eqoEqtpIdField;
    }
    set
    {
        this.eqoEqtpIdField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=6)]
public int maxEmpty
{
    get
    {
        return this.maxEmptyField;
    }
    set
    {
        this.maxEmptyField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool maxEmptySpecified
{
    get
    {
        return this.maxEmptyFieldSpecified;
    }
    set
    {
        this.maxEmptyFieldSpecified = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=7)]
public int qty
{
    get
    {
        return this.qtyField;
    }
    set
    {
        this.qtyField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool qtySpecified
{
    get
    {
        return this.qtyFieldSpecified;
    }
    set
    {
        this.qtyFieldSpecified = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlElementAttribute(Order=8)]
public int receiveQty
{
    get
    {
        return this.receiveQtyField;
    }
    set
    {
        this.receiveQtyField = value;
    }
}
/// <remarks/>
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool receiveQtySpecified
{
    get
    {
        return this.receiveQtyFieldSpecified;
    }
    set
    {
        this.receiveQtyFieldSpecified = value;
    }
}
}
Any ideas?
 
     
     
    