Salesforce Wsdl not valid any more

Looks like it could be a bug in .NET's XML serializer:

https://help.salesforce.com/HTViewSolution?id=000205824&language=en_US


Actually, it is a bug. It's due to the fact that the ListViewRecord object only has a single elements, "columns", which is a collection of ListViewRecordColumn objects. .NET reads the WSDL, but skips over making the ListViewRecord class entirely.

That's why you're seeing [][]... fixing it to [] makes it compile, but it's not "right". It should be ListViewRecord[].

So, to fix this, first open the Reference.cs which contains the C# that was auto-generated from then WSDL (assuming you're using Connected Services, instead of Web References, which was .NET-2-era). Around line 11883 (yikes!), I introduced the ListViewRecord class by hand. It looks like this

    /// <remarks/>
    [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Xml", "4.7.2102.0")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
    [System.Xml.Serialization.XmlTypeAttribute(Namespace = "urn:enterprise.soap.sforce.com")]
    public partial class ListViewRecord : object, System.ComponentModel.INotifyPropertyChanged
    {

        private ListViewRecordColumn[] columnsField;

        /// <remarks/>
        [System.Xml.Serialization.XmlArrayAttribute(IsNullable = true, Order = 1)]
        [System.Xml.Serialization.XmlArrayItemAttribute("records", typeof(ListViewRecordColumn), IsNullable=false)]
        public ListViewRecordColumn[] columns
        {
            get
            {
                return this.columnsField;
            }
            set
            {
                this.columnsField = value;
                this.RaisePropertyChanged("columns");
            }
        }

        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            System.ComponentModel.PropertyChangedEventHandler propertyChanged = this.PropertyChanged;
            if ((propertyChanged != null))
            {
                propertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName));
            }
        }
    }

With that, I then went through and found all (3?) of the references to ListViewRecordColumn[][], and changed them to ListViewRecord[]. Essentially, preserving "the array of things that holds an array of ListViewRecordColumns" the idea by following the WSDL and putting that latter array behind a .columns property.

It is a shame that Microsoft isn't addressing this bug, because they never, ever will. It's also a shame that Salesforce had the gumption to introduce ListViewRecord when it only served as a thin/useless container for ListViewRecordColumns. Bug vs poor design? I dunno, but given Salesforce's track record with its partner WSDL (which isn't even valid), I can't lay blame solely at Microsoft's door.