Hi,
This is driving me crazy. I have a solution that works great on one site,
but doesn't on another site. Same exact code on two different windows
environments. Here is the code:
Private Sub DoStuff()
Dim sURL As String
Dim XMLnews As XmlDocument = New XmlDocument
Dim XMLroot As System.Xml.XmlElement
Dim XMLHeadline As System.Xml.XmlNode
Dim XMLnode As System.Xml.XmlNode
Dim sFeed As String
Try
sURL = "http://www.microsoft.com/"
Dim myHttpWebRequest As HttpWebRequest =
CType(WebRequest.Create(sURL), HttpWebRequest)
myHttpWebRequest.Proxy = System.Net.WebProxy.GetDefaultProxy
Dim myHttpWebResponse As HttpWebResponse =
CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
Dim receiveStream As Stream =
myHttpWebResponse.GetResponseStream()
Dim encode As System.Text.Encoding =
System.Text.Encoding.GetEncoding("utf-8")
Dim readStream As New StreamReader(receiveStream, encode)
skinerror.Text = readStream.ReadToEnd.ToString
Catch ex As Exception
skinerror.Text = ex.Message.ToString & "<br>" &
ex.StackTrace.ToString
End Try
End Sub
On the good site it returns the web page (in this case Microsoft.com's home
page). On the bad site (hosted by godaddy.com) it returns:
The remote server returned an error: (401) Unauthorized.
at System.Net.HttpWebRequest.CheckFinalStatus() at
System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult) at
System.Net.HttpWebRequest.GetResponse() at webapp._Default.DoStuff()
I am not using credentials of any kind -- it doesn't matter what website I
point to either.
I'm at a loss -- thanks in advance. 3 2107
401 is access denied. as the actual site does not require authenication, the
authenication request is coming from the proxy server. godaddy's proxy may
complety block outgoing traffic, or may require a login. check with their
technical support
-- bruce (sqlwork.com)
"Paul" <Pa**@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
| Hi,
|
| This is driving me crazy. I have a solution that works great on one site,
| but doesn't on another site. Same exact code on two different windows
| environments. Here is the code:
|
| Private Sub DoStuff()
| Dim sURL As String
| Dim XMLnews As XmlDocument = New XmlDocument
| Dim XMLroot As System.Xml.XmlElement
| Dim XMLHeadline As System.Xml.XmlNode
| Dim XMLnode As System.Xml.XmlNode
| Dim sFeed As String
| Try
|
| sURL = "http://www.microsoft.com/"
| Dim myHttpWebRequest As HttpWebRequest =
| CType(WebRequest.Create(sURL), HttpWebRequest)
| myHttpWebRequest.Proxy = System.Net.WebProxy.GetDefaultProxy
|
| Dim myHttpWebResponse As HttpWebResponse =
| CType(myHttpWebRequest.GetResponse(), HttpWebResponse)
| Dim receiveStream As Stream =
| myHttpWebResponse.GetResponseStream()
| Dim encode As System.Text.Encoding =
| System.Text.Encoding.GetEncoding("utf-8")
| Dim readStream As New StreamReader(receiveStream, encode)
| skinerror.Text = readStream.ReadToEnd.ToString
|
| Catch ex As Exception
| skinerror.Text = ex.Message.ToString & "<br>" &
| ex.StackTrace.ToString
| End Try
|
| End Sub
|
| On the good site it returns the web page (in this case Microsoft.com's
home
| page). On the bad site (hosted by godaddy.com) it returns:
|
|
| The remote server returned an error: (401) Unauthorized.
| at System.Net.HttpWebRequest.CheckFinalStatus() at
| System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult) at
| System.Net.HttpWebRequest.GetResponse() at webapp._Default.DoStuff()
|
| I am not using credentials of any kind -- it doesn't matter what website I
| point to either.
|
| I'm at a loss -- thanks in advance.
|
I have a request into them about exactly that. If it is a proxy, how would I
setup the code the use the username/password properly?
Thanks for the response
Paul
"bruce barker" wrote: 401 is access denied. as the actual site does not require authenication, the authenication request is coming from the proxy server. godaddy's proxy may complety block outgoing traffic, or may require a login. check with their technical support
-- bruce (sqlwork.com)
"Paul" <Pa**@discussions.microsoft.com> wrote in message news:3C**********************************@microsof t.com... | Hi, | | This is driving me crazy. I have a solution that works great on one site, | but doesn't on another site. Same exact code on two different windows | environments. Here is the code: | | Private Sub DoStuff() | Dim sURL As String | Dim XMLnews As XmlDocument = New XmlDocument | Dim XMLroot As System.Xml.XmlElement | Dim XMLHeadline As System.Xml.XmlNode | Dim XMLnode As System.Xml.XmlNode | Dim sFeed As String | Try | | sURL = "http://www.microsoft.com/" | Dim myHttpWebRequest As HttpWebRequest = | CType(WebRequest.Create(sURL), HttpWebRequest) | myHttpWebRequest.Proxy = System.Net.WebProxy.GetDefaultProxy | | Dim myHttpWebResponse As HttpWebResponse = | CType(myHttpWebRequest.GetResponse(), HttpWebResponse) | Dim receiveStream As Stream = | myHttpWebResponse.GetResponseStream() | Dim encode As System.Text.Encoding = | System.Text.Encoding.GetEncoding("utf-8") | Dim readStream As New StreamReader(receiveStream, encode) | skinerror.Text = readStream.ReadToEnd.ToString | | Catch ex As Exception | skinerror.Text = ex.Message.ToString & "<br>" & | ex.StackTrace.ToString | End Try | | End Sub | | On the good site it returns the web page (in this case Microsoft.com's home | page). On the bad site (hosted by godaddy.com) it returns: | | | The remote server returned an error: (401) Unauthorized. | at System.Net.HttpWebRequest.CheckFinalStatus() at | System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult) at | System.Net.HttpWebRequest.GetResponse() at webapp._Default.DoStuff() | | I am not using credentials of any kind -- it doesn't matter what website I | point to either. | | I'm at a loss -- thanks in advance. |
Well, this is getting ridiculous....
The host says their proxy works fine -- no authentication.
Why doesn't micorosoft provide details on the authentication issue ??????
Such as "where" the 401 is received from ?
Anyone with advanced knowledge of this type of issue would be helpful...
thanks,
paul
"Paul" wrote: I have a request into them about exactly that. If it is a proxy, how would I setup the code the use the username/password properly?
Thanks for the response
Paul
"bruce barker" wrote:
401 is access denied. as the actual site does not require authenication, the authenication request is coming from the proxy server. godaddy's proxy may complety block outgoing traffic, or may require a login. check with their technical support
-- bruce (sqlwork.com)
"Paul" <Pa**@discussions.microsoft.com> wrote in message news:3C**********************************@microsof t.com... | Hi, | | This is driving me crazy. I have a solution that works great on one site, | but doesn't on another site. Same exact code on two different windows | environments. Here is the code: | | Private Sub DoStuff() | Dim sURL As String | Dim XMLnews As XmlDocument = New XmlDocument | Dim XMLroot As System.Xml.XmlElement | Dim XMLHeadline As System.Xml.XmlNode | Dim XMLnode As System.Xml.XmlNode | Dim sFeed As String | Try | | sURL = "http://www.microsoft.com/" | Dim myHttpWebRequest As HttpWebRequest = | CType(WebRequest.Create(sURL), HttpWebRequest) | myHttpWebRequest.Proxy = System.Net.WebProxy.GetDefaultProxy | | Dim myHttpWebResponse As HttpWebResponse = | CType(myHttpWebRequest.GetResponse(), HttpWebResponse) | Dim receiveStream As Stream = | myHttpWebResponse.GetResponseStream() | Dim encode As System.Text.Encoding = | System.Text.Encoding.GetEncoding("utf-8") | Dim readStream As New StreamReader(receiveStream, encode) | skinerror.Text = readStream.ReadToEnd.ToString | | Catch ex As Exception | skinerror.Text = ex.Message.ToString & "<br>" & | ex.StackTrace.ToString | End Try | | End Sub | | On the good site it returns the web page (in this case Microsoft.com's home | page). On the bad site (hosted by godaddy.com) it returns: | | | The remote server returned an error: (401) Unauthorized. | at System.Net.HttpWebRequest.CheckFinalStatus() at | System.Net.HttpWebRequest.EndGetResponse(IAsyncRes ult asyncResult) at | System.Net.HttpWebRequest.GetResponse() at webapp._Default.DoStuff() | | I am not using credentials of any kind -- it doesn't matter what website I | point to either. | | I'm at a loss -- thanks in advance. | This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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
...
|
by: obeOnline |
last post by:
I'm getting the following error...
System.Net.HttpWebRequest.CheckFinalStatus() +676
System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
+139...
|
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
...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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,...
|
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...
|
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...
|
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,...
|
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...
| |