Microsoft KB Archive/321015

= STS: Procedure to Programmatically Connect MSXML 4.0 to SharePoint Portal Server Is Not Successful =

Article ID: 321015

Article Last Modified on 3/4/2004

-

APPLIES TO


 * Microsoft SharePoint Team Services
 * Microsoft SharePoint Portal Server 2001 Service Pack 1

-



This article was previously published under Q321015



SYMPTOMS
If you try to programmatically configure MSXML 4.0 to connect to SharePoint Portal Server, the procedure is unsuccessful.



CAUSE
This behavior occurs because SharePoint Portal Server (SPS) is not compatible with MSXML 4.0. Specifically, the ServerXMLHTTP object cannot be used to connect to an SPS server.



WORKAROUND
To work around this issue, use &quot;Msxml2.XMLHTTP.4.0&quot; instead of &quot;Msxml2.ServerXMLHTTP.4.0&quot; in your code (see the &quot;More Information&quot; section of this article). Or, use MSXML 3.0 to connect to SPS.



MORE INFORMATION
This issue occurs because SPS is not fully HTTP 1.1-compliant. SPS inserts an extra CRLF character in chunked content encoding, in violation of the RFC. This extra CRLF character confuses Windows HTTP 5.0. The following Microsoft Visual Basic code illustrates this problem: main 'Reference: Microsoft XML, v4.0 Private Sub Main

Dim strRequest Dim m_xh ' As msxml2.ServerXMLHTTP

Dim Server Dim Name Dim Password

'TODO: Change these three lines Server = &quot;MySPSServer&quot; Folder = &quot;MyWorkspace&quot; URL = &quot;http://&quot; & Server & &quot;/&quot; & Folder Name = &quot;Domain\Account&quot; Password = &quot;password&quot;

strRequest = &quot;&quot; & vbCrLf & &quot;&quot; & vbCrLf strRequest = strRequest & &quot;&quot; & vbCrLf & &quot;select &quot;&quot;DAV:href&quot;&quot;&quot; & vbCrLf strRequest = strRequest & &quot; From Scope(&quot; & &quot;'DEEP TRAVERSAL OF &quot;&quot;&quot; & URL & &quot;&quot;&quot;')&quot; strRequest = strRequest & vbCrLf & &quot; &quot; & vbCrLf & &quot;&quot;

Set m_xh = CreateObject(&quot;Msxml2.ServerXMLHTTP.4.0&quot;)

m_xh.Open &quot;SEARCH&quot;, URL, False, Name, Password

m_xh.SetRequestHeader &quot;content-Type&quot;,&quot;Text/xml&quot; m_xh.send strRequest

MsgBox m_xh.responseText

If Err.Number Then MsgBox (&quot;Error: &quot; & Hex(Err.Number) & &quot;: &quot; & Err.Description) End Sub

Additional query words: 80072EE4 winhttp prb SPTS STS inf

Keywords: kbprb KB321015

-

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

© Microsoft Corporation. All rights reserved.