The InnerException message was 'Maximum number of items that can be serialized or deserialized in an object graph is '65536'.

I can see that this question has been asked several times, however they are all concerning WCF. After searching for a while, I have been unable to find a solution to this error.

I have a WinForms application that pulls data from a web service. The web service is written in WebForms /

My code to connect to the web service is:

Dim _DownloadStock As srShopDownload.shop_downloadsSoapClient
Dim binding As New STKBinding("STKBinder")
NewEndPoint = New EndpointAddress("")
            _DownloadStock = New srShopDownload.shop_downloadsSoapClient(binding._Binder, NewEndPoint)
_StockcodesList = _DownloadStock.GetStockcodes

My code for the _Binder is

Public Sub New(ByVal BinderName As String)

    _Binder = New BasicHttpBinding()
    _Binder.Name = BinderName

    _Binder.CloseTimeout = TimeSpan.FromMinutes(1)
    _Binder.OpenTimeout = TimeSpan.FromMinutes(1)
    _Binder.ReceiveTimeout = TimeSpan.FromMinutes(10)
    _Binder.SendTimeout = TimeSpan.FromMinutes(1)
    _Binder.AllowCookies = False
    _Binder.BypassProxyOnLocal = False
    _Binder.HostNameComparisonMode = HostNameComparisonMode.StrongWildcard

    _Binder.MaxBufferSize = 100000000
    _Binder.MaxBufferPoolSize = 12000000
    _Binder.MaxReceivedMessageSize = 100000000

    _Binder.MessageEncoding = WSMessageEncoding.Text
    _Binder.TextEncoding = System.Text.Encoding.UTF8
    _Binder.TransferMode = TransferMode.Streamed
    _Binder.UseDefaultWebProxy = True

    _Binder.ReaderQuotas.MaxDepth = 2147483647
    _Binder.ReaderQuotas.MaxStringContentLength = 2147483647
    _Binder.ReaderQuotas.MaxArrayLength = 2147483647
    _Binder.ReaderQuotas.MaxBytesPerRead = 2147483647
    _Binder.ReaderQuotas.MaxNameTableCharCount = 2147483647

    _Binder.Security.Transport.ClientCredentialType = HttpClientCredentialType.None
    _Binder.Security.Transport.ProxyCredentialType = HttpProxyCredentialType.None
    _Binder.Security.Transport.Realm = ""

    _Binder.Security.Message.ClientCredentialType = BasicHttpMessageCredentialType.UserName
    _Binder.Security.Message.AlgorithmSuite = Security.SecurityAlgorithmSuite.Default
    _Binder.Security.Mode = BasicHttpSecurityMode.Transport

End Sub

On the web service side, it's just a basic function:

Public Function GetStockcodes() As List(Of Stockcodes)

    Return GetStockcodes()

End Function

I've seen answers that you should change the serviceBehaviors on the client and server but I don't know how to do it without using WCF.