473,385 Members | 2,015 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

issues with MSXML2.FreeThreadedDOMDocument

Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocumen t")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load
("http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml")
If objXML.parseError.errorCode <> 0 Then
'Response.Write "<pre>" & vbCrLf
Response.Write ("<strong>Error:</strong> " &
objXML.parseError.reason )
Select Case objXML.parseError.errorCode
Case 0
strResult = "Valid: " & strFileName & vbCr
Case Else
strResult = vbCrLf & "ERROR! Failed to validate " &
vbCrLf & objXML.parseError.reason & vbCr & "Error code: " &
objXML.parseError.errorCode & ", Line: " & objXML.parseError.line & ",
Character: " & objXML.parseError.linepos & ", Source: " & Chr(34) &
objXML.parseError.srcText & Chr(34) & " - " & Now & vbCrLf
End Select
Response.Write ("<strong>Line:</strong> " & objXML.parseError.line
& vbCrLf)
Response.Write ("<strong>Text:</strong> " & strResult)
Server.HTMLEncode(objXML.parseError.srcText) & vbCrLf
'Response.Write "</pre>" & vbCrLf
End If

Set objItemList = objXML.getElementsByTagName("item")
Set objXML = Nothing
intcount = 0
For Each objItem In objItemList
intcount = intcount+1
' childNodes: 0=title, 2=link, 1=description
Response.Write ("<p>&raquo;&nbsp;" & vbLf)
Response.Write ("<a href=""" & objItem.childNodes(2).text & """
target = ""bbcnews"">" & vbLf)
Response.Write (objItem.childNodes(0).text & "</a><br />&nbsp;
&nbsp;&nbsp;" & vbLf)
response.write ("<span style=""font-style:italic"">" &
objItem.childNodes(1).text & "</span>" & vbLf)
Response.Write ("</p>" & vbCrLf)
if intcount > 1 then exit for
Next"

Is there any way to get the raw feed from the XML, no matter what the
error comes back as. I'm currently getting 'invalid response' with an
error code of :-2147012744, which I can't find, but understand to be a
nonespecific HTTP error.
Mar 23 '06 #1
4 7662
s_m_b wrote:
Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocumen t") 1. Why the initial quote (before Set)?
2. Unlikely to have anything to do with your problem, but why are you using
the bulky Free-threaded object? Are you planning to store it in Application
or Session? If not, switch to the normal DomDocument object
Set objXML = Server.CreateObject("MSXML2.DOMDocument")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load
(http://news.bbc.co.uk/rss/newsonline...age/rss091.xml) <snip>
Is there any way to get the raw feed from the XML, no matter what the
error comes back as. I'm currently getting 'invalid response' with an
error code of :-2147012744, which I can't find, but understand to be a
nonespecific HTTP error.


I don't understand. Is this error contained in the parseError object?
I think you should be using ServerXMLHTTP for this task, but I'm not sure
having never attempted it.

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Mar 23 '06 #2
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in
news:#C**************@TK2MSFTNGP10.phx.gbl:
s_m_b wrote:
Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocumen t") 1. Why the initial quote (before Set)?


Oh, ignore that - it was to highlight the code snippet, and I should have
added a line after (!)
2. Unlikely to have anything to do with your problem, but why are you
using the bulky Free-threaded object? Are you planning to store it in
Application or Session? If not, switch to the normal DomDocument
object Set objXML = Server.CreateObject("MSXML2.DOMDocument")
Simply because I've searched high and low for an easy way to get RSS XML
feeds parsed into my pages, and that's the only one I found that actually
worked.

objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load
(http://news.bbc.co.uk/rss/newsonline...age/rss091.xml
)

<snip>

Is there any way to get the raw feed from the XML, no matter what the
error comes back as. I'm currently getting 'invalid response' with an
error code of :-2147012744, which I can't find, but understand to be
a nonespecific HTTP error.


I don't understand. Is this error contained in the parseError object?
I think you should be using ServerXMLHTTP for this task, but I'm not
sure having never attempted it.

Yes, this is straight from parseError.
""""""""""
Error: opening (board=1) The server returned an invalid or unrecognized
response
Line No.: 0
Character: 0
File Position: 0
Source Text:
Error Code:-2147012744
"""""""""""""
Is the result from the code on one server, and a perfect output of the
actual feed on the other. The solve I used for the now-working one was to
switch to the MSXML2.DOMDocument.4.0 object
I thought I was using ServerXMLHTTP.... I'd better do some more reading
and sort that bit!
Bob Barrows


Mar 23 '06 #3

"s_m_b" <sm********@hotmail.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocumen t")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load
("http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xml")
If objXML.parseError.errorCode <> 0 Then
'Response.Write "<pre>" & vbCrLf
Response.Write ("<strong>Error:</strong> " &
objXML.parseError.reason )
Select Case objXML.parseError.errorCode
Case 0
strResult = "Valid: " & strFileName & vbCr
Case Else
strResult = vbCrLf & "ERROR! Failed to validate " &
vbCrLf & objXML.parseError.reason & vbCr & "Error code: " &
objXML.parseError.errorCode & ", Line: " & objXML.parseError.line & ",
Character: " & objXML.parseError.linepos & ", Source: " & Chr(34) &
objXML.parseError.srcText & Chr(34) & " - " & Now & vbCrLf
End Select
Response.Write ("<strong>Line:</strong> " & objXML.parseError.line
& vbCrLf)
Response.Write ("<strong>Text:</strong> " & strResult)
Server.HTMLEncode(objXML.parseError.srcText) & vbCrLf
'Response.Write "</pre>" & vbCrLf
End If

Set objItemList = objXML.getElementsByTagName("item")
Set objXML = Nothing
intcount = 0
For Each objItem In objItemList
intcount = intcount+1
' childNodes: 0=title, 2=link, 1=description
Response.Write ("<p>&raquo;&nbsp;" & vbLf)
Response.Write ("<a href=""" & objItem.childNodes(2).text & """
target = ""bbcnews"">" & vbLf)
Response.Write (objItem.childNodes(0).text & "</a><br />&nbsp;
&nbsp;&nbsp;" & vbLf)
response.write ("<span style=""font-style:italic"">" &
objItem.childNodes(1).text & "</span>" & vbLf)
Response.Write ("</p>" & vbCrLf)
if intcount > 1 then exit for
Next"

Is there any way to get the raw feed from the XML, no matter what the
error comes back as. I'm currently getting 'invalid response' with an
error code of :-2147012744, which I can't find, but understand to be a
nonespecific HTTP error.


-2147012744 This is better viewed as hex:- 80072F78

The top bit tells you it's an error code (helpful huh?)
The 7 tells you the error is a Windows API error.

2F78 is the windows API error number
converting back to Decimal is:- 12152

This turns out to be:-

ERROR_WINHTTP_INVALID_SERVER_RESPONSE
12152
The server response could not be parsed.

IOW, there was a successful connection but the headers (if any) returned by
the server failed to parse correctly.

Is there a proxy server that web browsers normally use where you are?

Mar 23 '06 #4
"Anthony Jones" <An*@yadayadayada.com> wrote in
news:#J**************@TK2MSFTNGP14.phx.gbl:

"s_m_b" <sm********@hotmail.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocumen t")
objXML.async = False
objXML.setProperty "ServerHTTPRequest", True
objXML.Load
("http://news.bbc.co.uk/rss/newsonline_uk_edition/front_page/rss091.xm
l") If objXML.parseError.errorCode <> 0 Then
'Response.Write "<pre>" & vbCrLf
Response.Write ("<strong>Error:</strong> " &
objXML.parseError.reason )
Select Case objXML.parseError.errorCode
Case 0
strResult = "Valid: " & strFileName & vbCr
Case Else
strResult = vbCrLf & "ERROR! Failed to validate " &
vbCrLf & objXML.parseError.reason & vbCr & "Error code: " &
objXML.parseError.errorCode & ", Line: " & objXML.parseError.line &
", Character: " & objXML.parseError.linepos & ", Source: " &
Chr(34) & objXML.parseError.srcText & Chr(34) & " - " & Now & vbCrLf
End Select
Response.Write ("<strong>Line:</strong> " & objXML.parseError.line
& vbCrLf)
Response.Write ("<strong>Text:</strong> " & strResult)
Server.HTMLEncode(objXML.parseError.srcText) & vbCrLf
'Response.Write "</pre>" & vbCrLf
End If

Set objItemList = objXML.getElementsByTagName("item")
Set objXML = Nothing
intcount = 0
For Each objItem In objItemList
intcount = intcount+1
' childNodes: 0=title, 2=link, 1=description
Response.Write ("<p>&raquo;&nbsp;" & vbLf)
Response.Write ("<a href=""" & objItem.childNodes(2).text & """
target = ""bbcnews"">" & vbLf)
Response.Write (objItem.childNodes(0).text & "</a><br />&nbsp;
&nbsp;&nbsp;" & vbLf)
response.write ("<span style=""font-style:italic"">" &
objItem.childNodes(1).text & "</span>" & vbLf)
Response.Write ("</p>" & vbCrLf)
if intcount > 1 then exit for
Next"

Is there any way to get the raw feed from the XML, no matter what the
error comes back as. I'm currently getting 'invalid response' with an
error code of :-2147012744, which I can't find, but understand to be
a nonespecific HTTP error.


-2147012744 This is better viewed as hex:- 80072F78

The top bit tells you it's an error code (helpful huh?)
The 7 tells you the error is a Windows API error.

2F78 is the windows API error number
converting back to Decimal is:- 12152

This turns out to be:-

ERROR_WINHTTP_INVALID_SERVER_RESPONSE
12152
The server response could not be parsed.

IOW, there was a successful connection but the headers (if any)
returned by the server failed to parse correctly.

Is there a proxy server that web browsers normally use where you are?

Ah. That's interesting.
We have a proxy, but I've used proxycfg to tell the server to bypass it for
internal hosts/addresses - the feed that's giving me grief is actually on
the same server.

The test server I mentioned works fine.

The example feed above (BBC) works perfectly.

This is kind of intriguing, since I tried to use my RSS reader (feeddemon)
to test out the local feed, and it can't connect either. However, I can
view the XML via my browser.
Mar 23 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dan Sikorsky | last post by:
Uploading from browser to server using Msxml2.XMLHTTP takes a long time about 15 minutes for a 1.5MB file at 37.2Kbps, although it does get there. Is there anyway to speed things up? here's the...
3
by: hb | last post by:
Hi, I need to use MSXML2.DOMDocument in my ASP page. The following is my code: xml.asp: ===== <% dim sx sx="<root><a>text1</a><b>text2</b></root>" dim xd
17
by: Patrick | last post by:
I am almost certain that I could use HTTP Post/Get to submit XML Web Service call (over SSL as well, if using Version 3 of MSXML2) from an ASP Application? However, would I only be able to call...
1
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the...
3
by: BjörnHolmberg | last post by:
I'm trying to consume a WS from Excel (Office 98), seems that I can't send arguments into the WS. In order to pinpoint the problem I've written the following application i C# and VB6. It reproduces...
2
by: s_m_b | last post by:
This has me stumped. I've built an RSS reader using Set objXML = Server.CreateObject("MSXML2.FreeThreadedDOMDocument") objXML.async = False objXML.setProperty "ServerHTTPRequest", True...
0
by: Daniel | last post by:
Does system.xml have any way to transofrm data with an xswl style sheet using strings like MSXML2 does? how to convert this to use System.XML so i do not depend on MSXML2 interop? static...
4
by: mrjaxon | last post by:
I have a C# web application which leverages MSXML that I am trying to migrate to a 64 bit environment. Currently the application is built on the .NET 2.0 Framework and using MSXML 6 (though I had...
2
by: noOby | last post by:
Hi developers, currently i'm doing a school project and i am stuck on MSXML2.XMLHTTP conversion from vb code to c#. Below is the vb Coding that i need to convert to C# Dim sUrl As String ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.