<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Web Services</title><link>http://www.michaelfalconer.co.uk/category/9.aspx</link><description>Web Services</description><managingEditor>Michael Falconer</managingEditor><dc:language>en-GB</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Michael D. Falconer</dc:creator><title>Accessing web services through a proxy / firewall</title><link>http://www.michaelfalconer.co.uk/archive/2004/07/02/186.aspx</link><pubDate>Fri, 02 Jul 2004 14:00:00 GMT</pubDate><guid>http://www.michaelfalconer.co.uk/archive/2004/07/02/186.aspx</guid><description>&lt;P&gt;One of the projects I'm involved in at the moment has me developing some client applications (both web and windows based) that access a web service. I was just preparing an initial release when, during testing, I found that the Windows application could not always access the web service as the user had to access the internet via a proxy server. After a quick read of &lt;A href="http://codeproject.com/vb/net/web_service_by_proxy.asp"&gt;this article&lt;/A&gt; on CodeProject and &lt;A href="http://www.dotnet247.com/247reference/msgs/51/257323.aspx"&gt;this posting&lt;/A&gt; on &lt;a title=".NET 247" href="http://www.dotnet247.com" target="_blank"&gt;.NET 247&lt;/a&gt;, I simply added the following code to always call the web service with the users IE proxy settings:&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Not&lt;/FONT&gt;&lt;FONT size=2&gt; WebProxy.GetDefaultProxy.IsBypassed(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;FONT size=2&gt; Uri(myWS.Url)) &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;Then&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim&lt;/FONT&gt;&lt;FONT size=2&gt; myProxy &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;FONT size=2&gt; WebProxy = WebProxy.GetDefaultProxy&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; myProxy.Credentials = CredentialCache.DefaultCredentials&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; myWS.Proxy = myProxy&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;If&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;myWS is the web service whose proxy settings you need to set. Hopefully somebody might find it useful!&lt;/P&gt;&lt;img src ="http://www.michaelfalconer.co.uk/aggbug/186.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>