PRB: Creation of Active User Object Fails After Call to BinaryRead (296564)



The information in this article applies to:

  • Microsoft Site Server 3.0
  • Microsoft Internet Information Server 4.0
  • Microsoft Internet Information Server 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:

SYMPTOMS

Site Server Membership.UserObjects in an Active Server Pages (ASP) page, for example
set usr = server.CreateObject ("Membership.UserObjects.1")
				
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("MSXML2.DOMDOCUMENT.3.0")
 doc.load(Request)
 set usr = server.CreateObject ("Membership.UserObjects.1")
				

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 ("Membership.UserObjects.1")
set doc = Server.CreateObject("MSXML2.DOMDOCUMENT.3.0")
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:

Steps to Reproduce Behavior

  1. Copy the following code and paste it into a into a new file. Save the file as Client.asp:
    <HTML>
    <HEAD>
    <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
    <TITLE></TITLE>
    </HEAD>
    <BODY>
    
    <SCRIPT LANGUAGE=javascript>
    	function send()
    	{
         var xmlhttp = new ActiveXObject ("MSXML2.XMLHTTP.3.0");
         var xmldoc = new ActiveXObject("MSXML2.DOMDOCUMENT.3.0");
         xmlhttp.Open("POST", "serverModule.asp", false);
         xmldoc.loadXML("<hello>Hello John</hello>");
         xmlhttp.Send(xmldoc);
    
         alert(xmlhttp.responseText);
    	}
    </SCRIPT>
    <INPUT type="button" value="Test" onClick="send();"> 
    </BODY>
    </HTML>
    					
  2. Copy and paste following code to serverModule.asp in the same folder as Client.asp:
    <%@ Language=vbScript %>
    <%
    	Response.Expires=-1000
    	set doc = Server.CreateObject("MSXML2.DOMDOCUMENT.3.0")
    	doc.load(Request)
    	
    	set usr = server.CreateObject ("Membership.UserObjects.1")
    	
            if err.number <> 0	   then
    	   strTemp = "<error>" &err.description& "</error>"
               Response.Write(strTemp)
             end if	        
    
    %>
    					
  3. Set up a virtual directory that points to the folder, and then load Client.asp. Click Test. You receive the error message.

Modification Type:MinorLast Reviewed:6/23/2005
Keywords:kbprb KB296564