elliottbenzle
asked on
Connecting to server using MSXML2.ServerXMLHTTP
My page is connecting to a server to retrieve search results. My code looks like this:
Dim TestString
url = "http://sitelife.construction.com/ver1.0/Direct/Jsonp?r={%22Requests%22:[{%22Sear chAction%2 2:{%22Numb erPerPage% 22:10,%22O nPage%22:1 ,%22Search String%22: %22Pennsyl vania%22,% 22SearchTy pe%22:%22B logPost%22 }}],%22Uni queId%22:0 }"
set xmlhttp = CreateObject("MSXML2.Serve rXMLHTTP")
xmlhttp.open "GET", url, false
xmlhttp.send ""
TestString = xmlhttp.responseText
'Response.write TestString
set xmlhttp = nothing
This works fine on my personal server, the results are here:
http://www.glowfishtw.com/asp_parse.asp
But when I try to run the same page on the development server at my office I get either the error:
msxml3.dll error '80072efd'
A connection with the server could not be established
or
msxml3.dll error '800c0005'
The system cannot locate the resource specified.
I get these different errors through trying different connection types I change this line:
set xmlhttp = CreateObject("MSXML2.Serve rXMLHTTP")
to one of these
set xmlhttp = Server.CreateObject("Micro soft.XMLHT TP")
set xmlhttp = Server.CreateObject("Msxml 2.ServerXM LHTTP.3.0" )
set xmlhttp = Server.CreateObject("Msxml 2.XMLHTTP. 3.0")
none of these work on my development server at the office. SO I don't think it is the version of xmlhttp.
Does anyone have any ideas what might be causing these errors?
I am able to connect to the server using javascript. The following piece of code does work on both servers, but I am unable to duplicate it in asp VBscript.
<script language="JavaScript">
var requestBatch = new RequestBatch();
var serverUrl = "http://sitelife.construction.com/ver1.0/Direct/Process";
var searchType = "BlogPost"; // others are Comment, ForumPost, Gallery, Photo, Video
// var searchString = "Title:Pennsylvania"; // To search only the title for Penn
var searchString = "Pennsylvania";
requestBatch.AddToRequest( new SearchAction(searchType, searchString, 10, 1));
requestBatch.BeginRequest( serverUrl, clientCallBack);
function clientCallBack(responseBat ch) {
// console.dir(responseBatch) ; // -- use this in Firefox (only) to show the responseBatch object in the console to see what data is available.
}
</script>
Dim TestString
url = "http://sitelife.construction.com/ver1.0/Direct/Jsonp?r={%22Requests%22:[{%22Sear
set xmlhttp = CreateObject("MSXML2.Serve
xmlhttp.open "GET", url, false
xmlhttp.send ""
TestString = xmlhttp.responseText
'Response.write TestString
set xmlhttp = nothing
This works fine on my personal server, the results are here:
http://www.glowfishtw.com/asp_parse.asp
But when I try to run the same page on the development server at my office I get either the error:
msxml3.dll error '80072efd'
A connection with the server could not be established
or
msxml3.dll error '800c0005'
The system cannot locate the resource specified.
I get these different errors through trying different connection types I change this line:
set xmlhttp = CreateObject("MSXML2.Serve
to one of these
set xmlhttp = Server.CreateObject("Micro
set xmlhttp = Server.CreateObject("Msxml
set xmlhttp = Server.CreateObject("Msxml
none of these work on my development server at the office. SO I don't think it is the version of xmlhttp.
Does anyone have any ideas what might be causing these errors?
I am able to connect to the server using javascript. The following piece of code does work on both servers, but I am unable to duplicate it in asp VBscript.
<script language="JavaScript">
var requestBatch = new RequestBatch();
var serverUrl = "http://sitelife.construction.com/ver1.0/Direct/Process";
var searchType = "BlogPost"; // others are Comment, ForumPost, Gallery, Photo, Video
// var searchString = "Title:Pennsylvania"; // To search only the title for Penn
var searchString = "Pennsylvania";
requestBatch.AddToRequest(
requestBatch.BeginRequest(
function clientCallBack(responseBat
// console.dir(responseBatch)
}
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER