473,796 Members | 2,426 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XmlDataSource & Website Proxy

Hello,

How do you set the website proxy using the XmlDataSource control?

Thanks, sck10
Oct 10 '06 #1
2 7457
Hello Steve,

As for the XmlDataSource control, it doesn't expose a property for us to
configure webproxy to access external web resource. Actually, the
XmlDataSource control is designed for accessing local file document or
string based Xml content mostly. For your scenario, if your XMLDataSource
want to retrieve XML Data from an external site that need to be resolved
through a proxy, you can consider the following options:

1. Since by default the XMLDatasource control will use the system proxy
setting (within the machine level .net framework system.net configuration),
we can override it in our web application's web.config file. For example:

=============== =============== ===
<system.net>
<defaultProxy >
<proxy
proxyaddress="h ttp://jpnproxy:80"
bypassonlocal=" True"
/>

</defaultProxy>
</system.net>
=============== ========

or if you do not want to make this setting affect all pages in the
application(onl y for individual pages or a sub directory), you can use the
<locationelemen t to scope the setting:

=============
<location path="XML/RSSDataSource.a spx">
<system.net>
<defaultProxy >
<proxy
proxyaddress="h ttp://jpnproxy:80"
bypassonlocal=" True"
/>

</defaultProxy>
</system.net>
</location>
=============== ======
2. You can also programmtically use WebRequest component(which can accept a
explicit webproxy setting) to retrieve the XML content and then assign it
to the XmlDataSource.D ata property programmtically . e.g.

=============== =
protected void Page_Load(objec t sender, EventArgs e)
{

//use webrequest to get the XML
string xml = GetXMLFromRemot eUrl(...);

XmlDataSource1. Data = xml;
}
=============== =

Hope this helps. If there is any other questions, please feel free to let
me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Oct 11 '06 #2
Thanks Steven,

Appreciate the help...

Regards, sck10

"Steven Cheng[MSFT]" <st*****@online .microsoft.comw rote in message
news:1g******** ******@TK2MSFTN GXA01.phx.gbl.. .
Hello Steve,

As for the XmlDataSource control, it doesn't expose a property for us to
configure webproxy to access external web resource. Actually, the
XmlDataSource control is designed for accessing local file document or
string based Xml content mostly. For your scenario, if your XMLDataSource
want to retrieve XML Data from an external site that need to be resolved
through a proxy, you can consider the following options:

1. Since by default the XMLDatasource control will use the system proxy
setting (within the machine level .net framework system.net
configuration),
we can override it in our web application's web.config file. For example:

=============== =============== ===
<system.net>
<defaultProxy >
<proxy
proxyaddress="h ttp://jpnproxy:80"
bypassonlocal=" True"
/>

</defaultProxy>
</system.net>
=============== ========

or if you do not want to make this setting affect all pages in the
application(onl y for individual pages or a sub directory), you can use the
<locationelemen t to scope the setting:

=============
<location path="XML/RSSDataSource.a spx">
<system.net>
<defaultProxy >
<proxy
proxyaddress="h ttp://jpnproxy:80"
bypassonlocal=" True"
/>

</defaultProxy>
</system.net>
</location>
=============== ======
2. You can also programmtically use WebRequest component(which can accept
a
explicit webproxy setting) to retrieve the XML content and then assign it
to the XmlDataSource.D ata property programmtically . e.g.

=============== =
protected void Page_Load(objec t sender, EventArgs e)
{

//use webrequest to get the XML
string xml = GetXMLFromRemot eUrl(...);

XmlDataSource1. Data = xml;
}
=============== =

Hope this helps. If there is any other questions, please feel free to let
me know.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no
rights.

Oct 11 '06 #3

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

Similar topics

2
16272
by: Snuffy2 | last post by:
I'm looking to try to get a users MAC and/or NetBIOS name when they visit my website. It somehow can be done, I'm not sure with PHP, but it can be done. Does anyone have any idea how? As an example check out: http://stealthtests.lockdowncorp.com/ On that site, there are tests that will display NetBIOS & MAC addresses.
0
464
by: W. Kacy | last post by:
I am having trouble using XML in an ASP.NET 2.0 webform. Using ASP.NET 2.0 beta 2, I have created a blank web page in a C# website. I have added an XML file (soData.xml), structured as follows: <?xml version = "1.0" encoding="Windows-1252" standalone="yes"?> <VFPData> <ac_sodata> <iono>Vendor</iono> <sodate>2004-03-04</sodate> <sono>164</sono>
2
3168
by: mike | last post by:
can somebody please show me some code that will let me populate a checkboxlist from the xmldatasource, and have the text property set to the names in the xml file thanks you can also email me at i_am_the_freshmaka@hotmail.com
3
9170
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't really had any success. I'm pretty sure I should be casting my XPathSelect() call to something so I can get at its attributes. This seems like it should be easy, and maybe I'm missing something obvious. Does anyone have any ideas? Here is the...
2
2683
by: Zulander | last post by:
hi, i am trying to put a session variable in the DataFile of the XmlDataSource, but for some reason i am getting: Server tags cannot contain <% ... %constructs. <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="<% Session("UserPath") %"></asp:XmlDataSource> I have even tried this: <asp:XmlDataSource ID="XmlDataSource1" runat="server"
5
9365
by: sck10 | last post by:
Hello, I am using the following to get RSS Feeds. I've been able to get the xml files from every site except CNN. When I try to get there feed, I get the exception: A column named 'link' already belongs to this DataTable: cannot set a nested table name to the same name. Any help with this would be appreciated. Thanks, sck10
1
3175
by: Disccooker | last post by:
i am trying to use XPath and the XMLDataSource to display data from an XMLDocument and am getting nowhere. What i would like to do is have a repeater display a label for Seed, label for Team Name and a Text Box for each game - like an NCAA bracket. 1. Team1 16. Bradley 8. Missouri 9. USM
0
1764
by: pompair | last post by:
Hello, I'm making a quiz game for fun. I have an xml file like this: <?xml version="1.0" encoding="utf-8" ?> <results> <index>99</index> <answers>11</answers> <questions> <question id="1">
8
2071
by: Wessel Troost | last post by:
We are using an XML data source in the Page_Load event of an ASP.NET page, like: protected void Page_Load(object sender, EventArgs e) { // Retrieve XML from web service for product idea in URL string sXML = GetXmlFromWebService(Request); XmlDataSource ds = new XmlDataSource(); ds.Data = sXML;
0
9680
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10456
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10230
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10174
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6788
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2926
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.