Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP XML
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 4th, 2009, 02: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..
Reply With Quote
  #2 (permalink)  
Old March 4th, 2009, 09:09 PM
Friend of Wrox
 
Join Date: Jun 2008
Location: Snohomish, WA, USA
Posts: 1,652
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???
Reply With Quote
  #3 (permalink)  
Old March 5th, 2009, 02: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 ..!!! :-((
Reply With Quote
  #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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 12: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



All times are GMT -4. The time now is 08:15 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.