d***@gmail.com
2006-07-02 02:40:45 UTC
I am opening a GET request for an XML file on a remote server via a
proxy. I
cannot control the remote server. It is dynamically generating an XML
file
with Content-Type=text/html in the response header. How can I get
ServerXMLHttp to ignore that and think it is text/xml? I can't
setRequestHeader on a GET request, and as it is, responseXML returns
empty
and responseText has the space delimited data that I cannot easily
seperate
into nodes. What to do? Here is my code:
set xmlHttp = Server.CreateObject(""MSXML2.ServerXMLHTTP.4.0"")
xmlHttp.setProxy 2, ""http://virtualproxy.xxx.com:8080""
XML_path = ""http://news.xxx.com/xmlnewslink.cfm?vendorid=194&id="" &
ID
xmlHttp.open ""GET"", XML_path, False
xmlHttp.send
'at this point, it errs out due to an empty responseXML
set a_title =
xmlHttp.responseXML.selectSingleNode(""/NEWS_ITEM/NEWS_TITLE"")
set a_body =
xmlHttp.responseXML.selectSingleNode(""/NEWS_ITEM/NEWS_BODY"")
Note the culprit (I think) is a cold fusion page which generates the
XML
page, yet sets a content-type of text/html...how can I override
this?????
--
proxy. I
cannot control the remote server. It is dynamically generating an XML
file
with Content-Type=text/html in the response header. How can I get
ServerXMLHttp to ignore that and think it is text/xml? I can't
setRequestHeader on a GET request, and as it is, responseXML returns
empty
and responseText has the space delimited data that I cannot easily
seperate
into nodes. What to do? Here is my code:
set xmlHttp = Server.CreateObject(""MSXML2.ServerXMLHTTP.4.0"")
xmlHttp.setProxy 2, ""http://virtualproxy.xxx.com:8080""
XML_path = ""http://news.xxx.com/xmlnewslink.cfm?vendorid=194&id="" &
ID
xmlHttp.open ""GET"", XML_path, False
xmlHttp.send
'at this point, it errs out due to an empty responseXML
set a_title =
xmlHttp.responseXML.selectSingleNode(""/NEWS_ITEM/NEWS_TITLE"")
set a_body =
xmlHttp.responseXML.selectSingleNode(""/NEWS_ITEM/NEWS_BODY"")
Note the culprit (I think) is a cold fusion page which generates the
XML
page, yet sets a content-type of text/html...how can I override
this?????
--