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

The remote server returned an error: (401) Unauthorized.

I am trying to retrieve XML data from an ASP page. If I type the URL to the
asp page into my browser (i.e. http://domain.com/getxml.asp) , I will get the
xml displayed in IE.

But, if I try to retrieve the xml using the xml web control, I get this error:
The remote server returned an error: (401) Unauthorized. Am I doing
something wrong? Below is the function that I created to read the xml:

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

Function GetXML(ByVal strSourceFile As String)
Dim myRequest As System.Net.WebRequest =
System.Net.WebRequest.Create(strSourceFile)
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
Response.Write(Err.Description)
End Try
End Function

Jul 21 '05 #1
0 1784

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

Similar topics

0
by: sirumalla | last post by:
These posting i have seen in so many sites but none of them solved the problem. Iam trying to fix this problem past 2 days but iam not able to do so. I doubt whether iam missing any peice of code ...
2
by: Vijayakrishna Pondala | last post by:
Hi, I am using the following C# code to connect to and download information from a URL. (The pages are on JBoss server and we are using NTLM authentication to connect to the server). ----...
2
by: obeOnline | last post by:
I'm getting the following error... System.Net.HttpWebRequest.CheckFinalStatus() +676 System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) +139...
0
by: sirumalla | last post by:
These posting i have seen in so many sites but none of them solved the problem. Iam trying to fix this problem past 2 days but iam not able to do so. I doubt whether iam missing any peice of code ...
0
by: nidhisahu | last post by:
Hello All, i am open this URL( http://id.skootit.com/WorkspaceService/ListInvitations?actor=http://goku.id.skootit.com/) directly in browser with enter credential then its open and show...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.