473,326 Members | 2,192 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,326 software developers and data experts.

Help with error retrieving XML

I have an XML web control on a usercontrol. The only purpose for this
usercontrol is to get XML data from a URL and display
it in the xml web control with the help of XSL.

I can get this to work if I log into the machine that is hosting the
website, whether it be my dev box or staging box. When I try to access the
page remotely, I get an error:

This is an unexpected token. The expected token is 'QUOTE'. Line 1, position
110.
at System.Xml.XmlScanner.ScanToken(Int32 expected) at
System.Xml.XmlTextReader.SetLiteralValues(XmlAttri buteTokenInfo fld) at
System.Xml.XmlTextReader.SetAttributeValues() at
System.Xml.XmlTextReader.ParseElement() at System.Xml.XmlTextReader.Read() at
System.Xml.XmlLoader.LoadChildren(XmlNode parent) at
System.Xml.XmlLoader.LoadElementNode() at
System.Xml.XmlLoader.LoadCurrentNode() at
System.Xml.XmlLoader.LoadChildren(XmlNode parent) at
System.Xml.XmlLoader.LoadElementNode() at
System.Xml.XmlLoader.LoadCurrentNode() at
System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc) at
System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean
preserveWhitespace) at System.Xml.XmlDocument.Load(XmlReader reader) at
Website.mysurveys1.GetXML(String strSourceFile)

Here are the following entries in my web.config file:

<authentication mode="Windows" />
<identity impersonate="true" />

And here is the code I wrote in the usercontrol to access the XML:

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Xml1.Document = GetXML("http://somedomain/folder/GetXml.asp")
End Sub

Function GetXML(ByVal strSourceFile As String)
Dim myRequest As System.Net.WebRequest =
System.Net.WebRequest.Create(strSourceFile)
myRequest.Credentials = System.Net.CredentialCache.DefaultCredentials
Try
Dim myResponse As System.Net.WebResponse =
myRequest.GetResponse()
Dim myReader As System.Xml.XmlTextReader = New
System.Xml.XmlTextReader(myResponse.GetResponseStr eam())
Dim doc As System.Xml.XmlDocument = New System.Xml.XmlDocument
doc.Load(myReader)
GetXML = doc
Catch ex As Exception
Response.Write(ex.Message.ToString & "
" & ex.StackTrace.ToString)
End Try
End Function

The error is occuring at this line of my function:
Dim myResponse As System.Net.WebResponse = myRequest.GetResponse()

Am I doing something wrong?

I have been searching for an answer for a few days now to no avail. Any
help would be greatly appreciated.

Jul 21 '05 #1
0 1317

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

Similar topics

1
by: Roman Kagan | last post by:
Hi everyone, I am successful in retrieving the image from the table (.TIF), however, the retrieved file does not work. It looks like an image file - extension, size and all, but the image is not...
3
by: DM | last post by:
newbie trying to set up a Database and keep getting the same result. ERROR An error occured while retrieving the information from the database: Unable to cast COM object of type...
4
by: hb | last post by:
Hi, I have been working on the ASP.Net project for months with VS.Net 2003 in C#. But this afternoon I suddenly got the following error when I tied to compile the whole solution: === ------...
0
by: orieni | last post by:
Hi, I have writen a code to take snapshot of Internet Explorer. The code works fine when run in the debug mode. But once I publish the site I get the following error for: Retrieving the COM...
15
by: Jay | last post by:
I have a multi threaded VB.NET application (4 threads) that I use to send text messages to many, many employees via system.timer at a 5 second interval. Basically, I look in a SQL table (queue) to...
0
by: Klaki | last post by:
I'm trying to create an instance of Outlook using VB.net and every time I run the site, I get the following error: Retrieving the COM class factory for component with CLSID...
6
by: AppleBag | last post by:
I'm having the worst time trying to login to myspace through code. Can someone tell me how to do this? Please try it yourself before replying, only because I have asked this a couple of times in...
1
by: =?Utf-8?B?UmF2aQ==?= | last post by:
public WordApp() { //oWordAppl = new Microsoft.Office.Interop.Word.ApplicationClass(); } When I click a button in my aspx file I geet the followign error. I am trying to open word from...
2
by: pavanip | last post by:
Hi, I developed a windows application in Vb.Net 2003.It is working fine in this. But when I am trying to convert this into .Net 2005 I am getting this error. Class not registered...
10
by: Meganutter | last post by:
Hello, I have been stuck with this error for a while now and really want to get it fixed. The catch here is, i need to rewrite code and update it. when i use the old code the page loads as its...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.