473,770 Members | 1,700 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

issues with MSXML2.FreeThre adedDOMDocument

Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateOb ject("MSXML2.Fr eeThreadedDOMDo cument")
objXML.async = False
objXML.setPrope rty "ServerHTTPRequ est", True
objXML.Load
("http://news.bbc.co.uk/rss/newsonline_uk_e dition/front_page/rss091.xml")
If objXML.parseErr or.errorCode <> 0 Then
'Response.Write "<pre>" & vbCrLf
Response.Write ("<strong>Error :</strong> " &
objXML.parseErr or.reason )
Select Case objXML.parseErr or.errorCode
Case 0
strResult = "Valid: " & strFileName & vbCr
Case Else
strResult = vbCrLf & "ERROR! Failed to validate " &
vbCrLf & objXML.parseErr or.reason & vbCr & "Error code: " &
objXML.parseErr or.errorCode & ", Line: " & objXML.parseErr or.line & ",
Character: " & objXML.parseErr or.linepos & ", Source: " & Chr(34) &
objXML.parseErr or.srcText & Chr(34) & " - " & Now & vbCrLf
End Select
Response.Write ("<strong>Line: </strong> " & objXML.parseErr or.line
& vbCrLf)
Response.Write ("<strong>Text: </strong> " & strResult)
Server.HTMLEnco de(objXML.parse Error.srcText) & vbCrLf
'Response.Write "</pre>" & vbCrLf
End If

Set objItemList = objXML.getEleme ntsByTagName("i tem")
Set objXML = Nothing
intcount = 0
For Each objItem In objItemList
intcount = intcount+1
' childNodes: 0=title, 2=link, 1=description
Response.Write ("<p>&raquo;&nb sp;" & vbLf)
Response.Write ("<a href=""" & objItem.childNo des(2).text & """
target = ""bbcnews"" >" & vbLf)
Response.Write (objItem.childN odes(0).text & "</a><br />&nbsp;
&nbsp;&nbsp; " & vbLf)
response.write ("<span style=""font-style:italic""> " &
objItem.childNo des(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 7680
s_m_b wrote:
Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateOb ject("MSXML2.Fr eeThreadedDOMDo cument") 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.CreateOb ject("MSXML2.DO MDocument")
objXML.async = False
objXML.setPrope rty "ServerHTTPRequ est", 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******@NOyah oo.SPAMcom> wrote in
news:#C******** ******@TK2MSFTN GP10.phx.gbl:
s_m_b wrote:
Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateOb ject("MSXML2.Fr eeThreadedDOMDo cument") 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.CreateOb ject("MSXML2.DO MDocument")
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.setPrope rty "ServerHTTPRequ est", 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.DOMDocum ent.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********@hot mail.com> wrote in message
news:Xn******** *************** ***********@207 .46.248.16...
Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateOb ject("MSXML2.Fr eeThreadedDOMDo cument")
objXML.async = False
objXML.setPrope rty "ServerHTTPRequ est", True
objXML.Load
("http://news.bbc.co.uk/rss/newsonline_uk_e dition/front_page/rss091.xml")
If objXML.parseErr or.errorCode <> 0 Then
'Response.Write "<pre>" & vbCrLf
Response.Write ("<strong>Error :</strong> " &
objXML.parseErr or.reason )
Select Case objXML.parseErr or.errorCode
Case 0
strResult = "Valid: " & strFileName & vbCr
Case Else
strResult = vbCrLf & "ERROR! Failed to validate " &
vbCrLf & objXML.parseErr or.reason & vbCr & "Error code: " &
objXML.parseErr or.errorCode & ", Line: " & objXML.parseErr or.line & ",
Character: " & objXML.parseErr or.linepos & ", Source: " & Chr(34) &
objXML.parseErr or.srcText & Chr(34) & " - " & Now & vbCrLf
End Select
Response.Write ("<strong>Line: </strong> " & objXML.parseErr or.line
& vbCrLf)
Response.Write ("<strong>Text: </strong> " & strResult)
Server.HTMLEnco de(objXML.parse Error.srcText) & vbCrLf
'Response.Write "</pre>" & vbCrLf
End If

Set objItemList = objXML.getEleme ntsByTagName("i tem")
Set objXML = Nothing
intcount = 0
For Each objItem In objItemList
intcount = intcount+1
' childNodes: 0=title, 2=link, 1=description
Response.Write ("<p>&raquo;&nb sp;" & vbLf)
Response.Write ("<a href=""" & objItem.childNo des(2).text & """
target = ""bbcnews"" >" & vbLf)
Response.Write (objItem.childN odes(0).text & "</a><br />&nbsp;
&nbsp;&nbsp; " & vbLf)
response.write ("<span style=""font-style:italic""> " &
objItem.childNo des(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_I NVALID_SERVER_R ESPONSE
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*@yadayadaya da.com> wrote in
news:#J******** ******@TK2MSFTN GP14.phx.gbl:

"s_m_b" <sm********@hot mail.com> wrote in message
news:Xn******** *************** ***********@207 .46.248.16...
Using w2k advanced server (test system is standard server)

"Set objXML = Server.CreateOb ject("MSXML2.Fr eeThreadedDOMDo cument")
objXML.async = False
objXML.setPrope rty "ServerHTTPRequ est", True
objXML.Load
("http://news.bbc.co.uk/rss/newsonline_uk_e dition/front_page/rss091.xm
l") If objXML.parseErr or.errorCode <> 0 Then
'Response.Write "<pre>" & vbCrLf
Response.Write ("<strong>Error :</strong> " &
objXML.parseErr or.reason )
Select Case objXML.parseErr or.errorCode
Case 0
strResult = "Valid: " & strFileName & vbCr
Case Else
strResult = vbCrLf & "ERROR! Failed to validate " &
vbCrLf & objXML.parseErr or.reason & vbCr & "Error code: " &
objXML.parseErr or.errorCode & ", Line: " & objXML.parseErr or.line &
", Character: " & objXML.parseErr or.linepos & ", Source: " &
Chr(34) & objXML.parseErr or.srcText & Chr(34) & " - " & Now & vbCrLf
End Select
Response.Write ("<strong>Line: </strong> " & objXML.parseErr or.line
& vbCrLf)
Response.Write ("<strong>Text: </strong> " & strResult)
Server.HTMLEnco de(objXML.parse Error.srcText) & vbCrLf
'Response.Write "</pre>" & vbCrLf
End If

Set objItemList = objXML.getEleme ntsByTagName("i tem")
Set objXML = Nothing
intcount = 0
For Each objItem In objItemList
intcount = intcount+1
' childNodes: 0=title, 2=link, 1=description
Response.Write ("<p>&raquo;&nb sp;" & vbLf)
Response.Write ("<a href=""" & objItem.childNo des(2).text & """
target = ""bbcnews"" >" & vbLf)
Response.Write (objItem.childN odes(0).text & "</a><br />&nbsp;
&nbsp;&nbsp; " & vbLf)
response.write ("<span style=""font-style:italic""> " &
objItem.childNo des(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_I NVALID_SERVER_R ESPONSE
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
12457
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 code ... var sFilename = (document.form1.myFileName.value); // create ADO-stream Object var ado_stream = new ActiveXObject("ADODB.Stream"); // create XML document with default header and primary node
3
29319
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
14793
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 web-service in a an asynchronous mode (with a callback function)? If so, how?
1
6590
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 server don´t response right. xmlHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
3
11302
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 exaclty the same problem with less code. Any hints on how to solve this would be greatly appreciated. /Regards Björn The webservice is: using System; using System.Web.Services;
2
6754
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 objXML.Load(BBS&"/yabb.pl?action=rss;feedboard="&board) there are two versions of the RSS feed, identical as far as I can make
0
316
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 public string XslTransform(string style, string strdata) { MSXML2.IXMLDOMDocument pDoc = new MSXML2.DOMDocumentClass(); pDoc.async = false; pDoc.loadXML(strdata);
4
11826
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 the same issues using version 4). The OS I am running the app on is Windows Server 2003 x64. I am using the x64 version of MSXML 6 on the server. My dev environment is Windows XP 32 bit SP2. I have tried to compile the projects for "anycpu"...
2
11319
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 Dim xHttp As MSXML2.XMLHTTP
0
9602
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10237
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7431
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.