FIX: SOAP SDK: ConnectTimeout Does Not Apply to Dotted IP Address (311275)



The information in this article applies to:

  • Microsoft SOAP Toolkit 2.0 SP2

This article was previously published under Q311275

SYMPTOMS

The delay only occurs when the actual Internet Protocol (IP) address is specified in the URL. If a not valid Domain Name Service (DNS) name is specified, the name resolution fails more quickly.

RESOLUTION

A new property ConnectTimeout has been added to the HttpConnector interface. By setting this, you override the default Transmission Control Protocol (TCP) timeout described earlier. A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date      Version      Size           File name     Platform
   -----------------------------------------------------------------
   8/28/2001 1.2.828.0    171,008 bytes  HLSC10.dll    x86			
   8/28/2001 1.2.828.0    25,088 bytes   WiSC10.dll    x86
   2/11/2001 6.0.2473.0   191,488 bytes  Q311275_SOAPSDK_Win2k_x86_en.exe
				
To install this hotfix on a Microsoft Windows 2000 platform, run the hotfix installer package (Q311275_SOAPSDK_Win2k_x86_en.exe).

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

The earlier behavior does not occur in SOAP Toolkit, version 3.0

MORE INFORMATION

Steps to Reproduce the Behavior


  1. Save the following file as Calc.vbs.
    Option Explicit
    Const BASE_SOAP_ACTION_URI = "http://tempuri.org/action/Calc."
    Const WRAPPER_ELEMENT_NAMESPACE = "http://tempuri.org/message/"
    Const END_POINT_URL = "http://10.10.10.10/soaptest/Calc.asp"
    
    WScript.echo "Connecting: " & END_POINT_URL
    WScript.Echo "14+28=" & Execute(END_POINT_URL, "Add", 14,28)
    
    Function Execute(ByVal EndPointURL, ByVal Method, ByVal A, ByVal B)
    
        Dim Serializer
        Dim Reader
        Dim Connector
        
        Set Connector = CreateObject("MSSOAP.HttpConnector")
        Connector.Property("EndPointURL") = EndPointURL
        
        Connector.Property("SoapAction") = BASE_SOAP_ACTION_URI & Method
    
        'The "Timeout property only affects the SOAP request.
        'It does not effect the *connect* timeout.
        'It's always approx 20 seconds
        'This is in milliseconds
        Connector.Property("Timeout") = 1000
        'With this hotfix you can override the connect timeout by
        'using the "ConnectTimeOut" property
    '    Connector.Property("ConnectTimeOut") = 5000
        Connector.BeginMessage
        
        Set Serializer = CreateObject("MSSOAP.SoapSerializer")
        Serializer.Init Connector.InputStream
        
        Serializer.startEnvelope
        Serializer.startBody
        Serializer.startElement Method, WRAPPER_ELEMENT_NAMESPACE, , "m"
        Serializer.startElement "A"
        Serializer.writeString A
        Serializer.endElement
        Serializer.startElement "B"
        Serializer.writeString B
        Serializer.endElement
        Serializer.endElement
        Serializer.endBody
        Serializer.endEnvelope
        
        Connector.EndMessage
        
        Set Reader = CreateObject("MSSOAP.SoapReader")
        Reader.Load Connector.OutputStream
        
        If Not Reader.Fault Is Nothing Then
            Execute = "FAULT: " & Reader.faultstring.Text
        Else
            Execute = Reader.RPCResult.Text
        End If
        
    End Function
    					
  2. Save the following file as Calc.asp
    <%@ LANGUAGE=VBScript %>
    <%
    
    Option Explicit
    
    Private Const WRAPPER_ELEMENT_NAMESPACE = "http://tempuri.org/message/"
    
    Response.ContentType = "text/xml"
    If Not Process() Then
      Response.Status = "500 Internal Server Error"
    End If  
    
    Public Function Process()
        Dim A
        Dim B
        Dim Answer
        Dim Serializer
        Dim Reader
        Dim MethodName
        Dim Parameter
        
        On Error Resume Next
        
        Process = False
        
        Set Reader = Server.CreateObject("MSSOAP.SoapReader")
        If Err Then
            ServerFault "Cannot create MSSOAP.SoapReader. " & Err.Description & "(0x" & Hex(Err.Number) & ")"
            Exit Function
        End If
        
        Reader.Load Request
        If Err Then
            ClientFault "Cannot load request. " & Err.Description
            Exit Function
        End If
        
        If Reader.RPCStruct Is Nothing Then
          ClientFault "No RPC wapper element found in request."
          Exit Function
        End If
        
        MethodName = Reader.RPCStruct.baseName
        If Err Then
            ClientFault "Cannot get method name. " & Err.Description
            Exit Function
        End If
        
        Set Parameter = Reader.RPCParameter("A")
        If Parameter Is Nothing Then
            ClientFault "Cannot find parameter A. " & Err.Description
            Exit Function
        End If
        A = CDbl(Parameter.Text)
        If Err Then
            ClientFault "Parameter A not a Double value. " & Err.Description
            Exit Function
        End If
        
        Set Parameter = Reader.RPCParameter("B")
        If Parameter Is Nothing Then
            ClientFault "Cannot find parameter B. " & Err.Description
            Exit Function
        End If
        B = CDbl(Parameter.Text)
        If Err Then
            ClientFault "Parameter B not a Double value. " & Err.Description
            Exit Function
        End If
        
        Select Case MethodName
        
            Case "Add"
                Answer = A + B
            
            Case "Subtract"
                Answer = A - B
            
            Case "Divide"
                Answer = A / B
            
            Case "Multiply"
                Answer = A * B
            
            Case Else
                ClientFault "Unknown method: """ & MethodName & """."
                Exit Function
        
        End Select
        
        Set Serializer = Server.CreateObject("MSSOAP.SoapSerializer")
        If Err Then
            ServerFault "Cannot create MSSOAP.SoapSerializer. " & Err.Description & "(0x" & Hex(Err.Number) & ")"
            Exit Function
        End If
        
        Serializer.Init Response
        
        Serializer.startEnvelope
        Serializer.startBody
        Serializer.startElement MethodName & "Response", WRAPPER_ELEMENT_NAMESPACE, , "m"
        Serializer.startElement "Result"
        Serializer.writeString CStr(Answer)
        Serializer.endElement
        Serializer.endElement
        Serializer.endBody
        Serializer.endEnvelope
        
        Process = True
        
    End Function
    
    Sub ServerFault(ByVal FaultString)
        
        ReturnFault "Server", FaultString
        
    End Sub
    
    Sub ClientFault(ByVal FaultString)
        
        ReturnFault "Client", FaultString
        
    End Sub
    
    Sub ReturnFault( ByVal FaultCode, ByVal FaultString)
    
        On Error Resume Next
        
        Err.Clear
        
        Dim Serializer
        
        Set Serializer = Server.CreateObject("MSSOAP.SoapSerializer")
        If Err Then
        
            Response.AppendToLog "Could not create SoapSerializer. " & Err.Description
            
        Else
        
            Serializer.Init Response
        
            Serializer.startEnvelope
            Serializer.startBody
            Serializer.startFault FaultCode, FaultString
            Serializer.startFaultDetail
            Serializer.endFaultDetail
            Serializer.endFault
            Serializer.endBody
            Serializer.endEnvelope
            
        End If
      
    End Sub
    %>  
    					
  3. Create a directory named SoapTest on your disk.
  4. Put the supplied Calc.vbs file on C:\SoapTest.
  5. Create the virtual directory Soap in the Internet Information Services (IIS) and the local path for this virtual directory. This associates with the path where the Calc.asp and the Calc.vbs files are located.
  6. Move to the command prompt.
  7. Type ping 10.10.10.10 to make sure you cannot reach this address. You see:
    Request timed out
    iterated four times. If you cannot reach this address, go to step 9.
  8. If you can reach 10.10.10.10, then edit the file c:\SoapTest\Calc.vbs and change the following line:

    Const END_POINT_URL = "http://10.10.10.10/Calc.asp"

    to read:

    Const END_POINT_URL = "http://ANOTHER_IP_ADDRESS/Calc.asp"

    where:

    ANOTHER_IP_ADDRESS is an IP address that you cannot reach.
  9. Save the file, and then close the file.
  10. Run the file, and then type wscript c:\soaptest\calc.vbs.
  11. You receive a message box that displays the following:

    "Connecting http://10.10.10.10/Calc.asp"
  12. After approximately a 20 second pause, a Microsoft VBScript runtime error is thrown:
    Script: c:\Soaptest\calc.vbs Line: 42 Char: 5 Error: Unknown runtime error Code: 800A151E Source: Microsoft VBScript runtime error
    Line 42 is the statement:
    Connector.EndMessage

Modification Type:MinorLast Reviewed:10/19/2005
Keywords:kbHotfixServer kbQFE kbbug kbfix KB311275