<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" 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/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Dot Net Technologies -- MS Tech talk and more - Web Services</title>
    <link>http://www.dotnettechnologies.com/</link>
    <description>Creating Solutions with Microsoft's .Net Technologies</description>
    <language>en-us</language>
    <copyright>© Copyright 2010 </copyright>
    <lastBuildDate>Sat, 31 Oct 2009 04:22:38 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>daryl@rubiconcomputing.com</managingEditor>
    <webMaster>daryl@rubiconcomputing.com</webMaster>
    <item>
      <trackback:ping>http://www.dotnettechnologies.com/Trackback.aspx?guid=9c93a3a3-ff3c-4a78-b273-081242375c0d</trackback:ping>
      <pingback:server>http://www.dotnettechnologies.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnettechnologies.com/PermaLink,guid,9c93a3a3-ff3c-4a78-b273-081242375c0d.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.dotnettechnologies.com/CommentView,guid,9c93a3a3-ff3c-4a78-b273-081242375c0d.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnettechnologies.com/SyndicationService.asmx/GetEntryCommentsRss?guid=9c93a3a3-ff3c-4a78-b273-081242375c0d</wfw:commentRss>
      <title>New features of VS2010 which have me smiling (Part 1)</title>
      <guid isPermaLink="false">http://www.dotnettechnologies.com/PermaLink,guid,9c93a3a3-ff3c-4a78-b273-081242375c0d.aspx</guid>
      <link>http://www.dotnettechnologies.com/2009/10/31/NewFeaturesOfVS2010WhichHaveMeSmilingPart1.aspx</link>
      <pubDate>Sat, 31 Oct 2009 04:22:38 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;As I mentioned before, I historically have
avoided beta software. However, this time I am breaking that rule and really digging
into VS2010 early. Below are a few of the things which have me very excited to see
this release (and with Web Spark, I get it for free! Join now!) This is part one of
a multi-part entry of the things I find really appealing about the upcoming version
of Visual Studio 2010.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;IntelliTrace&lt;/b&gt; –
allows you to playback and trace a session to assist with debugging. The major features
are:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;ul style="MARGIN-TOP: 0in" type=disc&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Application Event Recording &lt;/font&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Playback Debugging (a.k.a Time Travel Debugging) &lt;/font&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Record and Playback of Manual Test Failures &lt;/font&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Debugging Build Acceptance Tests &lt;/font&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Diagnosing Unit Test Defects &lt;/font&gt;
&lt;/li&gt;
&lt;li class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Debugging Load Test Failures&lt;/font&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Link: &lt;/font&gt;&lt;a href="http://blogs.msdn.com/habibh/archive/2009/06/02/an-in-depth-look-at-the-historical-debugger-in-visual-studio-2010-part-i.aspx" target=_blank&gt;&lt;font face=Calibri size=3&gt;http://blogs.msdn.com/habibh/archive/2009/06/02/an-in-depth-look-at-the-historical-debugger-in-visual-studio-2010-part-i.aspx&lt;/font&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Auto-Start
applications&lt;/b&gt; – Helps mitigate large startup processes which may run during the
web application “Application_Start” event. Provides a controlled approach for starting
up the application.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Link: &lt;/font&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx" target=_blank&gt;&lt;font face=Calibri size=3&gt;http://weblogs.asp.net/scottgu/archive/2009/09/15/auto-start-asp-net-applications-vs-2010-and-net-4-0-series.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face=Calibri color=#000000 size=3&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Better
ViewState management&lt;/b&gt; – By default, ViewState is enabled for web controls in past
versions of ASP.Net. In VS2010, ViewState can be disabled by default and onlt enabled
for those that actually need it, and it now supports “inheritance” through the ViewStateMode
property. This allows you to set it to “Inherit” the value from the parent control.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Link: &lt;/font&gt;&lt;a href="http://www.asp.net/learn/whitepapers/aspnet4/" target=_blank&gt;&lt;font face=Calibri size=3&gt;http://www.asp.net/learn/whitepapers/aspnet4/&lt;/font&gt;&lt;/a&gt;&lt;font face=Calibri color=#000000 size=3&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Outut
Caching everywhere &lt;/b&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;-- Now you can
take advantage of caching in applications other than web based, as the cache API is
exposed without using the System.Web.Cache in a WinForm application. There are also
more providers, and the ability to create your own through extensibility.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Link: &lt;/font&gt;&lt;a href="http://www.asp.net/learn/whitepapers/aspnet4/" target=_blank&gt;&lt;font face=Calibri size=3&gt;http://www.asp.net/learn/whitepapers/aspnet4/&lt;/font&gt;&lt;/a&gt;&lt;font face=Calibri color=#000000 size=3&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;&lt;b style="mso-bidi-font-weight: normal"&gt;Reduced
web.config size – &lt;/b&gt;Most of the configuration settings have been moved to the machine.config
file, which greatly simplifies the configuration settings in the web.config file.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Link: &lt;/font&gt;&lt;a href="http://www.asp.net/learn/whitepapers/aspnet4/"&gt;&lt;font face=Calibri size=3&gt;http://www.asp.net/learn/whitepapers/aspnet4/&lt;/font&gt;&lt;/a&gt;&lt;font face=Calibri color=#000000 size=3&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Get the VS2010 Beta 2 here: &lt;/font&gt;&lt;a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx" target=_blank&gt;&lt;font face=Calibri size=3&gt;http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face=Calibri color=#000000 size=3&gt; &lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnettechnologies.com/aggbug.ashx?id=9c93a3a3-ff3c-4a78-b273-081242375c0d" /&gt;</description>
      <comments>http://www.dotnettechnologies.com/CommentView,guid,9c93a3a3-ff3c-4a78-b273-081242375c0d.aspx</comments>
      <category>All Things</category>
      <category>ASP.Net</category>
      <category>CSharp</category>
      <category>Design</category>
      <category>General</category>
      <category>Tips and Tricks</category>
      <category>Web Services</category>
      <category>WinForms</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnettechnologies.com/Trackback.aspx?guid=71a6f346-d8d1-4b6d-ba7e-731960fe2e46</trackback:ping>
      <pingback:server>http://www.dotnettechnologies.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnettechnologies.com/PermaLink,guid,71a6f346-d8d1-4b6d-ba7e-731960fe2e46.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.dotnettechnologies.com/CommentView,guid,71a6f346-d8d1-4b6d-ba7e-731960fe2e46.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnettechnologies.com/SyndicationService.asmx/GetEntryCommentsRss?guid=71a6f346-d8d1-4b6d-ba7e-731960fe2e46</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I finally got around to updating my resume, and I pasted it temporarily on my
home page at <a href="http://www.rubiconcomputing.com/" target="_blank">Rubicon Computing
Solutions</a>. That's my company, and it's been a great run of 13 years.  I say
temporarily simply because it will better positioned later, but I realized I really
should have it on there so it gets picked up by some search engines, recruiters and
in general people looking for .Net development in the Phoenix area.
</p>
        <p>
I am in some talks with some other very senior developers I have had the pleasure
of working with over the past couple of years about banding our talent together. I've
tried that before, but these developers have been on their own for a long time, so
we have a very similar background and strong work ethic to build upon. I have always
struggled in the past with partnering up with other developers, as I have very high
expectations of any project I work on. In fact, this is why I have had trouble hiring
help, as my standards of quality aren't met by most developers without substantial
coaching. These developers already have that skill, along with maturity and experience,
which makes this a very exciting opportunity. Interesting how this economy drags some
people down, yet others, like myself see it as an opportunity.
</p>
        <p>
One of the limiting factors I have always had was that I was limited on the size of
projects I could take alone. This changes that dynamic dramatically.
</p>
        <p>
So if you're looking for some quality application development (web or windows), I
specialize in quality service and coding in a Microsoft environment. I can work alone,
with a team, or build and lead teams. You can find more details about those skills <a href="http://www.rubiconcomputing.com/resume/resume.html" target="_blank">here</a>.
Thanks!
</p>
        <p>
 
</p>
        <img width="0" height="0" src="http://www.dotnettechnologies.com/aggbug.ashx?id=71a6f346-d8d1-4b6d-ba7e-731960fe2e46" />
      </body>
      <title>A not-so-shameless plug</title>
      <guid isPermaLink="false">http://www.dotnettechnologies.com/PermaLink,guid,71a6f346-d8d1-4b6d-ba7e-731960fe2e46.aspx</guid>
      <link>http://www.dotnettechnologies.com/2009/08/07/ANotsoshamelessPlug.aspx</link>
      <pubDate>Fri, 07 Aug 2009 05:02:11 GMT</pubDate>
      <description>&lt;p&gt;
I finally got around&amp;nbsp;to updating my resume, and I pasted it temporarily on my
home page at &lt;a href="http://www.rubiconcomputing.com/" target=_blank&gt;Rubicon Computing
Solutions&lt;/a&gt;. That's my company, and it's been a great run of 13 years.&amp;nbsp; I say
temporarily simply because it will better positioned later, but I realized I really
should have it on there so it gets picked up by some search engines, recruiters and
in general people looking for .Net development in the Phoenix area.
&lt;/p&gt;
&lt;p&gt;
I am in some talks with some other very senior developers I have had the pleasure
of working with over the past couple of years about banding our talent together. I've
tried that before, but these developers have been on their own for a long time, so
we have a very similar background and strong work ethic to build upon. I have always
struggled in the past with partnering up with other developers, as I have very high
expectations of any project I work on. In fact, this is why I have had trouble hiring
help, as my standards of quality aren't met by most developers without substantial
coaching. These developers already have that skill, along with maturity and experience,
which makes this a very exciting opportunity. Interesting how this economy drags some
people down, yet others, like myself see it as an opportunity.
&lt;/p&gt;
&lt;p&gt;
One of the limiting factors I have always had was that I was limited on the size of
projects I could take alone. This changes that dynamic dramatically.
&lt;/p&gt;
&lt;p&gt;
So if you're looking for some quality application development (web or windows), I
specialize in quality service and coding in a Microsoft environment. I can work alone,
with a team, or build and lead teams. You can find more details about those skills &lt;a href="http://www.rubiconcomputing.com/resume/resume.html" target=_blank&gt;here&lt;/a&gt;.
Thanks!
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnettechnologies.com/aggbug.ashx?id=71a6f346-d8d1-4b6d-ba7e-731960fe2e46" /&gt;</description>
      <comments>http://www.dotnettechnologies.com/CommentView,guid,71a6f346-d8d1-4b6d-ba7e-731960fe2e46.aspx</comments>
      <category>All Things</category>
      <category>ASP.Net</category>
      <category>C#</category>
      <category>CSharp</category>
      <category>Design</category>
      <category>General</category>
      <category>Tips and Tricks</category>
      <category>Web Services</category>
      <category>Windows</category>
      <category>WinForms</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnettechnologies.com/Trackback.aspx?guid=e71c0a9e-e77d-4544-8698-d2c8674e7435</trackback:ping>
      <pingback:server>http://www.dotnettechnologies.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnettechnologies.com/PermaLink,guid,e71c0a9e-e77d-4544-8698-d2c8674e7435.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.dotnettechnologies.com/CommentView,guid,e71c0a9e-e77d-4544-8698-d2c8674e7435.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnettechnologies.com/SyndicationService.asmx/GetEntryCommentsRss?guid=e71c0a9e-e77d-4544-8698-d2c8674e7435</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
So it has been hit or miss posting here, but I am trying to correct it by bringing
on some additional help. I set up a new blog, <a href="http://www.developernation.net">developernation.net</a>,
and begun getting some content on there. Likely I'll crosspost on here too (my content
anyways) but likely most new entries are going to be there first. I figured if I could
get someone else on there helping doing some content, it will have more regular posts.
This blog will continue, just a lag a few days on the content of theother site, and
contain more personal observations.
</p>
        <p>
So swing on by and pop in. I've started off with a bang, and I am in the process of
posting a web service design I created and tested which handles paging and sorting
of data on the server, which my initial tests have shown to be highly efficient. I
am walking through the entire design, and by the end of the weekend I hope to have
the series done and the code posted. If not, you can wait a few days and I will post
it all here as well. 
</p>
        <p>
Thanks!
</p>
        <img width="0" height="0" src="http://www.dotnettechnologies.com/aggbug.ashx?id=e71c0a9e-e77d-4544-8698-d2c8674e7435" />
      </body>
      <title>A change of directions...</title>
      <guid isPermaLink="false">http://www.dotnettechnologies.com/PermaLink,guid,e71c0a9e-e77d-4544-8698-d2c8674e7435.aspx</guid>
      <link>http://www.dotnettechnologies.com/2006/04/28/AChangeOfDirections.aspx</link>
      <pubDate>Fri, 28 Apr 2006 15:38:06 GMT</pubDate>
      <description>&lt;p&gt;
So it has been hit or miss posting here, but I am trying to correct it by bringing
on some additional help. I set up a new blog, &lt;a href="http://www.developernation.net"&gt;developernation.net&lt;/a&gt;,
and begun getting some content on there. Likely I'll crosspost on here too (my content
anyways) but likely most new entries are going to be there first. I figured if I could
get someone else on there helping doing some content, it will have more regular posts.
This blog will continue, just a lag a few days on the content of theother site, and
contain more personal observations.
&lt;/p&gt;
&lt;p&gt;
So swing on by and pop in. I've started off with a bang, and I am in the process of
posting a web service design I created and tested which handles paging and sorting
of data on the server, which my initial tests have shown to be highly efficient. I
am walking through the entire design, and by the end of the weekend I hope to have
the series done and the code posted. If not, you can wait a few days and I will post
it all here as well. 
&lt;/p&gt;
&lt;p&gt;
Thanks!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnettechnologies.com/aggbug.ashx?id=e71c0a9e-e77d-4544-8698-d2c8674e7435" /&gt;</description>
      <comments>http://www.dotnettechnologies.com/CommentView,guid,e71c0a9e-e77d-4544-8698-d2c8674e7435.aspx</comments>
      <category>All Things</category>
      <category>ASP.Net</category>
      <category>C#</category>
      <category>CSharp</category>
      <category>Debugging</category>
      <category>Design</category>
      <category>General</category>
      <category>SQL Tips</category>
      <category>Tips and Tricks</category>
      <category>Tools</category>
      <category>VB.Net</category>
      <category>Web Services</category>
      <category>Windows</category>
      <category>WinForms</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnettechnologies.com/Trackback.aspx?guid=85fc9c9c-5e1e-4b33-8873-86b05c0d443d</trackback:ping>
      <pingback:server>http://www.dotnettechnologies.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnettechnologies.com/PermaLink,guid,85fc9c9c-5e1e-4b33-8873-86b05c0d443d.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.dotnettechnologies.com/CommentView,guid,85fc9c9c-5e1e-4b33-8873-86b05c0d443d.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnettechnologies.com/SyndicationService.asmx/GetEntryCommentsRss?guid=85fc9c9c-5e1e-4b33-8873-86b05c0d443d</wfw:commentRss>
      <title>Web Service Issues Part II: The Underlying Connection was closed</title>
      <guid isPermaLink="false">http://www.dotnettechnologies.com/PermaLink,guid,85fc9c9c-5e1e-4b33-8873-86b05c0d443d.aspx</guid>
      <link>http://www.dotnettechnologies.com/2006/03/16/WebServiceIssuesPartIITheUnderlyingConnectionWasClosed.aspx</link>
      <pubDate>Thu, 16 Mar 2006 05:19:42 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;Previously, I discussed how I worked around a firewall
issue where the HTTPS port was re-mapped, and the return URL was different than the
request URL as a result of that remapping. So I trudged on, and hit a real stumper.
Here’s the new issue:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;&lt;em&gt;&lt;strong&gt;The underlying connection was closed: Could
not establish secure channel for SSL/TLS. Inner Exception: The function completed
successfully, but must be called again to complete the context&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;I ran across Jan Tielen’s blog post (&lt;/font&gt;&lt;a href="http://weblogs.asp.net/jan/archive/2004/05/08/128394.aspx" target=_blank&gt;&lt;font face=Arial&gt;http://weblogs.asp.net/jan/archive/2004/05/08/128394.aspx&lt;/font&gt;&lt;/a&gt;&lt;font face=Arial color=#000000&gt;)
where he provided a code snippet to override the GetWebRequest method in the Reference.cs
file. I implemented it, and it worked great --- on my development machine! However,
when rolled out to the same test environment, the problem remained. However, I modified
it futher, and got it to work..&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;///&lt;/span&gt;&lt;span style="COLOR: green; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="COLOR: gray"&gt;///&lt;/span&gt;&lt;span style="COLOR: green"&gt; Set
web request properties here&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="COLOR: gray"&gt;///&lt;/span&gt;&lt;span style="COLOR: green"&gt; &lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="COLOR: gray"&gt;///&lt;/span&gt;&lt;span style="COLOR: green"&gt; &lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;param
name="uri"&amp;gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;uri &lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;/param&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="COLOR: gray"&gt;///&lt;/span&gt;&lt;span style="COLOR: green"&gt; &lt;/span&gt;&lt;span style="COLOR: gray"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="COLOR: blue"&gt;protected&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;override&lt;/span&gt;&lt;font color=#000000&gt; System.Net.WebRequest
GetWebRequest(System.Uri uri) 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.Net.HttpWebRequest
webRequest = (System.Net.HttpWebRequest)WebRequest.Create(uri);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;webRequest.AllowWriteStreamBuffering
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;true&lt;/span&gt;&lt;font color=#000000&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 3"&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;webRequest.KeepAlive
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;false&lt;/span&gt;&lt;font color=#000000&gt;;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; webRequest;&lt;/font&gt;&lt;span style="COLOR: green"&gt; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;Sort of. When I tried to use DIME with the above code,
it gave me an error “Client found response content type of '', but expected 'text/xml'”.
That was not going to work. I found some more code, and it seemed to work great once
again, until I tried to make a DIME call. Here was that attempt.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Times New Roman" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="COLOR: blue"&gt;protected&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;override&lt;/span&gt;&lt;font color=#000000&gt; System.Net.WebRequest
GetWebRequest(System.Uri uri) 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;WebRequest
request = &lt;/font&gt;&lt;span style="COLOR: blue"&gt;base&lt;/span&gt;&lt;font color=#000000&gt;.GetWebRequest(uri);
;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 4"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (requestPropertyInfo==&lt;/font&gt;&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;&lt;font color=#000000&gt;) 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 5"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;requestPropertyInfo
= request.GetType().GetProperty(&lt;/font&gt;&lt;span style="COLOR: red"&gt;"Request"&lt;/span&gt;&lt;font color=#000000&gt;); 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;HttpWebRequest
webRequest = (HttpWebRequest)requestPropertyInfo.GetValue(request,&lt;/font&gt;&lt;span style="COLOR: blue"&gt;null&lt;/span&gt;&lt;font color=#000000&gt;); 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;webRequest.KeepAlive
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;false&lt;/span&gt;&lt;font color=#000000&gt;; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 4"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;webRequest.ProtocolVersion
=&amp;nbsp;System.Net.HttpVersion.Version10; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 4"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; request; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;Once again, it worked fine during my WSE calls, but
failed when trying to use DIME attachments with the following error:&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;em&gt;&lt;strong&gt;found
response content 'application/dime', but expected 'text/xml'&lt;/strong&gt;&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;To save any readers some time, I will go through everything
I tried to resolve the problem, and finally, how I ended up resolving it. Here’s the
items which didn’t work:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;-- tried setting the SoapActor&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;-- tried turning off the Document protocol&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;-- tried setting the request and return URI&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;-- tried overding the GetWebRequest function a few
different ways&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;-- tried using wsdl instead of asmx in setting up the
Web Reference&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;-- tried setting the URI target/destination seperately&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;-- moved web service to the same machine as the calling
web site (but still had to make an external call)&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;-- turned on tracing input and output and analyzed
the logs created by WSE 2.0&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font face=Arial color=#000000&gt;So what finally worked? I ended up abandoning DIME,
and encoded the file as a string, and passed it as an element of my XML. Here’s the
code to encode the file as a string.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;///&lt;/span&gt;&lt;span style="COLOR: green; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;///&lt;/span&gt;&lt;span style="COLOR: green; FONT-FAMILY: 'Courier New'"&gt; Encodes
the file in a Base64 string format.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;///&lt;/span&gt;&lt;span style="COLOR: green; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/summary&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;///&lt;/span&gt;&lt;span style="COLOR: green; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;param
name="file"&amp;gt;&lt;/span&gt;&lt;span style="COLOR: green; FONT-FAMILY: 'Courier New'"&gt;Name
of the file.&lt;/span&gt;&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/param&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;///&lt;/span&gt;&lt;span style="COLOR: green; FONT-FAMILY: 'Courier New'"&gt; &lt;/span&gt;&lt;span style="COLOR: gray; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;private&lt;/span&gt;&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;string&lt;/span&gt;&lt;font color=#000000&gt; EncodeFile(HtmlInputFile
file)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;try&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;if&lt;/span&gt;&lt;font color=#000000&gt; (file.PostedFile.ContentLength
&amp;gt; 0)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;byte&lt;/span&gt;&lt;font color=#000000&gt;[]
fsBytes = &lt;/font&gt;&lt;span style="COLOR: blue"&gt;new&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;byte&lt;/span&gt;&lt;font color=#000000&gt;[file.PostedFile.ContentLength];&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System.IO.Stream
fileStream = file.PostedFile.InputStream;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;fileStream.Read(fsBytes,
0, file.PostedFile.ContentLength);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; Convert.ToBase64String(fsBytes);&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;else&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 3"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; String.Empty;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 1"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;catch&lt;/span&gt;&lt;font color=#000000&gt; (Exception
ex)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;{&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;//Handle
the Error&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;span style="mso-tab-count: 2"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;return&lt;/span&gt;&lt;font color=#000000&gt; String.Empty;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;&lt;span style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font color=#000000&gt;}&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;
&lt;o:p&gt;
&lt;font face=Arial color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-FAMILY: 'Courier New'"&gt;&lt;font face=Arial color=#000000&gt;What a trip
it was to get there, but the resulting service has performed well, and I don’t have
the issues I had with DIME. Don’t get me wrong, DIME worked great. But deployment
of the web service in a secure environment proved to be quite a challenge. If you
need more detail in resolving your issue, feel free to leave a comment or shoot me
an email, and I will be glad to save you some of the pain I had to go through!&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnettechnologies.com/aggbug.ashx?id=85fc9c9c-5e1e-4b33-8873-86b05c0d443d" /&gt;</description>
      <comments>http://www.dotnettechnologies.com/CommentView,guid,85fc9c9c-5e1e-4b33-8873-86b05c0d443d.aspx</comments>
      <category>All Things</category>
      <category>ASP.Net</category>
      <category>CSharp</category>
      <category>Debugging</category>
      <category>General</category>
      <category>Web Services</category>
    </item>
    <item>
      <trackback:ping>http://www.dotnettechnologies.com/Trackback.aspx?guid=0babb540-55a5-42f0-ba2c-448a60d9aae9</trackback:ping>
      <pingback:server>http://www.dotnettechnologies.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.dotnettechnologies.com/PermaLink,guid,0babb540-55a5-42f0-ba2c-448a60d9aae9.aspx</pingback:target>
      <dc:creator />
      <wfw:comment>http://www.dotnettechnologies.com/CommentView,guid,0babb540-55a5-42f0-ba2c-448a60d9aae9.aspx</wfw:comment>
      <wfw:commentRss>http://www.dotnettechnologies.com/SyndicationService.asmx/GetEntryCommentsRss?guid=0babb540-55a5-42f0-ba2c-448a60d9aae9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
At my current client, security is taken to a whole new level, which is a good thing.
But as a result, sometimes there is more of a challenge to resolve issues you may
not normally encounter. For example, I was tasked with writing a web service which
would facilitate file transfers of documents and images from a web page (and Windows
client), store them on a secured server, and serve them up to an authenticated user
on the internet. To do so, we have to deal with proxy server issues and firewall issues.
</p>
        <p>
After writing and testing the web service locally, I deployed it to our production
server. Locally, it all worked fine. However, when I deployed the web portion of the
application to our test server outside our intranet, the real fun began. The next
several posts I will discuss the problems I encountered, and how I ultimately resolved
the issue. Hopefully this will help any readers out there who have a similar issue,
as well as become documentation for the process I used so I can later reference it.
</p>
        <p>
The first issue I saw was the following error: 
</p>
        <p align="center">
          <em>
            <font color="#0000ff">The &lt;To&gt; header must match the value of an incoming
message's HTTP Request Url if the soap receiver does not have an actor name.</font>
          </em>
        </p>
        <p align="left">
          <font color="#000000">I'd love to give the person I found the solution at credit,
but it's been such a long time I can't find the original document I used. I modified
the solution to make it a little more "generic" so that the web service can be moved
without requiring a recompile of the application. </font>
        </p>
        <p align="left">
          <font color="#000000">First, you'll need to locate the Reference.cs file for the web
service reference(for C# users. Reference.vb is the similar file for VB.Net, but all
code here will be in C#). In this file, add the following reference:</font>
        </p>
        <p align="center">
          <font color="#0000ff">using Microsoft.Web.Services2.Addressing;</font>
        </p>
        <p align="left">
          <font color="#000000">Next, locate the consructor for the WSE portion of the Reference.cs.
In this case, mine will be <em>FileServiceWse().</em> Here's the code you'll need
to replace the this.Url reference already in there.</font>
        </p>
        <div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 0pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 0pt; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 0pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 0pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New">
          <p style="MARGIN: 0px">
            <span style="COLOR: blue">public</span> FileServiceWse() 
</p>
          <p style="MARGIN: 0px">
        {
</p>
          <p style="MARGIN: 0px">
            <span style="COLOR: green">//these
two setting are the &lt;TO&gt; and Response URLs. For example, in our case the response
was</span></p>
          <p style="MARGIN: 0px">
            <span style="COLOR: green">//coming
back with the redirected port appended to the url.</span></p>
          <p style="MARGIN: 0px">
            <span style="COLOR: green">//The
Web service &lt;TO&gt; looked like https://mycompany.com/FileService/FileService.asmx</span></p>
          <p style="MARGIN: 0px">
            <span style="COLOR: green">//but
the response was https://mycompany.com:1234/FileService/FileService.asmx</span></p>
          <p style="MARGIN: 0px">
            <span style="COLOR: green">//The
endpointreference call to the Destination tells the application to expect the return
url to look differently than the</span></p>
          <p style="MARGIN: 0px">
            <span style="COLOR: green">//&lt;TO&gt;
reference</span></p>
          <p style="MARGIN: 0px">
            <span style="COLOR: blue">string</span> urlSetting
= System.Configuration.ConfigurationSettings.AppSettings[<span style="COLOR: red">"FileService"</span>];
</p>
          <p style="MARGIN: 0px">
            <span style="COLOR: blue">string</span> urlReturnSetting
= System.Configuration.ConfigurationSettings.AppSettings[<span style="COLOR: red">"FileService.ReturnURL"</span>];
</p>
          <p style="MARGIN: 0px">
            <span style="COLOR: blue">if</span> ((urlSetting
!= <span style="COLOR: blue">null</span>) &amp;&amp; (urlReturnSetting != <span style="COLOR: blue">null</span>)) 
</p>
          <p style="MARGIN: 0px">
            {
</p>
          <p style="MARGIN: 0px">
                Uri sourceUri
= <span style="COLOR: blue">new</span> Uri(urlSetting);
</p>
          <p style="MARGIN: 0px">
                Uri returnUri
= <span style="COLOR: blue">new</span> Uri(urlReturnSetting);
</p>
          <p style="MARGIN: 0px">
 
</p>
          <p style="MARGIN: 0px">
                <span style="COLOR: blue">this</span>.Destination
= <span style="COLOR: blue">new</span> EndpointReference(sourceUri, returnUri);
</p>
          <p style="MARGIN: 0px">
            }
</p>
          <p style="MARGIN: 0px">
            <span style="COLOR: blue">else</span></p>
          <p style="MARGIN: 0px">
            {
</p>
          <p style="MARGIN: 0px">
                <span style="COLOR: blue">if</span> ((urlSetting
!= <span style="COLOR: blue">null</span>)) 
</p>
          <p style="MARGIN: 0px">
                {
</p>
          <p style="MARGIN: 0px">
                    <span style="COLOR: blue">this</span>.Url
= <span style="COLOR: blue">string</span>.Concat(urlSetting, <span style="COLOR: red">""</span>);
</p>
          <p style="MARGIN: 0px">
                }
</p>
          <p style="MARGIN: 0px">
                <span style="COLOR: blue">else</span></p>
          <p style="MARGIN: 0px">
                {
</p>
          <p style="MARGIN: 0px">
                    <span style="COLOR: green">//this
is the default URL of the file service if all else fails.</span></p>
          <p style="MARGIN: 0px">
                    <span style="COLOR: blue">this</span>.Url
= <span style="COLOR: red">"https://mycompany.com/FileService/FileService.asmx"</span>;
</p>
          <p style="MARGIN: 0px">
                }
</p>
          <p style="MARGIN: 0px">
            }
</p>
          <p style="MARGIN: 0px">
 
</p>
          <p style="MARGIN: 0px">
        }
</p>
        </div>
        <p>
 
</p>
        <p>
What this code does is set the Destination property (if the <font color="#ff0000">FileService</font> and <font color="#ff0000">FileService.ReturnURL </font>settings
are placed in the web.config file) to expect a different response than the requested
web service URL. In our case, since our request was going through a firewall
which remapped the ports, we had a port attached to the url for our web service which
triggered this error.
</p>
        <p>
The code also has failover. If I forget to make the settings, it will try the original
URL reference. In my case the call won't work, but I believe in at least attempting
to code some failover when human error can take place in moving files, etc.
</p>
        <p>
But this only solved one of the many challenges I encountered in deploying
this web service. Stay tuned for the next resolution to tricky WSE issues!
</p>
        <p>
          <!--EndFragment-->
        </p>
        <img width="0" height="0" src="http://www.dotnettechnologies.com/aggbug.ashx?id=0babb540-55a5-42f0-ba2c-448a60d9aae9" />
      </body>
      <title>Web Service Adventures - The &amp;lt;To&amp;gt; header must match the value of an incoming message's HTTP Request Url if the soap receiver does not have an actor name.</title>
      <guid isPermaLink="false">http://www.dotnettechnologies.com/PermaLink,guid,0babb540-55a5-42f0-ba2c-448a60d9aae9.aspx</guid>
      <link>http://www.dotnettechnologies.com/2006/03/09/WebServiceAdventuresTheLtTogtHeaderMustMatchTheValueOfAnIncomingMessagesHTTPRequestUrlIfTheSoapReceiverDoesNotHaveAnActorName.aspx</link>
      <pubDate>Thu, 09 Mar 2006 16:12:20 GMT</pubDate>
      <description>&lt;p&gt;
At my current client, security is taken to a whole new level, which is a good thing.
But as a result, sometimes there is more of a challenge to resolve issues you may
not normally encounter. For example, I was tasked with writing a web service which
would facilitate file transfers of documents and images from a web page (and Windows
client), store them on a secured server, and serve them up to an authenticated user
on the internet. To do so, we have to deal with proxy server issues and firewall issues.
&lt;/p&gt;
&lt;p&gt;
After writing and testing the web service locally, I deployed it to our production
server. Locally, it all worked fine. However, when I deployed the web portion of the
application to our test server outside our intranet, the real fun began. The next
several posts I will discuss the problems I encountered, and how I ultimately resolved
the issue. Hopefully this will help any readers out there who have a similar issue,
as well as become documentation for the process I used so I can later reference it.
&lt;/p&gt;
&lt;p&gt;
The first issue I saw was the following error: 
&lt;/p&gt;
&lt;p align=center&gt;
&lt;em&gt;&lt;font color=#0000ff&gt;The &amp;lt;To&amp;gt; header must match the value of an incoming
message's HTTP Request Url if the soap receiver does not have an actor name.&lt;/font&gt;&lt;/em&gt;
&lt;/p&gt;
&lt;p align=left&gt;
&lt;font color=#000000&gt;I'd love to give the person I found the solution&amp;nbsp;at credit,
but it's been such a long time I can't find the original document&amp;nbsp;I used. I modified
the solution to make it a little more "generic" so that the web service can be moved
without requiring a recompile of the application. &lt;/font&gt;
&lt;/p&gt;
&lt;p align=left&gt;
&lt;font color=#000000&gt;First, you'll need to locate the Reference.cs file for the web
service reference(for C# users. Reference.vb is the similar file for VB.Net, but all
code here will be in C#). In this file, add the following reference:&lt;/font&gt;
&lt;/p&gt;
&lt;p align=center&gt;
&lt;font color=#0000ff&gt;using Microsoft.Web.Services2.Addressing;&lt;/font&gt;
&lt;/p&gt;
&lt;p align=left&gt;
&lt;font color=#000000&gt;Next, locate the consructor for the WSE portion of the Reference.cs.
In this case, mine will be &lt;em&gt;FileServiceWse().&lt;/em&gt; Here's the code you'll need
to replace the this.Url reference already in there.&lt;/font&gt;
&lt;/p&gt;
&lt;div style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 0pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 0pt; FONT-SIZE: 10pt; BACKGROUND: white; PADDING-BOTTOM: 0pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; PADDING-TOP: 0pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;p style="MARGIN: 0px"&gt;
&lt;span style="COLOR: blue"&gt;public&lt;/span&gt; FileServiceWse() 
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//these
two setting are the &amp;lt;TO&amp;gt; and Response URLs. For example, in our case the response
was&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//coming
back with the redirected port appended to the url.&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//The
Web service &amp;lt;TO&amp;gt; looked like https://mycompany.com/FileService/FileService.asmx&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//but
the response was https://mycompany.com:1234/FileService/FileService.asmx&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//The
endpointreference call to the Destination tells the application to expect the return
url to look differently than the&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//&amp;lt;TO&amp;gt;
reference&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; urlSetting
= System.Configuration.ConfigurationSettings.AppSettings[&lt;span style="COLOR: red"&gt;"FileService"&lt;/span&gt;];
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;string&lt;/span&gt; urlReturnSetting
= System.Configuration.ConfigurationSettings.AppSettings[&lt;span style="COLOR: red"&gt;"FileService.ReturnURL"&lt;/span&gt;];
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ((urlSetting
!= &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; (urlReturnSetting != &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;)) 
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Uri sourceUri
= &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; Uri(urlSetting);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Uri returnUri
= &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; Uri(urlReturnSetting);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Destination
= &lt;span style="COLOR: blue"&gt;new&lt;/span&gt; EndpointReference(sourceUri, returnUri);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;else&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; ((urlSetting
!= &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;)) 
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Url
= &lt;span style="COLOR: blue"&gt;string&lt;/span&gt;.Concat(urlSetting, &lt;span style="COLOR: red"&gt;""&lt;/span&gt;);
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;else&lt;/span&gt; 
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;//this
is the default URL of the file service if all else fails.&lt;/span&gt;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.Url
= &lt;span style="COLOR: red"&gt;"https://mycompany.com/FileService/FileService.asmx"&lt;/span&gt;;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="MARGIN: 0px"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
What this code does is set the Destination property (if the &lt;font color=#ff0000&gt;FileService&lt;/font&gt; and &lt;font color=#ff0000&gt;FileService.ReturnURL &lt;/font&gt;settings
are placed in the web.config file) to expect a different response than the requested
web service URL. In our case, since&amp;nbsp;our request&amp;nbsp;was going through a firewall
which remapped the ports, we had a port attached to the url for our web service which
triggered this error.
&lt;/p&gt;
&lt;p&gt;
The code also has failover. If I forget to make the settings, it will try the original
URL reference. In my case the call won't work, but I believe in at least attempting
to code some failover when human error can take place in moving files, etc.
&lt;/p&gt;
&lt;p&gt;
But this only solved one of the many&amp;nbsp;challenges&amp;nbsp;I encountered in deploying
this web service. Stay tuned for the next resolution to tricky WSE issues!
&lt;/p&gt;
&lt;p&gt;
&lt;!--EndFragment--&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.dotnettechnologies.com/aggbug.ashx?id=0babb540-55a5-42f0-ba2c-448a60d9aae9" /&gt;</description>
      <comments>http://www.dotnettechnologies.com/CommentView,guid,0babb540-55a5-42f0-ba2c-448a60d9aae9.aspx</comments>
      <category>All Things</category>
      <category>ASP.Net</category>
      <category>General</category>
      <category>Web Services</category>
    </item>
  </channel>
</rss>