Baahubali
Baahubali

Reputation: 4800

Error in Classic ASP page while reading rss feed

We have an old application developed in classic ASP and today it is generating an error while consuming RSS feed. After through investigating(tried to wrote code in .NET to get detailed error) found its special character, in generated output which is causing trouble. When you run RSS feed in browser and run generated XML from local server, it works fine.

 Error: System error: -2147012866.
 Line:  0
 Text:  

I have no idea how to fix it.

<%
 Dim objXML
 Dim objItemList
 Dim objItem
 Dim I
Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument")
objXML.async = False
I = 0

objXML.setProperty "ServerHTTPSRequest", True
'objXML.Load(Server.MapPath("abcd.xml"))
objXML.Load("http://search.jobs.wa.gov.au/wagov.rss?agencyID=925")
If objXML.parseError.errorCode <> 0 Then
  Response.Write "<pre>" & vbCrLf
  Response.Write "<strong>Error:</strong> " & objXML.parseError.reason
  Response.Write "<strong>Line:</strong>  " & objXML.parseError.line   &    vbCrLf
 Response.Write "<strong>Text:</strong>  " &  Server.HTMLEncode(objXML.parseError.srcText) & vbCrLf
 Response.Write "</pre>" & vbCrLf
End If
%>

Upvotes: 0

Views: 521

Answers (2)

Imran Shafique
Imran Shafique

Reputation: 91

Zam, Even if you correct it from ServerHTTPSRequest to ServerHTTPRequest in SetProperty, still nothing works.

As mentioned in question, it also worked fine when you use saved the XML file(generated from RSS FEED)

Also, if you look into below post, it states that it's all because of encoding="iso-8859-1" which is also the case for above issue.

       http://stackoverflow.com/questions/4332828/vbscript-tries-to-read-rss-feeds-have-issue-of-system-does-not-support-the-speci

but solution provided there causes another error that The connection with the server was terminated abnormally

Upvotes: 1

Zam
Zam

Reputation: 2940

I believe error in objXML.SetProperty "ServerHTTPSRequest", True

Because

Error description: Property name is invalid. 

Upvotes: 0

Related Questions