Question xmltextreader closing connection unexpectedly

tastybrains

New member
Joined
Dec 2, 2009
Messages
2
Programming Experience
1-3
Hello,

while looping through a short XML file called from xmltextreader retrieved from a webservice, I'm repeatedly getting the error:
The request was aborted: The connection was closed unexpectedly. it constantly dies a row or two from completing the parsing.
here's my short code:
VB.NET:
'Get the principal-id for Group
         Dim url As String = "https://xxxxx.acrobat.com/api/xml?action=principal-list&session=" & strCookie
         xmlRead = WebRequestToServer(url)
          Do While xmlRead.Read
            If xmlRead.NodeType = XmlNodeType.Element Then
                If xmlRead.Name = "principal" Then
                    strGroupID = xmlRead.GetAttribute("principal-id").ToString()
                End If

                If xmlRead.Name = "name" Then
                    If groupNumber = xmlRead.ReadString Then ' need to cast here?
                        'strMeetingCode = strGroupID 'already have strGroupID
                        Exit Do ' end loop
                    End If
                End If
            End If
         Loop
        xmlRead.Close()
i've tried
- increasing httpRuntime in web.config to: <httpRuntime executionTimeout="9000" maxRequestLength="8192"
- examining the length of the returned file (<4k)
- yelling
my other calls to the web service work fine, so why would this be timing out?? any ideas?
thank you, i'm stumped
 
i found a work-around. since i have multiple calls to webservices using xmltextRead, i just created a new instance for every call, instead of re-using the instance. beats me if it's bug/memory issue or bad programming practice on my part, but it seemed to work.
 
Back
Top