Microsoft KB Archive/311275

= FIX: SOAP SDK: ConnectTimeout Does Not Apply to Dotted IP Address =

Article ID: 311275

Article Last Modified on 10/19/2005

-

APPLIES TO


 * Microsoft SOAP Toolkit 2.0 Service Pack 2

-



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:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

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



Steps to Reproduce the Behavior
  Save the following file as Calc.vbs. Option Explicit Const BASE_SOAP_ACTION_URI = &quot;http://tempuri.org/action/Calc.&quot; Const WRAPPER_ELEMENT_NAMESPACE = &quot;http://tempuri.org/message/&quot; Const END_POINT_URL = &quot;http://10.10.10.10/soaptest/Calc.asp&quot;

WScript.echo &quot;Connecting: &quot; & END_POINT_URL WScript.Echo &quot;14+28=&quot; & Execute(END_POINT_URL, &quot;Add&quot;, 14,28)

Function Execute(ByVal EndPointURL, ByVal Method, ByVal A, ByVal B)

Dim Serializer Dim Reader Dim Connector Set Connector = CreateObject(&quot;MSSOAP.HttpConnector&quot;) Connector.Property(&quot;EndPointURL&quot;) = EndPointURL Connector.Property(&quot;SoapAction&quot;) = BASE_SOAP_ACTION_URI & Method

'The &quot;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(&quot;Timeout&quot;) = 1000 'With this hotfix you can override the connect timeout by   'using the &quot;ConnectTimeOut&quot; property '   Connector.Property(&quot;ConnectTimeOut&quot;) = 5000 Connector.BeginMessage Set Serializer = CreateObject(&quot;MSSOAP.SoapSerializer&quot;) Serializer.Init Connector.InputStream Serializer.startEnvelope Serializer.startBody Serializer.startElement Method, WRAPPER_ELEMENT_NAMESPACE,, &quot;m&quot; Serializer.startElement &quot;A&quot; Serializer.writeString A   Serializer.endElement Serializer.startElement &quot;B&quot; Serializer.writeString B   Serializer.endElement Serializer.endElement Serializer.endBody Serializer.endEnvelope Connector.EndMessage Set Reader = CreateObject(&quot;MSSOAP.SoapReader&quot;) Reader.Load Connector.OutputStream If Not Reader.Fault Is Nothing Then Execute = &quot;FAULT: &quot; & Reader.faultstring.Text Else Execute = Reader.RPCResult.Text End If End Function   Save the following file as Calc.asp <%@ LANGUAGE=VBScript %> <%

Option Explicit

Private Const WRAPPER_ELEMENT_NAMESPACE = &quot;http://tempuri.org/message/&quot;

Response.ContentType = &quot;text/xml&quot; If Not Process Then Response.Status = &quot;500 Internal Server Error&quot; 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(&quot;MSSOAP.SoapReader&quot;) If Err Then ServerFault &quot;Cannot create MSSOAP.SoapReader. &quot; & Err.Description & &quot;(0x&quot; & Hex(Err.Number) & &quot;)&quot; Exit Function End If   Reader.Load Request If Err Then ClientFault &quot;Cannot load request. &quot; & Err.Description Exit Function End If   If Reader.RPCStruct Is Nothing Then ClientFault &quot;No RPC wapper element found in request.&quot; Exit Function End If   MethodName = Reader.RPCStruct.baseName If Err Then ClientFault &quot;Cannot get method name. &quot; & Err.Description Exit Function End If   Set Parameter = Reader.RPCParameter(&quot;A&quot;) If Parameter Is Nothing Then ClientFault &quot;Cannot find parameter A. &quot; & Err.Description Exit Function End If   A = CDbl(Parameter.Text) If Err Then ClientFault &quot;Parameter A not a Double value. &quot; & Err.Description Exit Function End If   Set Parameter = Reader.RPCParameter(&quot;B&quot;) If Parameter Is Nothing Then ClientFault &quot;Cannot find parameter B. &quot; & Err.Description Exit Function End If   B = CDbl(Parameter.Text) If Err Then ClientFault &quot;Parameter B not a Double value. &quot; & Err.Description Exit Function End If   Select Case MethodName Case &quot;Add&quot; Answer = A + B       Case &quot;Subtract&quot; Answer = A - B       Case &quot;Divide&quot; Answer = A / B       Case &quot;Multiply&quot; Answer = A * B       Case Else ClientFault &quot;Unknown method: &quot;&quot;&quot; & MethodName & &quot;&quot;&quot;.&quot; Exit Function End Select Set Serializer = Server.CreateObject(&quot;MSSOAP.SoapSerializer&quot;) If Err Then ServerFault &quot;Cannot create MSSOAP.SoapSerializer. &quot; & Err.Description & &quot;(0x&quot; & Hex(Err.Number) & &quot;)&quot; Exit Function End If   Serializer.Init Response Serializer.startEnvelope Serializer.startBody Serializer.startElement MethodName & &quot;Response&quot;, WRAPPER_ELEMENT_NAMESPACE,, &quot;m&quot; Serializer.startElement &quot;Result&quot; Serializer.writeString CStr(Answer) Serializer.endElement Serializer.endElement Serializer.endBody Serializer.endEnvelope Process = True End Function

Sub ServerFault(ByVal FaultString) ReturnFault &quot;Server&quot;, FaultString End Sub

Sub ClientFault(ByVal FaultString) ReturnFault &quot;Client&quot;, FaultString End Sub

Sub ReturnFault( ByVal FaultCode, ByVal FaultString)

On Error Resume Next Err.Clear Dim Serializer Set Serializer = Server.CreateObject(&quot;MSSOAP.SoapSerializer&quot;) If Err Then Response.AppendToLog &quot;Could not create SoapSerializer. &quot; & 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 %>                      Create a directory named SoapTest on your disk. Put the supplied Calc.vbs file on C:\SoapTest. 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.</li> Move to the command prompt.</li> 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.</li> 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 = &quot;http://10.10.10.10/Calc.asp&quot;

to read:

Const END_POINT_URL = &quot;http://ANOTHER_IP_ADDRESS/Calc.asp&quot;

where:

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

&quot;Connecting http://10.10.10.10/Calc.asp&quot;</li> 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

</li></ol>

Keywords: kbbug kbfix kbqfe kbhotfixserver KB311275

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.