XML Web Control

J

Jason .

I am using the XML Web Control to retrieve XML data from another ASP
page. The ASP page is on a different website so I have to use the full
http:// path. But, when I test my page I get an error stating "... A
virtual path is expected."

Can I only reference a DocumentSource that is within my website? I
can't believe that would be the case.
 
B

bruce barker

the source document must be a file path. you will need to use the web client
class to fetch the xml document, then pass to the xml web control.

-- bruce (sqlwork.com)

| I am using the XML Web Control to retrieve XML data from another ASP
| page. The ASP page is on a different website so I have to use the full
| http:// path. But, when I test my page I get an error stating "... A
| virtual path is expected."
|
| Can I only reference a DocumentSource that is within my website? I
| can't believe that would be the case.
|
|
|
|
| Don't just participate in USENET...get rewarded for it!
 
J

Jason .

Thanks. I started playing around with the WebRequest/WebResponse class
but I keep getting a 401 unauthorized error on the line where I Dim
myResponse.

So, the webclient class is the way to go instead of my current approach?

Function GetXML(ByVal strSourceFile As String)
Dim myRequest As System.Net.WebRequest =
System.Net.WebRequest.Create(strSourceFile)
Dim myResponse As System.Net.WebResponse = myRequest.GetResponse()
Dim myReader As System.Xml.XmlTextReader = New
System.Xml.XmlTextReader(myResponse.GetResponseStream())
Dim doc As System.Xml.XmlDocument = New System.Xml.XmlDocument
doc.Load(myReader)
GetXML = doc
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top