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

ReadXML through firewall

My firewall appears to be blocking an RSS XML feed from being returned even
thought port 80 is enabled. Can anyone help?

Dim proxyURI As New Uri("http://MyIP:80")

GlobalProxySelection.Select = New WebProxy(proxyURI)

Dim MyXMLDocument As New XPathDocument(http://rss.news.yahoo.com/rss/tech)

Error :

The underlying connection was closed: Unable to connect to the remote server
Nov 22 '05 #1
4 4770

"John" <so*****@msnnotamucho.com> wrote in message
news:ua**************@TK2MSFTNGP11.phx.gbl...
My firewall appears to be blocking an RSS XML feed from being returned even thought port 80 is enabled. Can anyone help?

Dim proxyURI As New Uri("http://MyIP:80")

GlobalProxySelection.Select = New WebProxy(proxyURI)

Dim MyXMLDocument As New XPathDocument(http://rss.news.yahoo.com/rss/tech)

Error :

The underlying connection was closed: Unable to connect to the remote server


I added this to the web.config :

<system.net>

<defaultProxy>

<proxy proxyaddress = "http://127.0.0.1:80" bypassonlocal = "true"/>

</defaultProxy>

</system.net>

And now get this error :

The underlying connection was closed: An unexpected error occurred on a
receive
Nov 22 '05 #2

"John" <so*****@msnnotamucho.com> wrote in message
news:ua**************@TK2MSFTNGP11.phx.gbl...
My firewall appears to be blocking an RSS XML feed from being returned even thought port 80 is enabled. Can anyone help?

Dim proxyURI As New Uri("http://MyIP:80")

GlobalProxySelection.Select = New WebProxy(proxyURI)

Dim MyXMLDocument As New XPathDocument(http://rss.news.yahoo.com/rss/tech)

Error :

The underlying connection was closed: Unable to connect to the remote server


I added this to the web.config :

<system.net>

<defaultProxy>

<proxy proxyaddress = "http://127.0.0.1:80" bypassonlocal = "true"/>

</defaultProxy>

</system.net>

And now get this error :

The underlying connection was closed: An unexpected error occurred on a
receive
Nov 22 '05 #3
If you use WebRequest, you can set the proxy on the request (rather than
globally).
For example, this works for me:

Public Class XpathThruProxy

Private Shared Function GetStreamForUri(Uri As System.String, ProxyUri as
System.String) as System.IO.Stream
Dim req as System.Net.WebRequest
req = System.Net.WebRequest.Create(Uri)
req.Proxy = new System.Net.WebProxy(ProxyUri, true) ' go through a proxy
server
return req.GetResponse().GetResponseStream()
End Function
Public Shared Sub Main()

try
Dim ProxyUri as System.String
ProxyUri= "http://127.0.0.1:3128" ' only if I run a proxy locally
'ProxyUri= "200.244.93.129:3128" ' a remote (working) proxy server

Dim xtr as New
System.Xml.XmlTextReader(GetStreamForUri("http://rss.news.yahoo.com/rss/tech
", ProxyUri))
Dim MyXMLDocument As New System.Xml.XPath.XPathDocument(xtr)

Dim xpn as System.Xml.XPath.XPathNavigator
xpn= MyXMLDocument.CreateNavigator()

Dim expr as System.Xml.XPath.XPathExpression
expr= xpn.Compile("//rss/channel/item")

'Display the selection.
Dim iterator as System.Xml.XPath.XPathNodeIterator = xpn.Select(expr)
while (iterator.MoveNext())
Dim nav2 as System.Xml.XPath.XPathNavigator =
iterator.Current.Clone()
nav2.Select("title")
nav2.MoveToFirstChild()
System.Console.WriteLine(" title: {0}", nav2.Value)
end while

Catch e as System.Exception
System.Console.WriteLine("Exception: " & e.ToString() )

End Try

End Sub

End Class

"John" <so*****@msnnotamucho.com> wrote in message
news:Oq**************@TK2MSFTNGP11.phx.gbl...

"John" <so*****@msnnotamucho.com> wrote in message
news:ua**************@TK2MSFTNGP11.phx.gbl...
My firewall appears to be blocking an RSS XML feed from being returned

even
thought port 80 is enabled. Can anyone help?

Dim proxyURI As New Uri("http://MyIP:80")

GlobalProxySelection.Select = New WebProxy(proxyURI)

Dim MyXMLDocument As New XPathDocument(http://rss.news.yahoo.com/rss/tech)
Error :

The underlying connection was closed: Unable to connect to the remote

server


I added this to the web.config :

<system.net>

<defaultProxy>

<proxy proxyaddress = "http://127.0.0.1:80" bypassonlocal = "true"/>

</defaultProxy>

</system.net>

And now get this error :

The underlying connection was closed: An unexpected error occurred on a
receive

Nov 22 '05 #4
If you use WebRequest, you can set the proxy on the request (rather than
globally).
For example, this works for me:

Public Class XpathThruProxy

Private Shared Function GetStreamForUri(Uri As System.String, ProxyUri as
System.String) as System.IO.Stream
Dim req as System.Net.WebRequest
req = System.Net.WebRequest.Create(Uri)
req.Proxy = new System.Net.WebProxy(ProxyUri, true) ' go through a proxy
server
return req.GetResponse().GetResponseStream()
End Function
Public Shared Sub Main()

try
Dim ProxyUri as System.String
ProxyUri= "http://127.0.0.1:3128" ' only if I run a proxy locally
'ProxyUri= "200.244.93.129:3128" ' a remote (working) proxy server

Dim xtr as New
System.Xml.XmlTextReader(GetStreamForUri("http://rss.news.yahoo.com/rss/tech
", ProxyUri))
Dim MyXMLDocument As New System.Xml.XPath.XPathDocument(xtr)

Dim xpn as System.Xml.XPath.XPathNavigator
xpn= MyXMLDocument.CreateNavigator()

Dim expr as System.Xml.XPath.XPathExpression
expr= xpn.Compile("//rss/channel/item")

'Display the selection.
Dim iterator as System.Xml.XPath.XPathNodeIterator = xpn.Select(expr)
while (iterator.MoveNext())
Dim nav2 as System.Xml.XPath.XPathNavigator =
iterator.Current.Clone()
nav2.Select("title")
nav2.MoveToFirstChild()
System.Console.WriteLine(" title: {0}", nav2.Value)
end while

Catch e as System.Exception
System.Console.WriteLine("Exception: " & e.ToString() )

End Try

End Sub

End Class

"John" <so*****@msnnotamucho.com> wrote in message
news:Oq**************@TK2MSFTNGP11.phx.gbl...

"John" <so*****@msnnotamucho.com> wrote in message
news:ua**************@TK2MSFTNGP11.phx.gbl...
My firewall appears to be blocking an RSS XML feed from being returned

even
thought port 80 is enabled. Can anyone help?

Dim proxyURI As New Uri("http://MyIP:80")

GlobalProxySelection.Select = New WebProxy(proxyURI)

Dim MyXMLDocument As New XPathDocument(http://rss.news.yahoo.com/rss/tech)
Error :

The underlying connection was closed: Unable to connect to the remote

server


I added this to the web.config :

<system.net>

<defaultProxy>

<proxy proxyaddress = "http://127.0.0.1:80" bypassonlocal = "true"/>

</defaultProxy>

</system.net>

And now get this error :

The underlying connection was closed: An unexpected error occurred on a
receive

Nov 22 '05 #5

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

Similar topics

2
by: John | last post by:
My firewall appears to be blocking an RSS XML feed from being returned even thought port 80 is enabled. Can anyone help? Dim proxyURI As New Uri("http://MyIP:80") GlobalProxySelection.Select =...
11
by: DraguVaso | last post by:
Hi, I should use XML to synchronize the data from different (VB.NET) applications, and I was just wondering which Overloads of these functions ( ReadXmlSchema, ReadXml and WriteXml) goes the...
3
by: Raj Chudasama | last post by:
I am trying to read an xml file and have it view data in the datagrid. (For example take the xml file viewer in the visual studio, when u open an xml file it has that nice readable grid). I...
2
by: C Glenn | last post by:
I'm attempting to use ReadXml. It's working in that I end up with some data in the DataSet. But I'm not able to deal with it effectively after that. The XML file is properly formatted in that it...
2
by: Jason Huang | last post by:
Hi, In my C# Windows Form project, I'm testing comparing using the SqlClient with the ReadXML method. The ReadXML method will read 2 .xml files, one is 4K, the other one is 3Mb, both are on my...
1
by: ray well | last post by:
i saved the state of a data set and table via MyDs.WriteXmlSchema("MyDs.xsd") MyDs.WriteXml("MyDs.xml") i was able to read them back in and display the info in the database by ...
1
by: rada.lambretha | last post by:
Configuring Linux as a Firewall * Making installation choices * Introducing iptables * Using iptables commands * Simplifying things with firewall GUIs * Adding proxy functionality As...
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?
1
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...
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
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...
0
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...

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.