troubleshooting Question

MSXML3.0 Working on some sites but not this one - after hours I am still lost

Avatar of pete5950
pete5950 asked on
Microsoft IIS Web ServerVB Script
1 Comment1 Solution426 ViewsLast Modified:
There appears to be a configuration issue with MSXML3.0 on this Win2K box; but, almost identical code is working on another iste on th sam box. This one site is failing with a non-descriptive error message. I cannot find any refernce anywhere. It is probobly one of those basic stupid things, but is escaping me.

Sample code creates an html file in the IiS home idrectory but instead of populating the .htm file with the code it places "This domain is not configured for this service. Please contact the webmaster to have it enabled." as the only content.

I must be being an idiot - it is working in the dev environment but failing as described on a production server successfully serving similar code in another site.  - THX
sub buildStaticHTML(byVal pgID, byVal pgName)
	if isnumeric(pgID) and len(pgID)>0 and not isnull(pgID) and len(pgName)>0 then
		if pgID=1000 then
			sURL = "http://www.sitename.com/index.asp?cst=true"
		else
			sURL = "http://www.sitename.com/content.asp?pgid="&pgID&"&cst=true"
		end if
		
		call buildMessageProgress("Source Page: " & sURL,1)
		call buildMessageProgress("Static Page: " & sFileName,1)
		
		sFileName = pgName&".htm"
		sDirectoryPath = Server.MapPath("../home_directory")
		
		set oXMLHTTP = Server.CreateObject("msxml2.serverxmlhttp")
		
		Dim lResolve, lConnect, lSend, lReceive
		
		lResolve = 100 * 1000
		lConnect = 500 * 1000
		lSend = 100 * 1000
		lReceive = 500 * 1000
		
		oXMLHTTP.setTimeouts lResolve, lConnect, lSend, lReceive
		
		' Opens the connection to the remote server pointing to the URL Address.
		oXMLHTTP.Open "GET", sURL, False
		' Sends the http request and returns the data:
		'on error resume next
		oXMLHTTP.Send
		if (err.number <> 0) then
			sError = err.description &" -- "& err.source
			bError = true
			err.clear
		end if
		on error goto 0
		
		if (bError = false) then
			' Create a file for writing the html source code
			Set oFSO	= Server.CreateObject("Scripting.FileSystemObject")
			'on error resume next
			Set oFile	= oFSO.CreateTextFile(sDirectoryPath & "\" & sFileName, True, False)
			sGrabHTML	= BinToText(oXMLHTTP.responseBody, 35000)
			if (err <> 0) then
				response.write "<BR><SPAN CLASS='Error'>ERROR: check details for:"& sURL &"<BR>"& err.description &"<BR>"& err.source
				bError = true
				err.clear
			end if
 
			on error goto 0
			'sGrabHTML	= ""
			if (bError = false) then
				dim bReschedule : bReschedule = false
				
				'# Error checking...
				if ( (instr(lcase(sGrabHTML), "<html>") < 1) AND (instr(lcase(sGrabHTML), "</html>") < 1) ) then
					response.write "<BR><SPAN CLASS='Error'>ERROR: File not 100% complete!</SPAN>" &vbcrlf
				end if
				
				'# Check for 500 100 error message
				if (instr(lcase(sGrabHTML), "500.100") > 0) AND (instr(lcase(sGrabHTML), "internal server error") > 0)then
					response.write "<BR><SPAN CLASS='Error'>ERROR: Suspected 500-100 error page detected</SPAN>" &vbcrlf
				end if
				
				'# Check for 404 error message
				if (instr(lcase(sGrabHTML), "http 404") > 0) AND (instr(lcase(sGrabHTML), "file not found") > 0)then
					response.write "<BR><SPAN CLASS='Error'>ERROR: 404 error page detected</SPAN>" &vbcrlf
				end if
				
				'# check for Zero-Sized file
				if ( (len(sGrabHTML) = 0) or (isNull(sGrabHTML)) ) then
					response.write "<BR><SPAN CLASS='Error'>ERROR: zero-sized file created</SPAN>" &vbcrlf
				end if
				
				'# replace dynamic links with named links
				
				call buildMessageProgress("Generating Static Links",4)
				
				chkstr = "content.asp?pgid="
				chkStart = 1
				lastStart = 0
				loc = instr(chkStart, lcase(sGrabHTML), chkstr, 1)
				do while loc > 0 and chkStart > 0
					loc = instr(chkStart, lcase(sGrabHTML), chkstr, 1) + len(chkstr)
					chkStart = loc
					
					tmpID = mid(lcase(sGrabHTML), loc, 12)
					linkID = ""
					
					'response.write "<br>" & chkStart &" <br> ! - "&tmpID&"<br>"
					do while isnumeric(left(tmpID,1)) AND len(tmpID)>0 ' chunk out numeric string : char by char checking
						linkID = linkID & left(tmpID,1)
						tmpID = right(tmpID,len(tmpID)-1)
					loop
					
					if blnDEBUG then response.write " **"&linkID&"** "
					
					if isnumeric(linkID) and len(linkID)>0 then
						pageName = getFileName(linkID)
						if blnDEBUG then response.write "<br>---"&pageName&"---<br>"
						if len(pageName)>0 then
							if left(tmpID,1) = "&" then
								sGrabHTML = replace(sGrabHTML,chkstr&linkID&"&",pageName&".htm?")
							else
								sGrabHTML = replace(sGrabHTML,chkstr&linkID,pageName&".htm")
							end if
							call buildMessageProgress("pageID: "&linkID&"<br>new link:" & pageName & ".htm" ,3)
						end if
					end if
					
					if chkStart < lastStart then exit do
					lastStart = chkStart
				loop
				
				oFile.Write(sGrabHTML)
				oFile.Close
				Set oFile = Nothing
			end if
			Set oFSO = nothing
		end if
		
		Set oXMLHTTP = nothing
		Set sGrabHTML = nothing
	end if
end sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 1 Comment.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros