Microsoft KB Archive/296564

= PRB: Creation of Active User Object Fails After Call to BinaryRead =

Article ID: 296564

Article Last Modified on 6/23/2005

-

APPLIES TO


 * Microsoft Site Server 3.0 Standard Edition
 * Microsoft Internet Information Server 4.0
 * Microsoft Internet Information Services 5.0

-



This article was previously published under Q296564



We strongly recommend that all users upgrade to Microsoft Internet Information Services (IIS) version 6.0 running on Microsoft Windows Server 2003. IIS 6.0 significantly increases Web infrastructure security. For more information about IIS security-related topics, visit the following Microsoft Web site:

http://www.microsoft.com/technet/security/prodtech/IIS.mspx



SYMPTOMS
Site Server Membership.UserObjects in an Active Server Pages (ASP) page, for example set usr = server.CreateObject (&quot;Membership.UserObjects.1&quot;) use ASP Request to retrieve information from Site Server. If BinaryRead is called on the ASP Request object before this creation, the following error occurs:

error 'ASP 0208 : 80020009'

Cannot use generic Request collection

Cannot use the generic Request collection after calling BinaryRead.

NOTE: With MSXML 3.0, IXMLDOMDocument::load can be called directly with Request object, and the load internally calls BinaryRead on Request to retrieve the XML data stream. For example: set doc = Server.CreateObject(&quot;MSXML2.DOMDOCUMENT.3.0&quot;) doc.load(Request) set usr = server.CreateObject (&quot;Membership.UserObjects.1&quot;)

If the load is called before the creation of the UserObjects, the error described in this section occurs.



RESOLUTION
To work around the problem, create the Membership.UserObjects before calling BinaryRead. For example: set usr = server.CreateObject (&quot;Membership.UserObjects.1&quot;) set doc = Server.CreateObject(&quot;MSXML2.DOMDOCUMENT.3.0&quot;) doc.load(Request)



STATUS
This behavior is by design.



MORE INFORMATION
To run the sample code, you must have the MSXML 3.0 parser installed. It is available at the following Microsoft Web site:

http://msdn.microsoft.com/downloads/default.asp?URL=/code/sample.asp?url=/msdn-files/027/001/591/msdncompositedoc.xml

Steps to Reproduce Behavior
  Copy the following code and paste it into a into a new file. Save the file as Client.asp :      

 function send {    var xmlhttp = new ActiveXObject (&quot;MSXML2.XMLHTTP.3.0&quot;); var xmldoc = new ActiveXObject(&quot;MSXML2.DOMDOCUMENT.3.0&quot;); xmlhttp.Open(&quot;POST&quot;, &quot;serverModule.asp&quot;, false); xmldoc.loadXML(&quot; Hello John &quot;); xmlhttp.Send(xmldoc);

alert(xmlhttp.responseText); } </SCRIPT> <INPUT type=&quot;button&quot; value=&quot;Test&quot; onClick=&quot;send;&quot;> </BODY> </HTML> </li> <li> Copy and paste following code to serverModule.asp in the same folder as Client.asp: <%@ Language=vbScript %> <%   Response.Expires=-1000 set doc = Server.CreateObject(&quot;MSXML2.DOMDOCUMENT.3.0&quot;) doc.load(Request) set usr = server.CreateObject (&quot;Membership.UserObjects.1&quot;) if err.number <> 0      then strTemp = &quot; &quot; &err.description& &quot; &quot; Response.Write(strTemp) end if

%>                   </li> <li>Set up a virtual directory that points to the folder, and then load Client.asp. Click Test. You receive the error message.</li></ol>

Additional query words: MSXML BinaryRead

Keywords: kbprb KB296564

-

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

© Microsoft Corporation. All rights reserved.