下面这样提示如何解决
msxml4.dll 错误 'c00ce23b'
WINHTTP5.DLL or higher must be registered to use the ServerXMLHTTP object.
/index.asp,行 44
44行代码是:http.open("GET",url,false);
index.asp代码如下:
<%@ Language=JScript %>
<%
// Sample ASP code that uses CAS
// By Howard Gilbert
// If you logon, it says "Hello " followed by your userid
// For the Web server to talk to the CAS server, this code depends on the
// Microsoft ServerXMLHTTP control provided with MSXML. If the MS XML
// parser is not already installed on the IIS host machine,
// download version 3.0 SP1 or better from http://www.microsoft.com/xml
// Insert name of CAS Server at your location
var CAS_Server = "https://140.1.2.15:8443/cas/";
// Insert public name of IIS Server hosting this script
// Note: Request.ServerVariables("SERVER_NAME") or anything based on
// the HTTP "Host" header should NOT be used; this header is supplied by
// the client and isn't trusted. (--SB)
var MyServer = "http://140.1.2.3/";
greeting = "World"; // In case I fail
// See if already logged on
var uid = Session.Contents("Netid");
if (!uid){
// Check for ticket returned by CAS redirect
var ticket = Request.QueryString.Item("ticket").Item;
if (!ticket) {
// No session, no ticket, Redirect to CAS Logon page
var url = CAS_Server+"login?"+
"service="+MyServer+"index.asp"
Response.Redirect(url);
Response.End;
} else {
// Back from CAS, validate ticket and get userid
var http = Server.CreateObject("MSXML2.ServerXMLHTTP.4.0");
var url =CAS_Server+"validate?ticket="+ticket+"&"+
"service="+MyServer+"HelloCas/default.asp";
http.open("GET",url,false); // 这里是44行,HTTP transaction to CAS server
Response.End;
http.send();
var resp=http.responseText.split('\n'); // Lines become array members
if (resp[0]=="yes") // Logon successful
greeting=resp[1]; // get userid for message
Session.Contents("Netid")=resp[1]; // Save for subsequent calls
}
}
%>
<HTML>
<HEAD><title>CAS ASP Example application</title></HEAD>
<BODY>
<P>欢迎进入办公自动化 <%=greeting%></P>
</BODY>
</HTML>