I'm not sure about the SOAP toolkit you're using, but many toolkits
(.NET included) will, by default, limit the number of concurrent HTTP
connections to a single endpoint to 2 (this is part of the HTTP 1.1
spec, I believe).  So you may be seeing an artificial bottleneck, where
all of your requests are being funneled through 2 connections.

To see if this is the problem, you could either sift through the SOAP
toolkit docs to figure out if you can get more connections, or do a
network trace to examine what's going on.

Hope that helps...

Greg Reinacker
Reinacker & Associates, Inc.
http://www.rassoc.com
http://www.rassoc.com/gregr/weblog/


-----Original Message-----
From: Moderated discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED]] On Behalf Of Jesse Sanders
Sent: Monday, June 10, 2002 11:44 AM
To: [EMAIL PROTECTED]
Subject: Re: Threading is blocking itself or ?


Ian,

Thanks for the reply.  Here is the code for the SOAP class.  I didn't
write
the actual soap calls, but instead used the one created by my
counterparts
at work.  It would not surprise me if it is the source of the problem.
The
create threads code is straight out of Dan Applemans moving to .Net
book.

The soap interface has 4 parameters: timeout, returnaddress, inputdate,
and
requestid.

Your help is greatly appreciated... I have been pulling my hair out
trying
to get this figured out... nevermind the deadline!

Thanks,

Jesse

Public Class SOAP
    Private Const WRAPPER_ELEMENT_NAMESPACE =
"http://tempuri.org/message/";

    Private Const c_strConnectString =
"Provider=SQLOLEDB.1;InitialCatalog=config;" & _
                                "Password=;User
ID=sa;DataSource=172.24.176.167"
    Private Threads() As System.Threading.Thread

    Private m_strServerName As String
    Private m_strRequestType As String
    Private m_strReturnAddress As String
    Private m_strInputXML As String
    Private m_lngRequestID As String
    Private m_strServerIP As String
    Private m_lngTimeout As Long = 5

    Public Sub SendSingleRequest()

        Dim Serializer As MSSOAPLib.SoapSerializer
        Dim Reader As MSSOAPLib.SoapReader
        Dim Connector As MSSOAPLib.SoapConnector

        Dim strSQL As String
        Dim strURL As String

        strURL = "http://"; & m_strServerIP.ToString

        Select Case m_strRequestType
            Case "Fixed Loan", "Fixed Commit", "Price A Loan"
                strURL = strURL & "GfsReq.asp"
            Case "Update Grid"
                strURL = strURL & "Grids.asp"
            Case "Rate Sheet"
                strURL = strURL & "RateSheet.asp"
            Case "Pair Off"
                strURL = strURL & "PairOff.asp"
        End Select


        Try
            '-- Set up the connector
            Connector = New MSSOAPLib.HttpConnector()
            Connector.Property("EndPointURL") = strURL
            Connector.Property("Timeout") = 6000000
            Connector.BeginMessage() 'Nothing

            '-- Set up the Serializer
            Serializer = New MSSOAPLib.SoapSerializer()
            Serializer.Init(Connector.InputStream)
            Serializer.startEnvelope()
            Serializer.startBody()

            Select Case m_strRequestType
                Case "Fixed Loan", "Fixed Commit", "Price A Loan"
                    Serializer.startElement("CalculatePrice",
WRAPPER_ELEMENT_NAMESPACE, , "m")
                Case "Update Grid"
                    Serializer.startElement("UpdateGrid",
WRAPPER_ELEMENT_NAMESPACE, , "m")
                Case "Rate Sheet"
                    Serializer.startElement("RequestRateSheet",
WRAPPER_ELEMENT_NAMESPACE, , "m")
                Case "Pair Off"
                    Serializer.startElement("CalculatePairOff",
WRAPPER_ELEMENT_NAMESPACE, , "m")
            End Select

            Serializer.startElement("TimeOut")
            Serializer.writeString(m_lngTimeout)
            Serializer.endElement()

            Serializer.startElement("ReturnAddress")
            Serializer.writeString(m_strReturnAddress)
            Serializer.endElement()

            Serializer.startElement("InputData")
            Serializer.writeString(m_strInputXML)
            Serializer.endElement()

            Serializer.startElement("RequestID")
            Serializer.writeString(m_lngRequestID)
            Serializer.endElement()
            Serializer.endElement()
            Serializer.endBody()
            Serializer.endEnvelope()
            Connector.EndMessage()

            Reader = New MSSOAPLib.SoapReader()
            Reader.Load(Connector.OutputStream)
        Catch E As Exception
            EventLog.WriteEntry("GFSSoap.SOAP", E.Message, _
                     EventLogEntryType.Error, 1, 1)
        End Try

        Exit Sub

    End Sub

    Public Sub New(ByVal strServerName As String, _
                    ByVal strRequestType As String, _
                    ByVal strReturnAddress As String, _
                    ByVal strInputXML As String, _
                    ByVal lngRequestID As String, _
                    ByVal strServerIP As String)
        m_strServerName = strServerName
        m_strRequestType = strRequestType
        m_strReturnAddress = strReturnAddress
        m_strInputXML = strInputXML
        m_lngRequestID = lngRequestID
        m_strServerIP = strServerIP
    End Sub

    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub

    Public Sub StartThreads(ByVal ThreadCount As Integer)
        Dim Idx As Integer

        If ThreadCount < 1 Then ThreadCount = 1
        ReDim Threads(ThreadCount - 1)
        Try
            For Idx = 0 To ThreadCount - 1
                Threads(Idx) = New Threading.Thread(AddressOf
Me.SendSingleRequest)
                Threads(Idx).Priority =
System.Threading.ThreadPriority.BelowNormal
                Threads(Idx).IsBackground = True
                Threads(Idx).Start()
            Next
        Catch E As Exception
            EventLog.WriteEntry("GFSSoap.SOAP", E.Message, _
                     EventLogEntryType.Error, 1, 1)
        End Try
    End Sub
End Class

You can read messages from the Advanced DOTNET archive, unsubscribe from
Advanced DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced 
DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to