Results 1 to 2 of 2

Thread: VB.NET Web Services

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2005
    Posts
    1

    VB.NET Web Services

    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

  2. #2
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: VB.NET Web Services

    If I understood your post correctly, service Q accesses the SQL but you don't have control over it. So if it mismanages in any way its SQL connections or whatever, you can't control that from P.
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width