<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Enterprise Grade Cloud</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ryberry/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ryberry/feed.xml</link>
    <description>Guidance and Insight on Running and Managing Enterprise Workloads in Windows Azure</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:47:50 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure Guest OS Family 1 End of Life: June 2014</title>
      <link>https://docs.microsoft.com/archive/blogs/ryberry/azure-guest-os-family-1-end-of-life-june-2014</link>
      <pubDate>Wed, 02 Apr 2014 09:38:00 GMT</pubDate>
      <dc:creator><![CDATA[Ryan Berry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ryberry/2014/04/02/azure-guest-os-family-1-end-of-life-june-2014/</guid>
      <description><![CDATA[Customers with deployed application assets running in Windows Azure are actually running on an...]]></description>
      <content:encoded><![CDATA[<p>Customers with deployed application assets running in Windows Azure are actually running on an automatically provisioned VM under the covers that we patch and maintain if the customer doesn&rsquo;t opt out.&nbsp; The version of this underlying OS is referred to as the 'Guest OS Family' as it&rsquo;s largely abstracted from an application&rsquo;s deployment since its automatically provisioned and maintained by us behind the scenes.</p>
<p>OS Family 1 is associated with Windows Server 2008 SP2, Family 2 is Windows Server 2008 R2 SP1, OS Family 3 is Windows Server 2012, and OS Family 4 is Windows Server 2012 R2 &ndash; additional details are available on our <a href="http://msdn.microsoft.com/en-us/library/azure/ee924680.aspx" target="_blank">Guest OS Matrix page</a>.&nbsp; Our <a href="http://support.microsoft.com/gp/azure-cloud-lifecycle-faq">support lifecycle policy</a> states that we support, at a minimum, the last 2 OS Families.</p>
<p>Many customers I&rsquo;ve spoken to are not aware that they have some responsibility with Azure Platform as a Service (PaaS) applications to ensure they maintain an environment that contains the latest operating system security patches and that is commercially supported.&nbsp;&nbsp; When applications are built in Visual Studio, they are built against a specific version of the Azure SDK (latest versions available <a href="http://www.windowsazure.com/en-us/downloads/" target="_blank">here</a>) &ndash; which has an association with the OS Family the application will ultimately support being deployed into.&nbsp; Details of the OS Families and the supported SDKs are below:</p>
<p>&nbsp;</p>
<table style="width: 527px;" border="1" cellspacing="0" cellpadding="2">
<tbody>
<tr><th align="center" width="140">Guest OS Family</th><th align="center" width="143">SDK Versions Supported</th><th valign="top" width="242">.NET Version Supported</th></tr>
<tr>
<td valign="top" width="140">
<p><strong>1</strong> (Windows 2008 SP2)</p>
</td>
<td valign="top" width="143">
<p>Version 1.0 and later</p>
</td>
<td valign="top" width="242">.NET 3.5 and 4.0, version 4.5 unsupported</td>
</tr>
<tr>
<td valign="top" width="140">
<p><strong>2</strong> (Windows 2008 R2 SP1)</p>
</td>
<td valign="top" width="143">
<p>Version 1.3 and later</p>
</td>
<td valign="top" width="242">.NET 3.5 and 4.0</td>
</tr>
<tr>
<td valign="top" width="140">
<p><strong>3</strong> (Windows Server 2012)</p>
</td>
<td valign="top" width="143">
<p>Version 1.8 and later</p>
</td>
<td valign="top" width="242">.NET 4.0 and 4.5</td>
</tr>
<tr>
<td valign="top" width="140">
<p><strong>4</strong> (Windows Server 2012 R2)</p>
</td>
<td valign="top" width="154">
<p>Version 2.1 and later</p>
</td>
<td valign="top" width="242">.NET 4.0 and 4.5, and 4.5.1</td>
</tr>
</tbody>
</table>
<p>Once a selection has been made for the application, some decisions need to be made on how to maintain an update-to-date operating system hosting the deployment.&nbsp; A couple of options available are outlined in this <a href="http://blogs.msdn.com/b/sumitm/archive/2010/05/12/introducing-auto-upgrade-mode-to-manage-the-windows-azure-guest-os-for-your-service.aspx" target="_blank">blog</a>, officially on <a href="http://msdn.microsoft.com/library/azure/ff729420.aspx" target="_blank">MSDN</a> and summarized below.</p>
<blockquote>
<p><strong>1.</strong>&nbsp; Specifying a specific OS Version and Family in the application&rsquo;s <a href="http://msdn.microsoft.com/library/azure/ee758710.aspx" target="_blank">service configuration file</a> (.csdef) prior to deployment</p>
</blockquote>
<ul>
<ul>
<li><strong>Pros: </strong></li>
<ul>
<li>Provides direct control over the version of the underlying OS provisioned to host your application</li>
<li>Useful if your application has a specific binary compatibility requirement with a component of the Azure SDK or is perhaps using a 3rd party component that is supported by a specific version of Windows</li>
</ul>
<li><strong>Cons: </strong></li>
<ul>
<li>Requires thoughtful monitoring of Guest OS versions and family updates &ndash; The <a href="http://sxp.microsoft.com/feeds/3.0/msdntn/WindowsAzureOSUpdates" target="_blank">RSS Feed</a> would be a good place to start</li>
<li>Monitoring Guest OS versions may defeat some of the benefits of using PaaS in the first place &ndash; creating an administrative burden to maintain the solution</li>
<li>If the underlying OS version (patch level) is not manually updated within the 60 day grace period, the application will be forcibly moved to the latest patch level to ensure the application is running on the most secure version (Family) of OS as discussed in this <a href="http://support.microsoft.com/gp/azure-cloud-lifecycle-faq" target="_blank">FAQ</a>.</li>
</ul>
</ul>
</ul>
<blockquote>
<p><strong>2.</strong> Specifying a specific OS Family (pinning to a version of the Windows OS) and allowing updates to be deployed automatically in the .csdef by specifying an OS version of &ldquo;*&rdquo;&nbsp; This would be a preferred configuration to minimize</p>
<pre style="background: white; color: black; font-family: consolas;"><span style="color: blue;">&lt;?</span><span style="color: #a31515;">xml</span><span style="color: blue;">&nbsp;</span><span style="color: red;">version</span><span style="color: blue;">=</span>"<span style="color: blue;">1.0</span>"<span style="color: blue;">&nbsp;</span><span style="color: red;">encoding</span><span style="color: blue;">=</span>"<span style="color: blue;">utf-8</span>"<span style="color: blue;">?&gt;</span>
<span style="color: blue;">&lt;</span><span style="color: #a31515;">ServiceConfiguration</span><span style="color: blue;">&nbsp;</span><span style="color: red;">serviceName</span><span style="color: blue;">=</span>"<span style="color: blue;">IOTCloud</span>"<span style="color: blue;">&nbsp;</span><span style="color: red;">xmlns</span><span style="color: blue;">=</span>"<span style="color: blue;">http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration</span>"<span style="color: blue;">&nbsp;</span></pre>
<pre style="background: white; color: black; font-family: consolas;"><span style="color: red;">osFamily</span><span style="color: blue;">=</span>"<span style="color: blue;">4</span>"<span style="color: blue;">&nbsp;</span><span style="color: red;">osVersion</span><span style="color: blue;">=</span>"<span style="color: blue;">*</span>"<span style="color: blue;">&nbsp;</span><span style="color: red;">schemaVersion</span><span style="color: blue;">=</span>"<span style="color: blue;">2013-10.2.2</span>"<span style="color: blue;">&gt;</span></pre>
</blockquote>
<ul>
<ul>
<li><strong>Pros: </strong></li>
<ul>
<li>Provides direct control over the version of the underlying OS provisioned to host your application</li>
<li>Ensures your application is always running with the latest guest OS version (patch level) without any user/administrative intervention</li>
</ul>
</ul>
</ul>
<ul>
<ul>
<li><strong>Cons: </strong></li>
<ul>
<li>If your application is running with components having dependencies on the underlying OS; some security patches may impact the behavior of the operating system and require testing/validation.&nbsp;</li>
<li>You are <strong><em>still</em></strong> required to ensure your application is running on a supported Guest OS Family and monitoring the End of Life (EOL) dates shown on the <a href="http://msdn.microsoft.com/library/azure/ee924680.aspx" target="_blank">OS Support matrix</a>.</li>
</ul>
</ul>
</ul>
<p>&nbsp;</p>
<p>So, with this explanation, the next question is how to determine whether or not your deployed solution is pined to a specific version and to determine what SDK is being leveraged by deployments in your Azure subscriptions.&nbsp; One option is to leverage the Azure REST APIs for <a href="http://msdn.microsoft.com/library/azure/ee460804.aspx" target="_blank">service management</a> to extract details for each deployment.&nbsp;</p>
<p>My preferred method is to use <a href="http://msdn.microsoft.com/en-us/library/azure/jj554330.aspx" target="_blank">PowerShell</a>!&nbsp; The script below (you can download <a href="http://1drv.ms/1iZZTNW" target="_blank">here</a>) will walk through all of the subscriptions and deployments in associated with a given organizational or user account:</p>
<p><span style="font-family: Terminal;">foreach($subscription in Get-AzureSubscription) { </span></p>
<p><span style="font-family: Terminal;">&nbsp;&nbsp;&nbsp; Select-AzureSubscription -SubscriptionName $subscription.SubscriptionName </span></p>
<p><span style="font-family: Terminal;">&nbsp;&nbsp;&nbsp; $deployments=get-azureService | get-azureDeployment -ErrorAction Ignore | where {$_.SdkVersion -NE ""} </span></p>
<p><span style="font-family: Terminal;">&nbsp;&nbsp;&nbsp; $deployments | ft @{Name="SubscriptionName";Expression={$subscription.SubscriptionName}}, </span></p>
<p><span style="font-family: Terminal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ServiceName, SdkVersion, Slot, </span></p>
<p><span style="font-family: Terminal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @{Name="osFamily";Expression={(select-xml -content $_.configuration -xpath "/ns:ServiceConfiguration/@osFamily" -namespace $namespace).node.value }}, </span></p>
<p><span style="font-family: Terminal;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; osVersion, Status, URL </span></p>
<p><span style="font-family: Terminal;">}</span></p>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Understanding the output</span></strong></p>
<p>The script above will emit tabular details on each of your subscriptions as shown in the following image:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/0474.image_37FD4101.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/0474.image_5F00_37FD4101.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/3051.image_thumb_5E61B4FD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/3051.image_5F00_thumb_5F00_5E61B4FD.png" alt="image" width="865" height="104" border="0" /></a></p>
<p>Details on the important fields are provided below:</p>
<ul>
<li><strong>SDKVersion</strong>:</li>
<ul>
<li>This is the detected version of the Azure SDK your application is using &ndash; important as older SDKs may not be supported with later Guest OS Families</li>
</ul>
<li><strong>Slot</strong>:</li>
<ul>
<li>PaaS Applications can have either a production or staging slot &ndash; each could have different versions of the OS or SDK referenced.</li>
</ul>
<li><strong>OSFamily</strong>:</li>
<ul>
<li>If specified, the version will appear hear.&nbsp; If unspecified, the OS Family will be select based on the SDK version referenced in code.&nbsp; (In my case, SDK 2.2 can only run on OS Family 4; and is the version of the OS provisioned under the covers.)&nbsp; The default OSFamily was previously 1 if unspecified.</li>
</ul>
<li><strong>OSVersion</strong>:</li>
<ul>
<li>This is where you can see if your deployments are &lsquo;pinned&rsquo; to a specific version of the OS Family.&nbsp; If anything other than &ldquo;*&rdquo; appears hear, you would have manually maintain the version and ensure that the deployment is running on one of the <a href="http://msdn.microsoft.com/library/azure/ee924680.aspx" target="_blank">latest 2 versions</a>.</li>
</ul>
</ul>
<p>&nbsp;</p>
<p><strong><span style="text-decoration: underline;">Action to take</span></strong></p>
<p>Should you have any instances running anything less than SDK version 1.3; your deployment is likely running on an OS Family 1 instance.&nbsp; You should be receiving e-mails if you have a deployment in this state sent to the service administrator of the Azure subscription in addition to seeing a banner in the Azure portal instructing you to take action prior to June 1st.&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Azure Storage Tools</title>
      <link>https://docs.microsoft.com/archive/blogs/ryberry/windows-azure-storage-tools</link>
      <pubDate>Mon, 17 Mar 2014 10:57:52 GMT</pubDate>
      <dc:creator><![CDATA[Ryan Berry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ryberry/2014/03/17/windows-azure-storage-tools/</guid>
      <description><![CDATA[One of the most comprehensive listings of tools available (and whether or not they are free or...]]></description>
      <content:encoded><![CDATA[<p>One of the most comprehensive listings of tools available (and whether or not they are free or fee-based) for Windows Azure storage is posted <a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2010/04/17/windows-azure-storage-explorers.aspx" target="_blank">here</a>.&#160; Worth checking out if you’re in need of tooling to manually review data stored in Windows Azure.</p>]]></content:encoded>
    </item>
    <item>
      <title>Scaling Tasks Horizontally Across multiple nodes using the Task Parallel Library in .NET 4.5</title>
      <link>https://docs.microsoft.com/archive/blogs/ryberry/scaling-tasks-horizontally-across-multiple-nodes-using-the-task-parallel-library-in-net-4-5</link>
      <pubDate>Tue, 12 Feb 2013 07:03:00 GMT</pubDate>
      <dc:creator><![CDATA[Ryan Berry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ryberry/2013/02/12/scaling-tasks-horizontally-across-multiple-nodes-using-the-task-parallel-library-in-net-4-5/</guid>
      <description><![CDATA[Super computers and parallel processing have long been a complex topic to address in Computer...]]></description>
      <content:encoded><![CDATA[<p>Super computers and parallel processing have long been a complex topic to address in Computer Science.&nbsp;Practical applications of these algorithms typically involve massive datasets that can be easily broken down and distributed across many computational nodes (such as the <a href="http://en.wikipedia.org/wiki/Blue_Gene">IBM Blue Gene</a> supercomputer).&nbsp; Workloads that are good candidates for parallelization are scientific data analysis such as genetic/genome mapping or commercial applications such as <a href="http://en.wikipedia.org/wiki/Renderman">rendering ray-traced views for motion pictures</a>.&nbsp; Most of the customers I work with are in the Enterprise space but occasionally there are needs for these customers to take large datasets and perform calculations to test a theory or identify a trend in data.&nbsp; These customers seek an easy to use method to build and deploy these applications; often times to a set of servers that do not have common/connected memory buses and high speed links connecting nodes, traits characteristic with the clusters on the <a href="http://www.top500.org/lists/2012/11/">top-10 list</a>&nbsp;of supercomputers in the world.</p>
<p>While on paper one would hope for a direct linear increase in performance if you break a complex task across N physical nodes, there are theoretical limits involving the overhead of breaking work apart, physical properties of electrons and the size of the dataset being evaluated by a given application.&nbsp; There are models one can use to identify the potential speed-up of a given task described by <a href="http://en.wikipedia.org/wiki/Amdahl%27s_law">Amdahl&rsquo;s Law</a> involving a calculation based on the relationship of serial vs. parallel components of the computational algorithm used.&nbsp; <a href="http://en.wikipedia.org/wiki/Gustafson%27s_law">Gustafson&rsquo;s law</a> picks up on Amdahl&rsquo;s law to prove that, with larger sized data sets and larger compute clusters, more work can be performed in the same amount of time as a smaller dataset on smaller clusters.</p>
<p>Theory aside, my colleague came up with a brilliant and simplistic solution for partitioning work across physical nodes using the <a href="http://msdn.microsoft.com/en-us/library/dd460717.aspx">Task Parallel Library</a> (TPL) in .NET 4.5. &nbsp;Check out the&nbsp;details of the solution and download the code sample from the <a title="October 2012 issue of MSDN magazine." href="http://msdn.microsoft.com/en-us/magazine/jj658970.aspx" target="_blank">October 2012 issue of MSDN magazine</a>.</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Cluttered Desktop?  Try this!</title>
      <link>https://docs.microsoft.com/archive/blogs/ryberry/cluttered-desktop-try-this</link>
      <pubDate>Mon, 14 Nov 2011 07:47:09 GMT</pubDate>
      <dc:creator><![CDATA[Ryan Berry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ryberry/2011/11/14/cluttered-desktop-try-this/</guid>
      <description><![CDATA[Background:  I’m not usually one to endorse products; but I have to admit that I’ve fallen into the...]]></description>
      <content:encoded><![CDATA[<p><strong>Background:</strong></p>  <p>I’m not usually one to endorse products; but I have to admit that I’ve fallen into the category of users who tend to drop files ‘to-look-at-later’ onto my desktop.&#160; [Side-note: This is an extremely in-efficient means of organization and things tend to get lost in the weeds if you don’t regularly circle back and address what you’ve placed onto your desktop.]&#160;&#160; In looking for some tools to help bring organization to this black-hole I stumbled across a tool from StarDock called <a href="http://www.stardock.com/products/fences/index.asp" target="_blank">Fences</a> that works with both Windows 7 and Vista.&#160; This tool allows you to create ‘ring fences’ around groups of files/icons on your desktop bringing order to a world of chaos and confusion.&#160; </p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/2671.image_309DB87D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/2671.image_5F00_309DB87D.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/1682.image_thumb_455F8B30.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/1682.image_5F00_thumb_5F00_455F8B30.png" width="624" height="353" /></a></p>  <p>All ‘fences’ active – double clicking the desktop makes me look organized and neat to the untrained eye!&#160; (And a subsequent double-click brings my fences back.)</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/0020.image_38853512.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/0020.image_5F00_38853512.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/3240.image_thumb_26E5247A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/3240.image_5F00_thumb_5F00_26E5247A.png" width="630" height="356" /></a></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint: The Case of the Disappearing Terms from a Managed Metadata Column</title>
      <link>https://docs.microsoft.com/archive/blogs/ryberry/sharepoint-the-case-of-the-disappearing-terms-from-a-managed-metadata-column</link>
      <pubDate>Thu, 10 Nov 2011 08:19:00 GMT</pubDate>
      <dc:creator><![CDATA[Ryan Berry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ryberry/2011/11/10/sharepoint-the-case-of-the-disappearing-terms-from-a-managed-metadata-column/</guid>
      <description><![CDATA[&nbsp;I was working with a customer who had a tag used for associating a specific document with a...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;<span style="font-size: x-small;" size="2">I was working with a customer who had a tag used for associating a specific document with a geography/region as shown in the image below.&nbsp; <a href="http://office.microsoft.com/en-us/sharepoint-server-help/introduction-to-managed-metadata-in-sharepoint-server-2010-HA101859256.aspx" target="_blank">Managed metadata columns</a> are a feature in SharePoint 2010 permitting you to add specialized/pre-defined term sets to a particular content type.&nbsp; In my customer&rsquo;s case, they had a document library with a Geography column.&nbsp; </span></p>
<p></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/1307.image_0792BE47.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/1307.image_5F00_0792BE47.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/5001.image_thumb_46843EE2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/5001.image_5F00_thumb_5F00_46843EE2.png" width="850" height="92" /></a></p>
<p>&nbsp;</p>
<p><span style="font-size: x-small;" size="2">Elevated users could add documents, specifying a value for the Geography field without issue.&nbsp; &lsquo;Normal&rsquo; (Non-site admin) users could also specify a value and save a document to the library without error; however, the</span> field would not be populated with a value upon saving the document.&nbsp; (The managed metadata column would simply be blank.)</p>
<p><strong><span style="font-size: small;" size="3"><span style="text-decoration: underline;">Issue</span></span></strong></p>
<p><span style="font-size: x-small;" size="2">The hidden taxonomy list (accessible via the following url: <strong><em><a href="http://<sitecollectionURL>/lists/taxonomyhiddenlist">http://&lt;sitecollectionURL&gt;/lists/taxonomyhiddenlist</a></em></strong>) had been modified by some automated tools ran in the customer&rsquo;s environment and had removed authenticated users from this list; hence the reason why site-admins were able to properly add records but domain user&rsquo;s could not.&nbsp; Adding nt authority\authenticated users back into this hidden list resolved the problem.&nbsp; Hopefully this saves you some pain in tracking down this problem if you&rsquo;re impacted by it!</span></p>
<p></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/4118.image_65C6E5B5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/4118.image_5F00_65C6E5B5.png"><img style="display: inline; background-image: none;" title="image" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/21/82/metablogapi/3441.image_thumb_7DEA5010.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-21-82-metablogapi/3441.image_5F00_thumb_5F00_7DEA5010.png" width="500" height="279" />&nbsp;</a></p>]]></content:encoded>
    </item>
    <item>
      <title>SharePoint: Batch updating items in a list with content approval enabled</title>
      <link>https://docs.microsoft.com/archive/blogs/ryberry/sharepoint-batch-updating-items-in-a-list-with-content-approval-enabled</link>
      <pubDate>Thu, 06 May 2010 06:11:00 GMT</pubDate>
      <dc:creator><![CDATA[Ryan Berry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ryberry/2010/05/06/sharepoint-batch-updating-items-in-a-list-with-content-approval-enabled/</guid>
      <description><![CDATA[Details
I was recently looking for a way to batch update items in a list that had “Require Content...]]></description>
      <content:encoded><![CDATA[<P><STRONG>Details</STRONG></P>
<P>I was recently looking for a way to batch update items in a list that had “Require Content approval” (see Figure 1 below) enabled.&nbsp; My requirement was that, after updating the item, it would be in an approved and not be placed into a pending status.&nbsp; After doing some digging I was able to find the required command (&lt;SetVar Name=”Cmd”&gt;Moderate&lt;/SetVar&gt;) that allowed this to work.&nbsp; I’ve included a very simple test program below that updates the title field in a list and sets it to approved status (_ModerationStatus==0).&nbsp; You can also assign other status values based on the enum <A href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spmoderationstatustype.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spmoderationstatustype.aspx">SPModerationStatusType</A> (values listed below).</P>
<BLOCKQUOTE>
<P><EM>public enum <A href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spmoderationstatustype.aspx" target=_blank mce_href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spmoderationstatustype.aspx">SPModerationStatusType</A> <BR>{ <BR>&nbsp;&nbsp;&nbsp; // Summary: <BR>&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp; The item is displayed in public views of the list or document library. <BR>&nbsp;&nbsp;&nbsp; Approved = 0, <BR>&nbsp;&nbsp;&nbsp; // <BR>&nbsp;&nbsp;&nbsp; // Summary: <BR>&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp; The item is not displayed in public views of the list or document library. <BR>&nbsp;&nbsp;&nbsp; Denied = 1, <BR>&nbsp;&nbsp;&nbsp; // <BR>&nbsp;&nbsp;&nbsp; // Summary: <BR>&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp; The decision about displaying the item in public views of the list or document <BR>&nbsp;&nbsp;&nbsp; //&nbsp;&nbsp;&nbsp;&nbsp; library is pending. <BR>&nbsp;&nbsp;&nbsp; Pending = 2, <BR>&nbsp;&nbsp;&nbsp; Draft = 3, <BR>&nbsp;&nbsp;&nbsp; Scheduled = 4, <BR>}</EM></P></BLOCKQUOTE>
<P><A href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/SharePointBatchupdatingitemsinalistwithc_8131/image_2.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/SharePointBatchupdatingitemsinalistwithc_8131/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/SharePointBatchupdatingitemsinalistwithc_8131/image_2.png"><IMG style="BORDER-BOTTOM: 0px; BORDER-LEFT: 0px; DISPLAY: block; FLOAT: none; MARGIN-LEFT: auto; BORDER-TOP: 0px; MARGIN-RIGHT: auto; BORDER-RIGHT: 0px" title=image border=0 alt=image src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/SharePointBatchupdatingitemsinalistwithc_8131/image_thumb.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/SharePointBatchupdatingitemsinalistwithc_8131/image_thumb.png" width=564 height=132 mce_src="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/SharePointBatchupdatingitemsinalistwithc_8131/image_thumb.png"></A> </P>
<P align=center><STRONG>Figure 1 – Content Approval Option</STRONG></P>
<P align=center><STRONG></STRONG></P>
<P align=center><STRONG>Code Sample (sans adequate error checking) that ‘batch-updates’ a single item</STRONG></P>
<P><EM>static void Main(string[] args) <BR>{ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StringBuilder methodBuilder = new StringBuilder(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string batch = string.Empty; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string batchFormat = "&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;" + <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;ows:Batch OnError=\"Return\"&gt;{0}&lt;/ows:Batch&gt;"; </EM></P>
<P><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string methodFormat = "&lt;Method ID=\"{0},Update\"&gt;" + <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;SetList&gt;{1}&lt;/SetList&gt;" + <BR></EM><EM><STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;SetVar Name=\"Cmd\"&gt;Moderate&lt;/SetVar&gt;" + <BR></STRONG>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;SetVar Name=\"ID\"&gt;{2}&lt;/SetVar&gt;" + <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;SetVar Name=\"urn:schemas-microsoft-com:office:office#Title\"&gt;{3}&lt;/SetVar&gt;" + <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;SetVar Name=\"urn:schemas-microsoft-com:office:office#_ModerationStatus\"&gt;0&lt;/SetVar&gt;" +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "&lt;/Method&gt;"; </EM></P>
<P><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using (SPSite site = new SPSite("</EM><A href="http://moss.litwareinc.com/sites/aspnet%22))" mce_href='http://moss.litwareinc.com/sites/aspnet"))'><EM>http://moss.litwareinc.com/sites/aspnet"))</EM></A> <BR><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; using (SPWeb sourceWeb = site.OpenWeb()) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int itemID = 1; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SPList list = sourceWeb.Lists["TestList"]; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sourceWeb.AllowUnsafeUpdates = true; <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string listGuid = list.ID.ToString(); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; methodFormat = string.Format(methodFormat, itemID, listGuid, itemID,"SomeValue1a1aa"); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; batch = string.Format(batchFormat, methodFormat.ToString()); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; string batchReturn = sourceWeb.ProcessBatchData(batch); <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; catch (Exception oEx) <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { </EM></P>
<P><EM>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp; // End exception block <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } // End using spweb <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }&nbsp;&nbsp; // End using SPSite</EM></P>
<P><EM>} // End Main</EM></P>]]></content:encoded>
    </item>
    <item>
      <title>Transferring large blobs of data with WCF</title>
      <link>https://docs.microsoft.com/archive/blogs/ryberry/transferring-large-blobs-of-data-with-wcf</link>
      <pubDate>Tue, 20 Apr 2010 10:26:00 GMT</pubDate>
      <dc:creator><![CDATA[Ryan Berry]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ryberry/2010/04/20/transferring-large-blobs-of-data-with-wcf/</guid>
      <description><![CDATA[Series Introduction     Since Windows Communication Foundation’s (WCF) introduction with the .NET...]]></description>
      <content:encoded><![CDATA[<p><strong>Series Introduction</strong>     <br />Since Windows Communication Foundation’s (WCF) introduction with the .NET Framework 3.0, developers have quickly realized the potential and power available with WCF while overall reducing the net amount of code one has to write and support to allow applications to communicate.&#160; Since connected systems are a strong driver to reduce costs and improve efficiencies with critical business systems; many organizations are making investments in service orientation.&#160; WCF introduces many standards compliant methods to ‘configure’ applications to communicate via protocols that, in the past, required developer expertise with specific API ‘stacks’ that provided the requisite service features.&#160; (E.g. ASP.NET web services (ASMX), Web Services Enhancements (WSE), System.Messaging (for MSMQ), Enterprise Services (for transactional behavior) and .NET Remoting.) WCF serves to break down the impendence mismatch across these various communication technologies to allow developers to work with a unified programming model (System.ServiceModel) that permits configuration-based service orientation simply by defining the communication characteristics in the client and server’s app.config file.&#160;&#160; With so many configuration options available to select from, it can be overwhelming to decide an appropriate binding configuration that provides the services and performance desired for specific application’s needs.&#160; This series will attempt to provide concrete, real-world examples of some of the advanced features and characteristics of WCF to make this selection process as easy as ordering off your favorite fast food menu. </p>  <p>   <br />This series assumes a basic understanding of WCF fundamentals and will provide specific usage scenarios for different WCF addresses, bindings and contracts. (Many articles already exist on this topic including one <a href="http://msdn.microsoft.com/en-us/library/aa480190.aspx" target="_blank">here</a>.&#160; Additional information may be found <a href="http://msdn.microsoft.com/en-us/netframework/aa663324.aspx" target="_blank">here</a> and in Justin Smith’s <em><u><a href="http://www.microsoft.com/learning/en/us/book.aspx?ID=9610&amp;locale=en-us" target="_blank">Inside Windows® Communication Foundation</a></u></em>.) </p>  <p>   <br /><strong>Streaming data with WCF</strong>     <br />There may be instances where you need to transfer multi-megabyte files or blocks of data from your service to a consumer.&#160; While you could have a method that returns a stream or byte array defined in your service contract, there are some potential memory implications this could introduce to your host process.&#160; When a block of memory is allocated within a managed process that exceeds 85,000 bytes in size, the CLR performs this allocation in a special region called the Large Object Heap. (LOH – Details can be found <a href="http://msdn.microsoft.com/en-us/magazine/cc534993.aspx" target="_blank">here</a>.)&#160; Large, short-lived allocations in the LOH can lead to unexpected memory consumption of your host process since this heap is only collected during a Gen-2 garbage collection (that occurs less frequently).&#160; This consumption of memory may also lead to a premature Out-of-Memory (OOM) exception within your host process since the LOH is not currently compacted (as of the 2.0 CLR) if there is not a large enough contiguous free-region within the process’s memory space to fulfill the allocation request.&#160; These sorts of problems typically don’t arise until your place your WCF host under extreme load and sometimes, unfortunately, surface once the application is in production.&#160; (This further underscores the importance of executing appropriate test plans!)&#160; Luckily, there are a couple of options available to mitigate this problem.&#160; One option is to take advantage of the streaming option available with the BasicHttpBinding, NetTcpBinding, and NetNamedPipeBinding; while another is to allow consumers to request chunks of data that is smaller than the 85,000 LOH threshold.&#160; In this posting, we’ll look at both. </p>  <p>   <br />Configuration </p>  <p><strong>Project setup:      <br /></strong>The solution contains 4 projects (See Figure 1) to demonstrate large-data transfers using WCF.&#160; The service contract is defined in the SharedInterface project that is referenced by both the client and the service implementation.&#160; The actual service implementation is in the ServiceImpl project and the client, capable of illustrating all 3 methods of requesting data,&#160; is in the FormsClient project.&#160;&#160; The server project is a simple console application you can use to run the solution outside of the IDE.&#160; (The implementation is separated from the sample host process so we can leverage the built-in WCF host within Visual Studio 2008.) </p>  <p>&#160;<strong><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/wcf_stream_fig1_2.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/wcf_stream_fig1_2.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="wcf_stream_fig1" border="0" alt="wcf_stream_fig1" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/wcf_stream_fig1_thumb.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/wcf_stream_fig1_thumb.png" width="170" height="104" /></a> </strong></p>  <blockquote>   <p align="center"><strong>Figure 1 – Project Layout</strong> </p> </blockquote>  <p>   <br />To start with, we’ll define our service contract to have to two call-options.&#160; One returning a stream while the other returns chunks of data.&#160; The ‘chunking’ method is an alternative means of returning data to a consumer through a series of multiple calls where the consumer tracks its progress through the bytes of the file.&#160; This method returns a struct with the total file size as well as the requested byte region from the file and is declared in the SharedInterface. </p>  <p>   <br /><font color="#000080"></font></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>[<span style="color: #2b91af">DataContract</span>] </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span><span style="color: blue">public</span> <span style="color: blue">struct</span> <span style="color: #2b91af">ChunkedDataResult </span></span>    <p></p> </p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>{ </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>[<span style="color: #2b91af">DataMember</span>] </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">public</span> <span style="color: blue">byte</span>[] ChunkedBlock; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>[<span style="color: #2b91af">DataMember</span>] </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="color: blue">public</span> <span style="color: blue">long</span> StreamSize; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>} </span></p>  <p></p>  <p></p>  <p></p>  <p>   <br />Then, we configure our bindings.&#160; In this example, I have defined 1 binding to stream the response defined as follows and another to use the (default) buffered transfermode.&#160; Both endpoints have relative addresses (Streaming and Buffered) that are rooted on the port and service name described by the baseaddress setting.     <br /></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">system.serviceModel</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">bindings</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">basicHttpBinding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">binding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">name</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">StreamedBinding</span>&quot;<span style="color: blue"> </span><span style="color: red">messageEncoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">Mtom</span>&quot;<span style="color: blue"> </span><span style="color: red">transferMode</span><span style="color: blue">=</span>&quot;<span style="color: blue">Streamed</span>&quot;<span style="color: blue"><span style="mso-spacerun: yes">&#160; </span>/&gt; </span></span>    <p></p> </p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">binding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">name</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">BufferedBinding</span>&quot;<span style="color: blue"> </span><span style="color: red">messageEncoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">Mtom</span>&quot;<span style="color: blue"> </span><span style="color: red">transferMode</span><span style="color: blue">=</span>&quot;<span style="color: blue">Buffered</span>&quot;<span style="color: blue"> /&gt; </span></span>    <p></p> </p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">basicHttpBinding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">bindings</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"></span></p>  <p>&#160;</p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">services</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">service</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">behaviorConfiguration</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">WcfServiceLibrary1.Service1Behavior</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-tab-count: 3">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="mso-spacerun: yes">&#160;</span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">name</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">WCFSamples.ServiceImpl</span>&quot;<span style="color: blue">&gt;</span></span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span></p>  <p>&#160;</p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">endpoint</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">binding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">basicHttpBinding</span>&quot;<span style="color: blue"> </span><span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">StreamedBinding</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-tab-count: 4">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="mso-spacerun: yes">&#160;</span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">name</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">WCFSamples_Streamed</span>&quot;<span style="color: blue"> </span><span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">WCFSamples.IStreamingService</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">address</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">Streaming</span>&quot;</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">endpoint</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"></span></p>  <p>&#160;</p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">endpoint</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">address</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> =</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">Buffered</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-tab-count: 4">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="mso-spacerun: yes">&#160;</span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">binding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">basicHttpBinding</span>&quot;<span style="color: blue"> </span><span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">BufferedBinding</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-tab-count: 4">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="mso-spacerun: yes">&#160;</span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">name</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">WCFSamples_Buffered</span>&quot;<span style="color: blue"> </span><span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">WCFSamples.IStreamingService</span>&quot;</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">endpoint</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"></span></p>  <p>&#160;</p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">endpoint</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">address</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">mex</span>&quot;<span style="color: blue"> </span><span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">mexHttpBinding</span>&quot;<span style="color: blue"> </span><span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">IMetadataExchange</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-tab-count: 4">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span><span style="mso-spacerun: yes">&#160;</span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">listenUriMode</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">Explicit</span>&quot;<span style="color: blue">&gt; </span></span>    <p></p> </p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">endpoint</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"></span></p>  <p>&#160;</p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">host</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">baseAddresses</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">add</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">baseAddress</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">http://localhost:8500/WCFSamples</span>&quot;<span style="color: blue"> /&gt; </span></span>    <p></p> </p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">baseAddresses</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>&lt;/</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">host</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&gt; </span></p>  <p></p>  <p></p>  <p></p>  <p></p>  <p>The key components of this binding is the transferMode option.&#160; For our streamed tests, we set it to <a href="http://msdn.microsoft.com/en-us/library/system.servicemodel.transfermode.aspx" target="_blank">StreadmedResponse</a>.&#160; When using this transfermode (that, again, is available with the basicHttpBinding&#160; in addition to the TCP and NamedPipe bindings) within the context of a web application hosted in either IIS, there are a couple of considerations to keep in mind: </p>  <p>   <br />1)&#160;&#160;&#160;&#160; Visual Studio’s&#160; webdev server (Cassini) cannot handle streaming over HTTP.&#160;&#160; For testing, you need to host in a console application or through the WCF host utility.&#160; (As I have done in the sample).     <br />2)&#160;&#160;&#160;&#160; IIS uses the ASP.NET <a href="http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength.aspx" target="_blank">maxRequestLength</a> setting for the max length not the setting defined WCF setting.&#160;&#160; You will need to add this to your web.config to ensure IIS is able to return the data requested.     <br />3)&#160;&#160;&#160; IIS cannot transfer more than 2GB of data. You'll need to self host to get around this if you need to send more data than that.     <br />4)&#160;&#160;&#160; To avoid timeouts, you will need to increase the receive timeouts on the client (as I have done in the FormsClient’s configuration shown below.&#160; Note the extended recieveTimeouts in addition to both the increased maxBuffersize and maxRecievedMessageSize). </p>  <p>   <br /></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">binding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">name</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">WCFSamples_Buffered</span>&quot;<span style="color: blue"> </span><span style="color: red">closeTimeout</span><span style="color: blue">=</span>&quot;<span style="color: blue">00:01:00</span>&quot;<span style="color: blue"> </span><span style="color: red">openTimeout</span><span style="color: blue">=</span>&quot;<span style="color: blue">00:01:00</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">receiveTimeout</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">00:10:00</span>&quot;<span style="color: blue"> </span><span style="color: red">sendTimeout</span><span style="color: blue">=</span>&quot;<span style="color: blue">00:01:00</span>&quot;<span style="color: blue"> </span><span style="color: red">allowCookies</span><span style="color: blue">=</span>&quot;<span style="color: blue">false</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">bypassProxyOnLocal</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">false</span>&quot;<span style="color: blue"> </span><span style="color: red">hostNameComparisonMode</span><span style="color: blue">=</span>&quot;<span style="color: blue">StrongWildcard</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">maxBufferSize</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">2097152</span>&quot;<span style="color: blue"> </span><span style="color: red">maxBufferPoolSize</span><span style="color: blue">=</span>&quot;<span style="color: blue">524288</span>&quot;<span style="color: blue"> </span><span style="color: red">maxReceivedMessageSize</span><span style="color: blue">=</span>&quot;<span style="color: blue">2097152</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">messageEncoding</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">Mtom</span>&quot;<span style="color: blue"> </span><span style="color: red">textEncoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot;<span style="color: blue"> </span><span style="color: red">transferMode</span><span style="color: blue">=</span>&quot;<span style="color: blue">Buffered</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">useDefaultWebProxy</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">true</span>&quot;<span style="color: blue">&gt; </span></span>    <p></p> </p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160; </span>&lt;</span><span style="font-family: &quot;Courier New&quot;; color: #a31515; font-size: 8pt; mso-no-proof: yes">readerQuotas</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"> </span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">maxDepth</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">32</span>&quot;<span style="color: blue"> </span><span style="color: red">maxStringContentLength</span><span style="color: blue">=</span>&quot;<span style="color: blue">8192</span>&quot;<span style="color: blue"> </span><span style="color: red">maxArrayLength</span><span style="color: blue">=</span>&quot;<span style="color: blue">65536</span>&quot; </span></p>  <p></p>  <p></p>  <p></p>  <p style="line-height: normal; margin-bottom: 0pt; mso-layout-grid-align: none" class="MsoNormal"><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes"><span style="mso-spacerun: yes">&#160;&#160;&#160;&#160;&#160; </span></span><span style="font-family: &quot;Courier New&quot;; color: red; font-size: 8pt; mso-no-proof: yes">maxBytesPerRead</span><span style="font-family: &quot;Courier New&quot;; color: blue; font-size: 8pt; mso-no-proof: yes">=</span><span style="font-family: &quot;Courier New&quot;; font-size: 8pt; mso-no-proof: yes">&quot;<span style="color: blue">4096</span>&quot;<span style="color: blue"> </span><span style="color: red">maxNameTableCharCount</span><span style="color: blue">=</span>&quot;<span style="color: blue">16384</span>&quot;<span style="color: blue"> /&gt; </span></span>    <p></p> </p>  <p></p>  <p></p>  <p>&#160;</p>  <p>Evidence    <br />Using the <a href="http://www.microsoft.com/whdc/devtools/debugging/default.mspx" target="_blank">Debugging tools for Windows®</a>; I collected some memory dumps of the host process to illustrate the allocations that occur when one of our images is sent to a consumer using the buffered transfer mode.&#160; (While collecting a memory dump is outside the scope of this article, the command I used to collect a dump is: adplus –quiet –hang –pn server.exe.&#160; Adplus is a VB Script&#160; that is located in the installation directory of the Debugging tools. )&#160; Upon inspection (See Figure 2), we can clearly see the large byte-array allocations within the LOH. </p>  <p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/buffered_2.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/buffered_2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="buffered" border="0" alt="buffered" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/buffered_thumb.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/buffered_thumb.png" width="307" height="222" /></a> </p>  <p align="center"><strong>Figure 2 – Allocations that occur when transferMode = Buffered </strong></p>  <p>&#160;</p>  <p>When we examine the LOH (See figure 3) when transferMode=Streaming (or StreamedResponse); we can see that there are no large byte array allocations that occur to ‘buffer’ the data for the client.&#160; (The object arrays are pinned regions of memory not related to the buffering of data from what I can tell.)</p>  <p>&#160;</p>  <p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/streamed_2.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/streamed_2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="streamed" border="0" alt="streamed" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/streamed_thumb.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/streamed_thumb.png" width="425" height="167" /></a>     <br /><strong>Figure 3 – Allocations that occur when transferMode = Streaming/StreamedResponse </strong></p>  <p>With our ‘chunked’ transfer mode, we also see that these LOH allocations disappear (See figure 4) and we instead see many smaller allocations that are slightly larger than our 65,535 byte block-size we defined in our server implementation.&#160; (The additional bytes are overhead with the WCF message.)&#160; These blocks are controlled by the following line in our service contract implementation.&#160; (StreamingImplementation.cs). </p>  <p>private const int BLOCKSIZE = 65535; </p>  <p align="center"><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/chunking_2.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/chunking_2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="chunking" border="0" alt="chunking" src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/BlogFileStorage/blogs_msdn/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/chunking_thumb.png" original-url="http://blogs.msdn.com/blogfiles/ryberry/WindowsLiveWriter/TransferringlargeblogsofdatawithWCF_FC1B/chunking_thumb.png" width="423" height="372" /></a> </p>  <p align="center"><strong>Figure 4 – Allocations that occur with our ‘chunking’ solution </strong></p>  <p>While this article presented a configuration-based solution and an application-implemented solution; one could also leverage WCF’s many extensibility points to develop a channel that behaved similarly to&#160; ‘chunked’ receive method shown above.&#160; There’s a great starting point of such a solution <a href="http://msdn.microsoft.com/en-us/library/aa717050.aspx" target="_blank">here</a>. </p>  <p>&#160;</p>  <p>The code examples used for this solution can be downloaded from <a href="http://cid-68cfe4807d399367.skydrive.live.com/browse.aspx/BlogPosts" target="_blank">here</a>.</p>]]></content:encoded>
    </item>
  </channel>
</rss>