• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

VB.NET Web Services

FireFoxx74

n00b
Joined
Apr 23, 2002
Messages
42
Ok, I am having a complete ***** of a time with .NET Web Services, so I am hoping someone here knows more about the things than I.

We have a piece of software running on server1, which has it's own web service Q. All of this is linked through DLL's so I can't mess with it. Needless to say, it makes basic calls to a database on SQL Server.

I am writing a web service in VB.NET on server2 using Visual Studio 2003, we'll call it P for now. Essentially I am using P as an overlay to Q, joining some of the simple methods of Q together into more complex methods in P; which can be further called by other programs.

The problem is thus; every time I make one of these complex calls of server2.P->server1.Q, there ends up being resultant threads open (cursorfetch_1) on the SQL Server. These threads buid up and up until the SQL Server explodes.

As far as I can tell though, my code is legit. Can anyone else confirm?

I can't exactly remember my code, so I will pseudo it a bit below:

Web Service P:
Code:
    Quote:
    Function getClientID(clientName)
    {
    Dim WSQ = New server1.Q
    Return WSQ.GetParticipantByID(clientName)
    WSQ = Nothing
    }

    Function getNotify(clientID, URL)
    {
    Dim WSQ = New server1.Q
    Return WSQ.GetAccessAssessmentNotify(clientID, URL),
    WSQ = Nothing
    }

    Function getSchedule(clientName)
    {
    Dim CID = getClientID(clientName)
    Dim ReturnList

    Dim WSQ = New server1.Q
    Dim ScheduleList = WSQ.GetScheduleByParticipant(CID)

    For Each Schedule in ScheduleList
    ReturnList.Add (getNotify(CID, Schedule.URL))
    Next

    Return ReturnList

    ReturnList = Nothing
    WSQ = Nothing
    ScheduleList = Nothing
    }

Actual code from one of the methods:

Code:
 <WebMethod(Description:="Get a ParticipantID from a CSLogin")> _
Public Function getParticipantID(ByVal CSLogin As String) As String
'Security Header
Dim QMSecurityHeader As New uk.ac.essex.serntxx.SecurityHeader
QMSecurityHeader.ClientID = QMWClientID
QMSecurityHeader.Checksum = QMWChecksum

'First grab a QMWISe header
Dim QM As New uk.ac.essex.serntxx.QMWISe
QM.Security = QMSecurityHeader
QM.Timeout = 1000 'ms
'=====================================================================

'Declare Variables
Dim ParticipantID As String

Try
'We could pass this into a participant object, or we can just grab straight from the call
ParticipantID = QM.GetParticipantByName(Trim(CSLogin)).Participant_ID.ToString()
Catch ex As Exception
'Failed - Participant already exists?
ParticipantID = Nothing
End Try

'Return
Return ParticipantID

'Kill the QMWISe object
QMSecurityHeader = Nothing
QM.Abort()
QM.Dispose()
QM = Nothing
GC.Collect()
End Function
 
The 1st thing I would do is make sure all datareaders in web service Q are being closed in finally blocks or something similar such as the c# using block.
 
Back
Top