Welcome to WebmasterWorld Guest from 3.229.122.166

Forum Moderators: ocean10000

Message Too Old, No Replies

Problem with XMLHTTP in ASP 3.0

     
7:29 am on Mar 4, 2009 (gmt 0)

New User

10+ Year Member

joined:Mar 4, 2009
posts: 2
votes: 0


Hi

i have been trying to get the contents from a webpage using MSXML2.ServerXMLHTTP . Although i had done the same in past without any issues..

but now while get a content from a page , i am getting no response.text . Have checked the status it says 200. Seems like the problem is due to character encoding .

Code i am using is

<%
strUrl="http://indiacode.nic.in/qrydisp.asp?tfnm=188712%20&tfnm2=1"
Set xmlHttp = Server.Createobject("MSXML2.ServerXMLHTTP")
xmlHttp.Open "GET", strUrl, False
xmlHttp.setRequestHeader "User-Agent", "asp httprequest"
xmlhttp.setRequestHeader "Content-type", "text/xml; charset=utf-16"
xmlHttp.Send
getHTML = xmlHttp.responseText
xmlHttp.abort()
set xmlHttp = Nothing
response.write getHTML
%>

Can u please guide me how to get the contents..

[edited by: coopster at 9:14 pm (utc) on Mar. 4, 2009]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]

11:54 pm on Mar 4, 2009 (gmt 0)

Administrator

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month

joined:Jan 14, 2004
posts:864
votes: 3


Well one of the things that I could think of is that they are blocking your request and setting a 200 status code, to make you pull your hair out.
9:30 am on Mar 25, 2009 (gmt 0)

New User

10+ Year Member

joined:Mar 4, 2009
posts: 2
votes: 0


Hi

I finally got the solution.. here is the tweak..

just replaced

getHTML = xmlHttp.responseText

with

getHTML = xmlHttp.ResponseBody

Thanks for replying Ocean10000

Regards
Suraj jain

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members