Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old March 4th, 2009, 03:41 AM
Registered User
 
Join Date: May 2008
Location: Guwahati, Assam, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with XMLHTTP in ASP 3.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 . Below the is the page in question
http://indiacode.nic.in/qrydisp.asp?tfnm=188712%20&tfnm2=1
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..
  #2 (permalink)  
Old March 4th, 2009, 10:09 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Yes, it sure looks like character set problem. I assume you tried utf-8, as well?? (But it doesn't "look" like UTF-8.)

It also does *NOT* look like XML, so why are you asking for "text/xml" as the content-type???
  #3 (permalink)  
Old March 5th, 2009, 03:03 AM
Registered User
 
Join Date: May 2008
Location: Guwahati, Assam, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I had even tried using the following .. still i not able to see any out ..

Code:
xmlhttp.setRequestHeader "Content-type", "text/HTML; charset=utf-8"
I m getting no clue .. why this is happening ..!!! :-((
  #4 (permalink)  
Old March 25th, 2009, 05:26 AM
Registered User
 
Join Date: May 2008
Location: Guwahati, Assam, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default XMlhttp.responsebody

Hi

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

just replaced
Code:
   getHTML = xmlHttp.responseText 
with

Code:
getHTML = xmlHttp.ResponseBody

Thanks for replying Old Pedant

Regards
Suraj jain


Similar Threads
Thread Thread Starter Forum Replies Last Post
Posting XML to an ASP page using XMLHTTP Kells Classic ASP XML 5 April 24th, 2014 05:54 AM
Problem with using POST method with XMLHTTP vvr Classic ASP XML 1 December 6th, 2004 01:44 AM
problem parsing html using MS.XMLHTTP awardle Classic ASP XML 1 September 15th, 2003 11:38 PM
Problem With Microsoft.XMLHTTP binod XSLT 2 August 13th, 2003 02:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.