<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Silverlight Web Services Team</title><subtitle type="html" /><id>http://blogs.msdn.com/silverlightws/atom.xml</id><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/default.aspx" /><link rel="self" type="application/atom+xml" href="http://blogs.msdn.com/silverlightws/atom.xml" /><generator uri="http://communityserver.org" version="2.1.61025.2">Community Server</generator><updated>2008-10-20T14:39:00Z</updated><entry><title>Adoption of Silverlight serialization and communication technologies in web applications – October 2009</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/10/16/adoption-of-silverlight-serialization-and-communication-technologies-in-web-applications-october-2009.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/10/16/adoption-of-silverlight-serialization-and-communication-technologies-in-web-applications-october-2009.aspx</id><published>2009-10-16T20:47:55Z</published><updated>2009-10-16T20:47:55Z</updated><content type="html">&lt;p&gt;We have repeated the research of the adoption of communication and serialization technologies in Silverlight applications that was originally done in February 2009. &lt;a href="http://tomasz.janczuk.org/2009/10/adoption-of-silverlight-serialization.html"&gt;The new report is based on a research done in October 2009&lt;/a&gt; and will give you an idea of the changing preferences of Silverlight developers. Enjoy and let us know what you think.&lt;/p&gt;  &lt;p&gt;Tomasz Janczuk   &lt;br /&gt;Development Manager    &lt;br /&gt;WCF Team&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9908371" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author></entry><entry><title>Having a PollingDuplex service and any other WCF service in the same website causes Silverlight calls to be slow</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/09/30/having-a-pollingduplex-service-and-any-other-wcf-service-in-the-same-website-causes-silverlight-calls-to-be-slow.aspx" /><link rel="enclosure" type="application/x-zip-compressed" length="41550" href="http://blogs.msdn.com/silverlightws/attachment/9901498.ashx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/09/30/having-a-pollingduplex-service-and-any-other-wcf-service-in-the-same-website-causes-silverlight-calls-to-be-slow.aspx</id><published>2009-09-30T23:50:00Z</published><updated>2009-09-30T23:50:00Z</updated><content type="html">&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;After polling duplex support for WCF was released in Silverlight 2 (&lt;/FONT&gt;&lt;/SPAN&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/dd470105(VS.95).aspx"&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;http://msdn.microsoft.com/en-us/library/dd470105(VS.95).aspx&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;), some customers reported the issue that when a polling duplex service co-exists with normal WCF service on the same IIS web application, the WCF service might be significantly slowed sometimes.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;In this post we will show you the process the team followed to resolve the issue. Hopefully you will find this useful in debugging your own SL apps when you encounter a problem. Please see the end of the post for the solution.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;The first thing we have to do is to create some code that reproduces the issue. After contacting customers to get there scenarios and settings, we are able to create a test Silverlight application and ASP.Net web application that consistently reproduce this issue (see attached probject). Our test application has two client proxies, one polling duplex based stock ticker and one normal BasicHttpBinding-based calculator. Once the xap is loaded, calculator proxy will start continuously calling the “Add” method of the calculator. &lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;The app also has a checkbox which will cause the stock ticker service to start sending periodic stock price updates to the SL client, so at this point the SL all will be using both the regular WCF service and the polling duplex service.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;By doing some research we identified that the following features could be influencing the observed slow behavior:&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 12pt 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Using WCF’s ASP.Net Compatibility Mode&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 12pt 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Using ASP.Net sessions&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 12pt 0in 0pt 0.5in; mso-list: l1 level1 lfo1" class=MsoListParagraph&gt;&lt;SPAN style="FONT-FAMILY: Symbol; COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Symbol; mso-bidi-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Selecting between the Silverlight BrowserHttp or ClientHttp stack&lt;B&gt;&lt;I&gt; &lt;/I&gt;&lt;/B&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;We then ran a series of tests to determine when we could observe the slowness reported by our customers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE style="BORDER-COLLAPSE: collapse; mso-yfti-tbllook: 1184; mso-padding-alt: 0in 0in 0in 0in" class=MsoNormalTable border=0 cellSpacing=0 cellPadding=0 class="MsoNormalTable"&gt;
&lt;TBODY&gt;
&lt;TR style="HEIGHT: 25.9pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes"&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: black 1pt solid; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 25.9pt; BORDER-TOP: black 1pt solid; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 25.9pt; BORDER-TOP: black 1pt solid; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 12pt 0in 0pt" class=MsoNormal align=center&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Browser Http&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 25.9pt; BORDER-TOP: black 1pt solid; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 12pt 0in 0pt" class=MsoNormal align=center&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Client Http&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 0.2in; mso-yfti-irow: 1"&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: black 1pt solid; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 0.2in; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;ASP.Net compat mode enabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Session enabled.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 0.2in; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 12pt 0in 0pt" class=MsoNormal align=center&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: #1f497d; FONT-SIZE: 12pt; mso-highlight: yellow"&gt;&lt;FONT face=Calibri&gt;Slow&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 0.2in; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 12pt 0in 0pt" class=MsoNormal align=center&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Normal&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 53.75pt; mso-yfti-irow: 2"&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: black 1pt solid; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 53.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;ASP.Net compat mode enabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Session disabled&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 53.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 12pt 0in 0pt" class=MsoNormal align=center&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Normal&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 53.75pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 12pt 0in 0pt" class=MsoNormal align=center&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Normal&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR style="HEIGHT: 40.8pt; mso-yfti-irow: 3; mso-yfti-lastrow: yes"&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: black 1pt solid; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 40.8pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;No ASP.Net compat&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 40.8pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 12pt 0in 0pt" class=MsoNormal align=center&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Normal&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD style="BORDER-BOTTOM: black 1pt solid; BORDER-LEFT: #d4d0c8; PADDING-BOTTOM: 0in; BACKGROUND-COLOR: transparent; PADDING-LEFT: 5.4pt; WIDTH: 156pt; PADDING-RIGHT: 5.4pt; HEIGHT: 40.8pt; BORDER-TOP: #d4d0c8; BORDER-RIGHT: black 1pt solid; PADDING-TOP: 0in" vAlign=top width=208&gt;
&lt;P style="TEXT-ALIGN: center; MARGIN: 12pt 0in 0pt" class=MsoNormal align=center&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Normal&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;As it shows above, the slowdown of the WCF call happens when the services are hosted in ASP.Net compat mode AND when user enabled ASP.Net sessions. The ASP.Net session is enabled when your web application has a global.asax file and it contains a session_start method. It turns out when the ASP.Net session state is enabled, requests for the same session will be processed sequentially. &lt;/SPAN&gt;&lt;FONT size=3&gt;&lt;SPAN style="COLOR: #1f497d"&gt;So the calls to the responses for the regular WCF service will get queued up behind the long polls made to the polling duplex service.&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;Using Fiddler, we can capture the HTTP packages and see the mechanism that ASP.Net uses to enable the session. It is enabled by setting the ASP.NET_SessionId cookie from service side.&lt;/SPAN&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;POST /PollingWcfServices/ServiceWcf.svc HTTP/1.1&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;Accept: */*&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;Content-Length: 564&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;Content-Type: application/soap+xml; charset=utf-8&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;Accept-Encoding: gzip, deflate&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;User-Agent: Mozilla/4.0 &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;Host: foo&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;Connection: Keep-Alive&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;FONT face=Calibri&gt;Pragma: no-cache&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNormal&gt;&lt;FONT face=Calibri&gt;&lt;SPAN style="BACKGROUND: yellow; COLOR: #1f497d; FONT-SIZE: 10pt; mso-highlight: yellow"&gt;Cookie: ASP.NET_SessionId=iyr4sf55rm1kypafjdvlhm55&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 10pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;o:p&gt;&lt;FONT face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;This is why the client stack can work around the concurrent requests issue. By default when you use client stack, cookies are not automatically maintained between requests so the cookie set on the server is not returned in the subsequent request. Without the cookie ASP.Net doesn’t know which session to lock and it doesn’t lock it. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;B&gt;&lt;I&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;o:p&gt;&lt;FONT size=3 face=Calibri&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/B&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 0pt" class=MsoNormal&gt;&lt;I&gt;&lt;SPAN style="COLOR: #1f497d"&gt;&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;To work around the slowness, the user can switch to using the client stack to access both services. If the user wants to take advantage of ASP.Net sessions for the regular WCF service, they can use the browser stack for the regular service and the client stack for the polling duplex service. Currently the polling duplex service cannot be used with the browser stack if ASP.Net sessions are enabled. Here is the documentation page on how to register the browser or client stack for a given service.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;All WCF services require read/write session state access if you enable&lt;B&gt;&lt;I&gt; &lt;/I&gt;&lt;/B&gt;ASP.Net sessions, which causes the replies to be queued sequentially. &amp;nbsp;Ideally user should be able configure the WCF handler to be read only, which would allow polling duplex services to work with sessions. Unfortunately this is unsupported at this point. &lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 12pt 0in 0pt" class=MsoNormal&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Instruction for running the sample&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 12pt 0in 0pt 0.5in; mso-list: l0 level1 lfo2" class=MsoListParagraph&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;1.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Run Visual Studio as administrator&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="TEXT-INDENT: -0.25in; MARGIN: 12pt 0in 0pt 0.5in; mso-list: l0 level1 lfo2" class=MsoListParagraph&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt; mso-fareast-font-family: Calibri; mso-bidi-font-family: Calibri"&gt;&lt;SPAN style="mso-list: Ignore"&gt;&lt;FONT face=Calibri&gt;2.&lt;/FONT&gt;&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #1f497d; FONT-SIZE: 12pt"&gt;&lt;FONT face=Calibri&gt;Enable anonymous authentication on the web application created by the project&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9901498" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="polling duplex" scheme="http://blogs.msdn.com/silverlightws/archive/tags/polling+duplex/default.aspx" /></entry><entry><title>Scale-out of Silverlight HTTP polling duplex WCF service in a web farm scenario</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/09/16/scale-out-of-silverlight-http-polling-duplex-wcf-service-in-a-web-farm-scenario.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/09/16/scale-out-of-silverlight-http-polling-duplex-wcf-service-in-a-web-farm-scenario.aspx</id><published>2009-09-17T04:08:20Z</published><updated>2009-09-17T04:08:20Z</updated><content type="html">&lt;p&gt;The &lt;a href="http://tomasz.janczuk.org/2009/08/performance-of-http-polling-duplex.html"&gt;recent post&lt;/a&gt; about performance of Silverlight HTTP polling duplex protocol pointed out scalability challenges associated with deploying a WCF service using the protocol in a web farm scenario. &lt;a href="http://tomasz.janczuk.org/2009/09/scale-out-of-silverlight-http-polling.html"&gt;This follow up article&lt;/a&gt; introduces one possible solution to the scale-out problem, enabling applications utilizing the protocol to accommodate an arbitrary number of concurrent clients through scale-out of the backend infrastructure.&lt;/p&gt;  &lt;p&gt;Let us know what you think!&lt;/p&gt;  &lt;p&gt;Tomasz Janczuk   &lt;br /&gt;Development Manager    &lt;br /&gt;WCF Team&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9896128" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author></entry><entry><title>Channel9 WCF duplex demo</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/08/27/channel9-wcf-duplex-demo.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/08/27/channel9-wcf-duplex-demo.aspx</id><published>2009-08-27T10:30:56Z</published><updated>2009-08-27T10:30:56Z</updated><content type="html">&lt;p&gt;&lt;a title="Watch Channel9 video" href="http://channel9.msdn.com/shows/The+Knowledge+Chamber/Yavor-Georgiev-Using-WCF-with-Silverlight-30/"&gt;&lt;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="Watch Channel9 video" border="0" alt="Watch Channel9 video" src="http://blogs.msdn.com/blogfiles/silverlightws/WindowsLiveWriter/Channel9WCFduplexdemo_73D/TKC016YavorGeorgiev_large_ch9%5B1%5D_3.png" width="320" height="240" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Recently I spent some time with Robert Hess over at &lt;a href="http://channel9.msdn.com"&gt;Channel9&lt;/a&gt; discussing Silverlight 3 and giving a short demo of our duplex binding. If you haven’t seen PollingDuplex in action, this might be of interest.&lt;/p&gt;  &lt;p&gt;Cheers,    &lt;br /&gt;-Yavor Georgiev     &lt;br /&gt;Program Manager, Connected Framework &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9886660" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="presentations" scheme="http://blogs.msdn.com/silverlightws/archive/tags/presentations/default.aspx" /><category term="duplex" scheme="http://blogs.msdn.com/silverlightws/archive/tags/duplex/default.aspx" /></entry><entry><title>Using web service faults with the new SL3 client HTTP stack</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/08/17/using-web-service-faults-with-the-new-sl3-client-http-stack.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/08/17/using-web-service-faults-with-the-new-sl3-client-http-stack.aspx</id><published>2009-08-17T20:31:42Z</published><updated>2009-08-17T20:31:42Z</updated><content type="html">&lt;p&gt;Carlos, one of our team members, has posted an quick blog &lt;a href="http://blogs.msdn.com/carlosfigueira/archive/2009/08/15/fault-support-in-silverlight-3.aspx"&gt;post on how to use SOAP faults with the new client HTTP stack&lt;/a&gt;, introduced in SL3. This makes configuring faults significantly easier: there is no need to write custom code in your WCF service, and all you need to do is add one line of code to the Silverlight client.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;  &lt;p&gt;-Yavor Georgiev    &lt;br /&gt;Program Manager&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9872546" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author></entry><entry><title>AJAX client for HTTP polling duplex WCF channel in Microsoft Silverlight 3</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/08/05/ajax-client-for-http-polling-duplex-wcf-channel-in-microsoft-silverlight-3.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/08/05/ajax-client-for-http-polling-duplex-wcf-channel-in-microsoft-silverlight-3.aspx</id><published>2009-08-06T03:33:10Z</published><updated>2009-08-06T03:33:10Z</updated><content type="html">&lt;p&gt;If you are interested in coding an AJAX client application that consumes asynchronous data notifications from a WCF backend service using the Microsoft Silverlight 3 HTTP polling duplex channel, check out &lt;a href="http://tomasz.janczuk.org/2009/08/ajax-client-for-http-polling-duplex-wcf.html"&gt;the AJAX client for HTTP polling duplex sample&lt;/a&gt;. It contains a JavaScript library with client side implementation of the polling duplex protocol implemented in the PollingDuplexHttpBinding from Microsoft Silverlight 3. It has been tested with Internet Explorer 8, Firefox 3.5, and Chrome 2.0. Let us know what you think.&lt;/p&gt;  &lt;p&gt;Tomasz Janczuk   &lt;br /&gt;Development Manager    &lt;br /&gt;WCF Team&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9858539" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author></entry><entry><title>Pub/sub sample using HTTP polling duplex WCF channel in Microsoft Silverlight 3</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/07/24/pub-sub-sample-using-http-polling-duplex-wcf-channel-in-microsoft-silverlight-3.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/07/24/pub-sub-sample-using-http-polling-duplex-wcf-channel-in-microsoft-silverlight-3.aspx</id><published>2009-07-25T03:26:31Z</published><updated>2009-07-25T03:26:31Z</updated><content type="html">&lt;p&gt;We now have a sample implementation of a pub/sub scenario that uses the HTTP polling duplex WCF channel shipped in Silverlight 3. The sample demonstrates some of the best practices for implementing performance-conscious duplex scenarios using the PollingDuplexHttpBinding, as well as the usability benefits of duplex WCF proxies generated using the Add Service Reference feature of Visual Studio in Silverlight 3. Check out &lt;a href="http://tomasz.janczuk.org/2009/07/pubsub-sample-using-http-polling-duplex.html"&gt;the full description of the polling duplex sample and access the source code&lt;/a&gt;, then let us know what you think. &lt;/p&gt;  &lt;p&gt;Tomasz Janczuk    &lt;br /&gt;Development Manager     &lt;br /&gt;WCF Team&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9847992" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author></entry><entry><title>Adoption of WCF technologies in Silverlight 2 applications on the web</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/07/09/adoption-of-wcf-technologies-in-silverlight-2-applications-on-the-web.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/07/09/adoption-of-wcf-technologies-in-silverlight-2-applications-on-the-web.aspx</id><published>2009-07-10T02:32:46Z</published><updated>2009-07-10T02:32:46Z</updated><content type="html">&lt;p&gt;If you are interested in what communication and serialization technologies are being used by others in Silverlight 2 applications, check out the post at &lt;a href="http://tomasz.janczuk.org/2009/07/adoption-of-wcf-technologies-in.html"&gt;http://tomasz.janczuk.org/2009/07/adoption-of-wcf-technologies-in.html&lt;/a&gt;. It is a summary of a research of over 700 actual Silverlight 2 applications conducted in February 2009. It compares the adoption numbers of several communication and serialization technologies, including WCF, in Silverlight 2 applications as well as provides basic analysis of backend service technology. &lt;/p&gt;  &lt;p&gt;Tomasz Janczuk   &lt;br /&gt;Development Manager    &lt;br /&gt;WCF Team&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9827845" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author></entry><entry><title>Improving the performance of web services in SL3 Beta</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/06/07/improving-the-performance-of-web-services-in-sl3-beta.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/06/07/improving-the-performance-of-web-services-in-sl3-beta.aspx</id><published>2009-06-08T06:30:04Z</published><updated>2009-06-08T06:30:04Z</updated><content type="html">&lt;p&gt;Silverlight 3 Beta introduces a new way to improve the performance of web services. You have all probably used the &lt;em&gt;Silverlight-enabled WCF Service&lt;/em&gt; item template in Visual Studio to create a WCF web service, and then used the &lt;em&gt;Add Service Reference&lt;/em&gt; command in your Silverlight application project in order to access the web service. In SL3, the item template has undergone a small change that turns on the new &lt;strong&gt;binary message encoder&lt;/strong&gt;, which significantly improves the performance of the WCF services you build. Note that this is the same binary encoder which has been available in .Net since the release of WCF, so all WCF developers will find the object model very familiar.&lt;/p&gt;  &lt;p&gt; The best part is that this is done entirely in the service configuration file (&lt;em&gt;Web.config&lt;/em&gt;) and does not affect the way you use the service. (Check out &lt;a href="http://blogs.msdn.com/silverlightws/archive/2009/03/20/what-s-new-with-web-services-in-silverlight-3-beta.aspx"&gt;this post&lt;/a&gt; for a brief description of exactly what the change is.)&lt;/p&gt;  &lt;p&gt;I wanted to share some data that shows exactly how noticeable this performance improvement is, and perhaps convince some of you to consider migrating your apps from SL2 to SL3. &lt;/p&gt;  &lt;p&gt;When Silverlight applications use web services, XML-based messages (in the SOAP format) are being exchanged. In SL2, those messages were always encoded as plain text when being transmitted; you could open a HTTP traffic logger and you would be able to read the messages. However using plain text is far from being a compact encoding when sending across the wire, and far from being fast when decoding on the server side. When we use the binary encoder, the messages are encoded using a WCF binary encoding, which provides two main advantages: increased server throughput and decreased message size.&amp;#160; &lt;/p&gt;  &lt;h3&gt;Increased server throughput&lt;/h3&gt;  &lt;p&gt;Let’s examine the following graph (hat tip to &lt;a title="Greg Leake&amp;#39;s blog" href="http://blogs.msdn.com/gregleak/"&gt;Greg Leake&lt;/a&gt; of &lt;a title="StockTrader website" href="http://msdn.microsoft.com/stocktrader"&gt;StockTrader&lt;/a&gt; fame for collecting this data). Here is the scenario we measure: the client sends a payload, the server receives it and sends it back to the client. Many clients are used to load the service up to its peak throughput. We run the test once using the text-based encoding and once using the new binary encoding and compare the peak throughput at the sever. We do this for 2 message sizes: in the smaller size the payload an array with 20 objects, and in the bigger one the payload is an array with 100 objects.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Some more details for the curious: &lt;/strong&gt;The service is configured to ensure no throttling is happening, and a new instance of the service is created for every client call (known as PerCall instancing). There are ten physical clients driving load, each running many threads hitting service in tight loop (but with small 0.1 second think time between requests) using a shared channel to reduce client load. The graph measures peak throughput on the service at 100% CPU saturation. Note that in this test we did not use Silverlight clients but regular .Net clients. Since we are measuring &lt;em&gt;server throughput&lt;/em&gt; it is not significant what the clients are. &lt;/p&gt;  &lt;p&gt;&lt;img src="http://blogs.msdn.com/photos/silverlightws/images/9703322/original.aspx" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;When sending the smaller message we see a &lt;strong&gt;24% increase in server throughput&lt;/strong&gt;, and with the larger message size we see a &lt;strong&gt;71% increase in server throughput&lt;/strong&gt;. As the message complexity continues to grow, we should see even more significant gains from using the binary encoder.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What does that mean to you?&lt;/strong&gt; If you run a service that is being used by Silverlight clients and you exchange non-trivial messages, you can support significantly more clients if the clients use SL3’s binary encoding. As usage of your service increases, that could mean being able to save on buying and deploying extra servers.&lt;/p&gt;  &lt;h3&gt;Decreased message size&lt;/h3&gt;  &lt;p&gt;Another feature of the binary encoder is that since messages sent on the wire are no longer plain-text, you will see a reduction in their average size. Let’s clarify this point: the main reason you would use the binary encoding is to increase the service throughput, as discussed in the previous section. The decrease in message size is a nice side-effect, but let’s face it: you can accomplish the same effect by turning on compression on the HTTP level.&lt;/p&gt;  &lt;p&gt;This test was far less comprehensive than the previous one and we did it ad-hoc on my co-worker’s office machine. We took various objects inside a Silverlight control, and turned them into the same kind of SOAP messages that get sent to the service. We did this using the plain-text encoding and using binary encoding and then we compared the size of the messages in bytes. Here are our results:&lt;/p&gt;  &lt;p&gt;&lt;img src="http://blogs.msdn.com/photos/silverlightws/images/9703323/original.aspx" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;The takeaway here is that the reduction of message size depends on the nature of the payload: sending large instances of system types (for example a long String) will result in a modest reduction, but &lt;strong&gt;the largest gains occur when complex object graphs are being encoded &lt;/strong&gt;(for example objects with many members, or arrays).&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;What does this mean to you?&lt;/strong&gt; If you run a web service and you pay your ISP for the traffic your service generates, using binary encoding will reduce the size of messages on the wire, and hopefully lower your bandwidth bills as traffic to your service increases.&lt;/p&gt;  &lt;h3&gt;Conclusion&lt;/h3&gt;  &lt;p&gt;We are confident that binary encoding is the right choice for most &lt;strong&gt;backend WCF service&lt;/strong&gt; scenarios: you should never see a regression over text encoding when it comes to server throughput or message size; hopefully you will see performance gains in most cases. This is why the binary encoder is the new default in the &lt;em&gt;Silverlight-enabled WCF Service&lt;/em&gt; item template in Visual Studio.&lt;/p&gt;  &lt;p&gt;An important note: binary encoding is only supported by WCF services and clients, and so it is not the right choice if you aren’t using WCF end-to-end. If your service needs to be accessed by non-WCF clients, using binary encoding may not be possible. The binary AMF encoding used by Adobe Flex is similarly restricted to services that support it.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9707403" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/silverlightws/archive/tags/wcf/default.aspx" /><category term="soap" scheme="http://blogs.msdn.com/silverlightws/archive/tags/soap/default.aspx" /><category term="binary" scheme="http://blogs.msdn.com/silverlightws/archive/tags/binary/default.aspx" /><category term="performance" scheme="http://blogs.msdn.com/silverlightws/archive/tags/performance/default.aspx" /></entry><entry><title>Check us out at TechEd North America 2009</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/04/20/check-us-out-at-teched-north-america-2009.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/04/20/check-us-out-at-teched-north-america-2009.aspx</id><published>2009-04-20T10:32:01Z</published><updated>2009-04-20T10:32:01Z</updated><content type="html">&lt;p&gt;I hope you enjoy the content we post on this blog. I’ll be giving a talk at the upcoming TechEd conference in LA, going through some Silverlight 3 content similar to what we have been posting here. If you’re attending TechEd, check out:&lt;/p&gt;  &lt;blockquote&gt;   &lt;h4&gt;SOA03-INT Interacting with Web Services Using Microsoft Silverlight&lt;/h4&gt;    &lt;p&gt;Yavor Georgiev      &lt;br /&gt;Tue 5/12 | 4:30 PM-5:45 PM | Blue Theater 2       &lt;br /&gt;300 - Advanced, Middle Tier Platform and Tools, SOA and Business Processes, TLC Interactive Theater&lt;/p&gt;    &lt;p&gt;Learn how easy it is to utilize POX, REST, RSS, ATOM, JSON, and SOAP services in your Silverlight 2 mash-up application. Hear best practices for developing and consuming secure services within and across domain boundaries. Experience new features in the upcoming Silverlight 3 release including optimized binary communication format, improved support for server- to-client &amp;quot;push&amp;quot; scenarios and new security features.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;If you have not registered, you still have the opportunity to do so:&lt;/p&gt;  &lt;p&gt;&lt;a title="Register for TechEd 09" href="http://www.msteched.com/teched/registration-info.aspx"&gt;&lt;img border="0" src="http://www.msteched.com/teched/img/badges/speaker/TENA_blgr2_seeme.gif" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;If you do attend, make sure you let me know you’re a reader of our blog… I’d love to hear any feedback you have.&lt;/p&gt;  &lt;p&gt;Cheers,    &lt;br /&gt;-Yavor&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9556345" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="presentations" scheme="http://blogs.msdn.com/silverlightws/archive/tags/presentations/default.aspx" /><category term="teched" scheme="http://blogs.msdn.com/silverlightws/archive/tags/teched/default.aspx" /></entry><entry><title>Using WCF services from Silverlight in Azure</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/04/08/using-wcf-services-from-silverlight-in-azure.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/04/08/using-wcf-services-from-silverlight-in-azure.aspx</id><published>2009-04-09T02:15:00Z</published><updated>2009-04-09T02:15:00Z</updated><content type="html">&lt;P&gt;With all the buzz around &lt;A title="Windows Azure" href="http://www.microsoft.com/azure/windowsazure.mspx" mce_href="http://www.microsoft.com/azure/windowsazure.mspx"&gt;Windows Azure&lt;/A&gt;, you may have wondered how to host your Silverlight application in the cloud. Since Silverlight controls are essentially static content, hosting them is as easy as uploading some files to the cloud.&lt;/P&gt;
&lt;P&gt;When it comes to building WCF services to provide data to your Silverlight control, the story gets a little more complicated. The fact that the Azure cloud is a load-balanced environment as well as the deployment mechanism for setting up a service in Azure pose some unique challenges to hosting WCF services.&lt;/P&gt;
&lt;P&gt;To help with this, our team has posted &lt;A title="WCF Azure Code Gallery Site" href="http://code.msdn.com/wcfazure" mce_href="http://code.msdn.com/wcfazure"&gt;&lt;STRONG&gt;a Code Gallery site with 3 Silverlight-specific samples&lt;/STRONG&gt;&lt;/A&gt;&lt;STRONG&gt; &lt;/STRONG&gt;that you can run in the cloud and also on your local machine. The samples exercise the following features:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Sample #2: &lt;A title="Service using binary HTTP binding and Silverlight client" href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=SilverlightCalculator&amp;amp;referringTitle=Home" mce_href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=SilverlightCalculator&amp;amp;referringTitle=Home"&gt;binary encoding&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;Sample #4: &lt;A title="Service using binary HTTP binding with transport security and message credentials and Silverlight client" href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=SecureCalculator&amp;amp;referringTitle=Home" mce_href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=SecureCalculator&amp;amp;referringTitle=Home"&gt;message credentials authentication over HTTPS&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;Sample #5: &lt;A title="Chat service which can push data to Silverlight clients" href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=SilverlightChat&amp;amp;referringTitle=Home" mce_href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=SilverlightChat&amp;amp;referringTitle=Home"&gt;duplex (server “push”)&lt;/A&gt; &lt;/LI&gt;&lt;/UL&gt;The third example hosts our &lt;A title="Silverlight Duplex Chat" href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;amp;DownloadId=5150" mce_href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;amp;DownloadId=5150"&gt;chat sample&lt;/A&gt; in Azure for a &lt;STRONG&gt;massively-distributed free-for-all chat experience&lt;/STRONG&gt;, and you can &lt;A title="Silverlight Duplex Chat Demo" href="http://wcfazure.cloudapp.net/SilverlightChat/SilverlightClientTestPage.html" mce_href="http://wcfazure.cloudapp.net/SilverlightChat/SilverlightClientTestPage.html"&gt;try it here&lt;/A&gt;. Try opening up this link across multiple machines and browsers and watch them all chat together. 
&lt;P&gt;Which brings me to probably the most useful thing we published: a &lt;STRONG&gt;list of known issues with hosting WCF services and Silverlight clients&lt;/STRONG&gt; in Azure. Check out &lt;A title="WCF Azure Known Issues" href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues&amp;amp;referringTitle=Home" mce_href="http://code.msdn.microsoft.com/wcfazure/Wiki/View.aspx?title=KnownIssues&amp;amp;referringTitle=Home"&gt;this page&lt;/A&gt;, and especially the sections “Hosting WCF Services” and “Hosting Silverlight Clients”. The page contains some workarounds we gathered from across the web, and is guaranteed to save you a bunch of head-scratching if you try WCF on Azure for yourself.&lt;/P&gt;
&lt;P&gt;Cheers, &lt;BR&gt;-Yavor&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9539140" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/silverlightws/archive/tags/wcf/default.aspx" /><category term="silverlight" scheme="http://blogs.msdn.com/silverlightws/archive/tags/silverlight/default.aspx" /><category term="samples" scheme="http://blogs.msdn.com/silverlightws/archive/tags/samples/default.aspx" /><category term="duplex" scheme="http://blogs.msdn.com/silverlightws/archive/tags/duplex/default.aspx" /><category term="binary" scheme="http://blogs.msdn.com/silverlightws/archive/tags/binary/default.aspx" /><category term="azure" scheme="http://blogs.msdn.com/silverlightws/archive/tags/azure/default.aspx" /></entry><entry><title>Some known issues in SL3 Beta</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/04/05/some-known-issues-in-sl3-beta.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/04/05/some-known-issues-in-sl3-beta.aspx</id><published>2009-04-06T08:21:00Z</published><updated>2009-04-06T08:21:00Z</updated><content type="html">&lt;P&gt;We've run across some issues with our web services features in the Silverlight 3 Beta and I want to share these here to hopefully save folks some time and frustration.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt; On Windows 7 Beta, you might encounter the following error when generating a proxy: "The element 'httpTransport' cannot contain child element 'extendedProtectionPolicy' because the parent element's content model is empty".&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Workaround:&lt;/STRONG&gt; On Windows 7, when you use the &lt;STRONG&gt;Silverlight-enabled WCF Service&lt;/STRONG&gt; item template, an &amp;lt;extendedProtectionPolicy /&amp;gt; element may be generated in Web.config. This element is not supported by Silverlight. Simply remove the element from Web.config and try regenerating the Silverlight proxy.&lt;/P&gt;
&lt;HR&gt;

&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Issue: &lt;/STRONG&gt;If you use the &lt;STRONG&gt;Silverlight-enabled WCF Service&lt;/STRONG&gt; template and you try generating a Silverlight proxy using &lt;STRONG&gt;Add Service Reference&lt;/STRONG&gt; on a machine with &lt;U&gt;both&lt;/U&gt; Silverlight 2 and Silverlight 3 Beta SDKs, you may get warnings at proxy generation time and errors at runtime. The warnings can include a variety of "Cusom tool" warnings which state that the endpoints found are "not compatible with Silverlight 2" or "No endpoints compatible with Silverlight 2 were found."&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Workaround:&lt;/STRONG&gt; If you are using &lt;STRONG&gt;Add Service Reference &lt;/STRONG&gt;to generate proxies, side-by-side installation of the Silverlight 2 and Silverlight 3 Beta SDKs is not supported. Please uninstall the Silverlight 2 SDK to use Silverlight 3 features. After uninstalling, ensure that the assembly Microsoft.Silverlight.ServiceReference is &lt;U&gt;not&lt;/U&gt; present in the machine GAC. &lt;/P&gt;
&lt;HR&gt;

&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Issue:&lt;/STRONG&gt; When using &lt;STRONG&gt;Add Service Reference&lt;/STRONG&gt; to generate a proxy to a WCF duplex service (a service built with the System.ServiceModel.PollingDuplex.dll assembly provided in the Silverlight SDK), the generated proxy may not compile and may complain about a missing assembly reference.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;STRONG&gt;Workaround: &lt;/STRONG&gt;The proxy for the duplex service is generated correctly, however &lt;STRONG&gt;Add Service Reference &lt;/STRONG&gt;will sometimes forget to reference th &lt;STRONG&gt;System.ServiceModel.PollingDuplex.dll &lt;/STRONG&gt;assembly in the Silverlight client. Simply add a reference to the assembly (right-click in the Silverlight project, select &lt;STRONG&gt;Add Reference&lt;/STRONG&gt;, find the assembly in the list on the &lt;STRONG&gt;.Net&lt;/STRONG&gt; tab), and the proxy should now compile.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Hope this is helpful!&lt;BR&gt;-Yavor Georgiev&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9534200" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="debugging" scheme="http://blogs.msdn.com/silverlightws/archive/tags/debugging/default.aspx" /><category term="duplex" scheme="http://blogs.msdn.com/silverlightws/archive/tags/duplex/default.aspx" /><category term="tools" scheme="http://blogs.msdn.com/silverlightws/archive/tags/tools/default.aspx" /><category term="bugs" scheme="http://blogs.msdn.com/silverlightws/archive/tags/bugs/default.aspx" /></entry><entry><title>What's new with web services in Silverlight 3 Beta</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/03/20/what-s-new-with-web-services-in-silverlight-3-beta.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/03/20/what-s-new-with-web-services-in-silverlight-3-beta.aspx</id><published>2009-03-20T13:18:00Z</published><updated>2009-03-20T13:18:00Z</updated><content type="html">&lt;P&gt;Silverlight 3 beta comes with a set of exciting web services features that address key customer requests.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Binary message encoding&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In Silverlight 2 the only supported binding was BasicHttpBinding, which encodes outgoing messages as text and sends them over an HTTP transport. This binding is great for interoperability with SOAP 1.1 services and is also easily debuggable since messages can be viewed in plain text on the wire using HTTP debugging tools such as &lt;A title="Fiddler HTTP debugger" href="http://www.fiddlertool.com/" mce_href="http://www.fiddlertool.com/"&gt;Fiddler&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;However as Silverlight applications go into production and grow to scale, service developers start getting concerned with the cost of hosting services. Two things in particular that we are about:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Increased server throughput&lt;/STRONG&gt; - more clients can be&amp;nbsp;connected to a&amp;nbsp;server, which means fewer servers need to be purchased.&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Decreased message size&lt;/STRONG&gt; - smaller message sizes exchanged on the wire means lower bandwidth bills&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Silverlight 3 introduces a binary message encoder, which produces significant improvements in both of the above indicators. A follow-up post is coming with some specific data on the improvements that can be expected.&lt;/P&gt;
&lt;P&gt;Binary encoding is implemented as a custom binding, there is no out-of-the-box binary binding. &lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"&gt;&amp;lt;bindings&amp;gt;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;customBinding&amp;gt;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;binding name="binaryHttpBinding"&amp;gt;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;binaryMessageEncoding /&amp;gt;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;httpTransport /&amp;gt;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/binding&amp;gt;&lt;BR&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&amp;lt;/customBinding&amp;gt;&lt;BR&gt;&amp;lt;/bindings&amp;gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"&gt;&amp;lt;endpoint address="" binding="customBinding" bindingConfiguration="binaryHttpBinding"&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;contract="Service" /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;
&lt;P&gt;The BinaryMessageEncodingBindingElement can be used as part of any custom binding and so it composes easily to create things like a binary duplex binding.&lt;/P&gt;
&lt;P&gt;The binary encoder offers performance gains over the text encoder, and there should never be any regressions. This is why binary is the new default in backend service scenarios, such as where the &lt;STRONG&gt;Silverlight-enabled WCF Service&lt;/STRONG&gt; item template is used. Therefore the template has been modified to use binary. The interop cases is where binary should not be used (if the client is talking to a non-WCF service), since binary is a WCF-specific encoding: please continue to use BasicHttpBinding with text encoding in those scenarios (for example accessing ASMX services).&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Duplex object model simplification&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Duplex is an innovative Silverlight 2 feature which allows the service to send data to the client without the client manually polling for the data ("smart" polling still occurs on the network layer, but the user does not need to know).&amp;nbsp;However there were two significant limitations in the Silverlight&amp;nbsp;2 duplex&amp;nbsp;object model:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Channel programming had to be used and&lt;/LI&gt;
&lt;LI&gt;Serialization was not supported so a Message programming model had to be used.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Silverlight 3 lifts these restrictions and introduces &lt;STRONG&gt;Add Service Reference support for duplex services&lt;/STRONG&gt;.&amp;nbsp;Familiar-looking proxies are now generated, greatly reducing&amp;nbsp;the amount of&amp;nbsp;Silverlight code that is needed to access a duplex service. A simple stock ticker client implementation, which previously took 203 lines of code, &lt;STRONG&gt;can now be reduced to a mere 48 lines of code, a 76% reduction in code size.&lt;/STRONG&gt; Not to mention that the channel-based code was complex and very error-prone due to its use of async patterns. Here is a snippet showing the crux of the new object model, in the context of the stock ticker example:&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;private&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Button_Click(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, System.Windows.RoutedEventArgs e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;ServiceClient proxy = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ServiceClient(binding, address);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;proxy.ReceiveCallbackCompleted += &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;EventHandler&lt;/SPAN&gt;&amp;lt;ReceiveCallbackCompletedEventArgs&amp;gt;(proxy_ReceiveCallbackCompleted);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;proxy.StartAsync(symbol.Text);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; COLOR: blue; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;void&lt;/SPAN&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt; proxy_ReceiveCallbackCompleted(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; sender, ReceiveCallbackCompletedEventArgs e)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (e.Error == &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;price.Text = e.price.ToString();&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="LINE-HEIGHT: normal; MARGIN: 0in 0in 0pt; mso-layout-grid-align: none" class=MsoNormal&gt;&lt;SPAN style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0in 0in 10pt" class=MsoNormal&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;SPAN style="LINE-HEIGHT: 115%; FONT-SIZE: 9pt"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;
&lt;P&gt;Note that receiving the callback from the server is now just a matter of attaching a callback to an event. Also note the fact that we are working with CLR types and not Message objects, so serialization is now enabled. We have updated &lt;A title="Duplex documentation" href="http://msdn.microsoft.com/en-us/library/dd470105(VS.96).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd470105(VS.96).aspx"&gt;our documentation&lt;/A&gt; with&amp;nbsp;a walkthrough of how to use the new object model. In addition, &lt;A title="Duplex chat server" href="http://code.msdn.microsoft.com/silverlightws/Release/ProjectReleases.aspx?ReleaseId=2401" mce_href="http://code.msdn.microsoft.com/silverlightws/Release/ProjectReleases.aspx?ReleaseId=2401"&gt;Eugene's duplex chat server implementation&lt;/A&gt;, which has proven very popular, has also been updated with the new OM.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Faults support&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In Silverlight 2 if an unexpected exception occurred in the service, the fault would not be propagated to the Silverlight client. Instead of getting&amp;nbsp;the exception propagated to the user,&amp;nbsp;Silverlight would throw an unhelpful&amp;nbsp;&lt;STRONG&gt;CommunicationException&lt;/STRONG&gt; which carries no useful information.&amp;nbsp;There were two reasons for this: (1) faults are returned with a 500 status code, and the browser networking stack prevents Silverlight from reading the body of such a response, and (2) Silverlight did not support he necessary client-side logic to convert the fault message into an exception that can be surfaced to the user. These limitation made it very difficult to debug services from Silverlight. &lt;/P&gt;
&lt;P&gt;In Silverlight 3 Beta&amp;nbsp;limitation (1) is unfortunately still present.&amp;nbsp;To work around this issue&amp;nbsp;&lt;A title="Faults documentation" href="http://msdn.microsoft.com/en-us/library/dd470096(VS.96).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd470096(VS.96).aspx"&gt;our documentation&lt;/A&gt;&amp;nbsp;provides a WCF endpoint behavior, which can be applied to your WCF service to switch the response code from 500 to 200. With this response code the message will be accessible to Silverlight and we can address limitation (2). In Silverlight 3, we have added the necessary client-side OM to surface faults to the user. Look out for helpful &lt;STRONG&gt;FaultException &lt;/STRONG&gt;and &lt;STRONG&gt;FaultException&amp;lt;ExceptionDetail&amp;gt; &lt;/STRONG&gt;exceptions which will help you debug your service. Also please see the documentation page linked earlier for a full description of the faults object model in Silverlight.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;New security mode&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;A common scheme used to secure services for use by Silverlight clients is browser-based authentication. However browser-based authetnication is not safe to use if your service is accessible from any domain via a cross-domain policy file. This would expose your service to &lt;A title="Cross Site Request Forgery" href="http://en.wikipedia.org/wiki/Cross-site_request_forgery" mce_href="http://en.wikipedia.org/wiki/Cross-site_request_forgery"&gt;CSRF&lt;/A&gt; type attacks, where cached browser credentials can be used by malicious apps to access your sercure service without the user's knowledge. &lt;/P&gt;
&lt;P&gt;Silverlight 3 introduces a new security mode called &lt;STRONG&gt;TransportSecurityWithMessageCredential &lt;/STRONG&gt;to address this configuration. In this mode, the credentials are included in every outgoing message to the service, and the service verifies those credentials on the SOAP layer. However since the credentials are in plain text inside the message the transport needs to be secure so we use HTTPS.&lt;/P&gt;
&lt;P&gt;A more detailed walktrhough of valid Silverlight security configurations will follow.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Command-line proxy generation&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;In Silverlight 2 &lt;STRONG&gt;Add Service Reference &lt;/STRONG&gt;as part of Visual Studio is the only way to generate proxies for Silverlight clients. In Silverlight 3 we are introducing a command-line tool called &lt;STRONG&gt;slsvcutil.exe&lt;/STRONG&gt;, which allows customized command-line proxy generation. Using the tool, proxies can now be generated as part of your build process for greater robustness. The slsvcutil.exe tool is fully described in this &lt;A title="slsvcutil.exe documentation" href="http://msdn.microsoft.com/en-us/library/dd470117(VS.96).aspx" mce_href="http://msdn.microsoft.com/en-us/library/dd470117(VS.96).aspx"&gt;documentation topic&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Thanks for reading through this, and please stay tuned for some in-depth posts about these new features.&lt;/P&gt;
&lt;P&gt;Yavor Georgiev&lt;BR&gt;Program Manager, Silverlight Web Services Team&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9492252" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="mix" scheme="http://blogs.msdn.com/silverlightws/archive/tags/mix/default.aspx" /><category term="samples" scheme="http://blogs.msdn.com/silverlightws/archive/tags/samples/default.aspx" /><category term="soap" scheme="http://blogs.msdn.com/silverlightws/archive/tags/soap/default.aspx" /><category term="duplex" scheme="http://blogs.msdn.com/silverlightws/archive/tags/duplex/default.aspx" /><category term="security" scheme="http://blogs.msdn.com/silverlightws/archive/tags/security/default.aspx" /><category term="binary" scheme="http://blogs.msdn.com/silverlightws/archive/tags/binary/default.aspx" /><category term="faults" scheme="http://blogs.msdn.com/silverlightws/archive/tags/faults/default.aspx" /><category term="slsvcutil" scheme="http://blogs.msdn.com/silverlightws/archive/tags/slsvcutil/default.aspx" /></entry><entry><title>Some new features for REST services</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2009/03/13/some-new-features-for-rest-services.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2009/03/13/some-new-features-for-rest-services.aspx</id><published>2009-03-13T20:04:00Z</published><updated>2009-03-13T20:04:00Z</updated><content type="html">&lt;P&gt;Just a quick announcement here of a release that will be interesting to SL developers who want to access REST services. The &lt;STRONG&gt;WCF REST Starter Kit Preview 2&lt;/STRONG&gt; is now out, go grab it at &lt;A href="http://msdn.com/wcf/rest"&gt;http://msdn.com/wcf/rest&lt;/A&gt;. The release gives you a polished install/uninstall experience, so don't be afraid to try it on your box, it won't muck it up like "preview" software so frequently does.&lt;/P&gt;
&lt;P&gt;This release gives you one interesting client-side feature that you may have heard me or &lt;A title="Eugene's blog" href="http://eugeneos.blogspot.com/" mce_href="http://eugeneos.blogspot.com/"&gt;Eugene&lt;/A&gt; speak about: &lt;STRONG&gt;Paste XML as Types&lt;/STRONG&gt;. It's a VS menu item which helps you use &lt;STRONG&gt;XmlSerializer&lt;/STRONG&gt; with REST services. Frequently these services use human-readable documentation to describe the XML shape, and it is difficult to &lt;STRONG&gt;hand-code &lt;/STRONG&gt;a type to use with &lt;STRONG&gt;XmlSerializer&lt;/STRONG&gt;, especially when the XML instance is complex. For example check out this &lt;A title="XML example from Yahoo BOSS" href="http://developer.yahoo.com/search/boss/boss_guide/Web_Search.html#id311445" mce_href="http://developer.yahoo.com/search/boss/boss_guide/Web_Search.html#id311445"&gt;sample XML response &lt;/A&gt;from the Yahoo BOSS API. With this new feature it takes&lt;STRONG&gt; one click&lt;/STRONG&gt; to generate the type:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="WIDTH: 679px; HEIGHT: 527px" title="Using Paste XML as Types with Yahoo BOSS API" alt="Using Paste XML as Types with Yahoo BOSS API" src="http://blogs.msdn.com/photos/silverlightws/images/9473440/original.aspx" width=679 height=527 mce_src="http://blogs.msdn.com/photos/silverlightws/images/9473440/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;Another interesting feature in the release is &lt;STRONG&gt;HttpClient &lt;/STRONG&gt;- a sort of specialized WebClient&amp;nbsp;- which can be used to programmatically access REST services using an extensible model for sending HTTP requests and processing HTTP responses. The model enables you to complete common HTTP/REST development activities required to consume an existing service in a fraction of the time you normally spend. Some convenient time-savers include query string support (build URIs as name/value pairs) and&amp;nbsp;serialization support (easily plug in types generated with &lt;STRONG&gt;Paste XML as Types &lt;/STRONG&gt;to read the response). &lt;/P&gt;
&lt;P&gt;Unfortunately in this release the starter kit &lt;STRONG&gt;only contains a .Net version of HttpClient&lt;/STRONG&gt;, which will &lt;U&gt;not&lt;/U&gt; compile in Silverlight. We are considering porting this prototype to Silverilght, and if you get a chance to try it&amp;nbsp;on .Net, please let us know of any feedback&amp;nbsp;you have.&lt;/P&gt;
&lt;P&gt;Stay tuned for some exciting content coming out over the next week!&lt;/P&gt;
&lt;P&gt;Cheers,&lt;BR&gt;-Yavor&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9473462" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="pox" scheme="http://blogs.msdn.com/silverlightws/archive/tags/pox/default.aspx" /><category term="tools" scheme="http://blogs.msdn.com/silverlightws/archive/tags/tools/default.aspx" /><category term="rest" scheme="http://blogs.msdn.com/silverlightws/archive/tags/rest/default.aspx" /></entry><entry><title>New Web Services Features in Silverlight 2 RTW</title><link rel="alternate" type="text/html" href="http://blogs.msdn.com/silverlightws/archive/2008/10/20/new-web-services-features-in-sl2-rtw.aspx" /><id>http://blogs.msdn.com/silverlightws/archive/2008/10/20/new-web-services-features-in-sl2-rtw.aspx</id><published>2008-10-20T16:39:00Z</published><updated>2008-10-20T16:39:00Z</updated><content type="html">&lt;P&gt;Here is an overview of the new features added since Beta 2.&lt;/P&gt;
&lt;H3&gt;SOAP Headers&lt;/H3&gt;
&lt;P&gt;SOAP headers were a big customer request, so we have added&amp;nbsp;headers support in this release. There are two methods to use headers, depending on the customer scenario.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The &lt;U&gt;easier method&lt;/U&gt; is useful when you need to get/set a header while invoking a single operation on the service.&amp;nbsp;&lt;/STRONG&gt;You can&amp;nbsp;use the&amp;nbsp;&lt;A class="" title="OperationContext class" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext(VS.95).aspx"&gt;OperationContext&lt;/A&gt; class, and specifically the &lt;A class="" title="OperationContext.IncomingMessageHeaders property" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.incomingmessageheaders(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.incomingmessageheaders(VS.95).aspx"&gt;IncomingMessageHeaders&lt;/A&gt; or &lt;A class="" title="OperationContext.OutgoingMessageHeaders property" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.outgoingmessageheaders(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.servicemodel.operationcontext.outgoingmessageheaders(VS.95).aspx"&gt;OutgoingMessageHeaders&lt;/A&gt; property to receive or send a header. Below is a code example where the client sends the header &lt;CODE&gt;&amp;lt;MyClientHeader xmlns="http://silverlight.net"&amp;gt;...&amp;lt;/MyClientHeader&amp;gt;&lt;/CODE&gt; to the service.&lt;/P&gt;&lt;CODE&gt;
&lt;P&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Page()&lt;BR&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Instantiate generated proxy&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1Client&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; proxy = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1Client&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Hook up an event handler when operation completes&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;proxy.DoWorkCompleted += &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EventHandler&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;DoWorkCompletedEventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt;(proxy_DoWorkCompleted);&lt;/FONT&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;OperationContextScope&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ocs = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;OperationContextScope&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(proxy.InnerChannel))&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// We can add "MyClientHeader" SOAP header to the outgoing message. It is important that this comes before calling the operation.&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;OperationContext&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Current.OutgoingMessageHeaders.Add(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;MessageHeader&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.CreateHeader(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"MyClientHeader"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"http://silverlight.net"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"..."&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;));&lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;// Call an operation on the service&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; proxy.DoWorkAsync(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"foo"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;/CODE&gt;Now assume we want to get at a header that the service sent back.&amp;nbsp;In this example, the service sent the &lt;CODE&gt;&amp;lt;MyServiceHeader xmlns="http://silverlight.net"&amp;gt;...&amp;lt;/MyServiceHeader&amp;gt;&lt;/CODE&gt; header to the client. &lt;STRONG&gt;Note: &lt;/STRONG&gt;The old Begin*/End* async pattern needs to be used with &lt;STRONG&gt;OperationContext &lt;/STRONG&gt;&lt;U&gt;if you are retrieving the headers sent in a service reply&lt;/U&gt;. The event-based async pattern (using *Completed&amp;nbsp;event and *Async method) is currently not supported. Also, please be sure to use exact order of calls demonstrated below.&lt;/P&gt;&lt;CODE&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Page()&lt;BR&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Instantiate generated proxy&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Service1Client&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; proxy = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1Client&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;();&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Call an operation on the service using Begin/End async pattern&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;((&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)proxy).BeginDoWork(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"foo"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, doWorkCallback, proxy);&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;
&lt;P&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;// Receive callback when the service responds&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; doWorkCallback(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;IAsyncResult&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; result)&lt;BR&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Service1&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; proxy = (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)result.AsyncState;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;using&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;OperationContextScope&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ocs = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;OperationContextScope&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(((&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1Client&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)proxy).InnerChannel))&amp;nbsp;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=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; &lt;/FONT&gt;// Get the service response. This needs to happen before we access the headers.&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=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; &lt;/FONT&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; response = proxy.EndDoWork(result);&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=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; &lt;/FONT&gt;// Now we can access the headers of the incoming message. In this case we assume the header "MyServiceHeader" was sent by the service.&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=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; &lt;/FONT&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; headerContents = &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;OperationContext&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Current.IncomingMessageHeaders.GetHeader&amp;lt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"MyServiceHeader"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"http://silverlight.net"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;);&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=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; &lt;/FONT&gt;// Do something with response and header&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR&gt;}&lt;/FONT&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;The &lt;U&gt;harder method&lt;/U&gt;&amp;nbsp;can be used when you want to get/set headers upon invoking any operation on the service. &lt;/STRONG&gt;In that case you would have to use &lt;STRONG&gt;OperationContext&lt;/STRONG&gt; every time you call a service operation, which is very clunky. Instead, what would be useful is functionality similar to that provided by WCF message inspectors and the &lt;A class="" title="IClientMessageInspector class" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.servicemodel.dispatcher.iclientmessageinspector.aspx"&gt;IClientMessageInspector&lt;/A&gt; class. Using a client message inspector you can get access to the &lt;A class="" title="Message class" href="http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.message(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.message(VS.95).aspx"&gt;Message&lt;/A&gt; instance just received from or about to be sent to the service, and manipulate the headers directly on the instance. &lt;STRONG&gt;IClientMessageInspector&lt;/STRONG&gt; is not part of SL 2, but &lt;A class="" title="Message Inspectors code sample" href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;amp;DownloadId=3473" mce_href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;amp;DownloadId=3473"&gt;this code sample&lt;/A&gt; demonstrates how to accomplish the same functionality. In the sample, we add a header to every message sent to the service, and the header contains the IP address of the client which is calling the service.&lt;/P&gt;
&lt;H3&gt;SOAP Faults&lt;/H3&gt;
&lt;P&gt;&lt;A class="" title="Eugene's blog" href="http://eugeneos.blogspot.com/" mce_href="http://eugeneos.blogspot.com/"&gt;Eugene&lt;/A&gt; &lt;A class="" title="Eugene on Silverlight SOAP faults" href="http://eugeneos.blogspot.com/2008/09/faults-and-exceptions-when-using-web.html" mce_href="http://eugeneos.blogspot.com/2008/09/faults-and-exceptions-when-using-web.html"&gt;posted about faults&lt;/A&gt; just a couple of weeks back. Faults are another major request but unfortunately they are not supported out of the box in SL 2. However,&amp;nbsp;using the same client message inspectors approach and some extra configuration on the&amp;nbsp;WCF service side,&amp;nbsp;rudimentary faults can&amp;nbsp;be enabled. The &lt;A class="" title="Message Inspectors code sample" href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;amp;DownloadId=3473" mce_href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;amp;DownloadId=3473"&gt;same code sample linked above&lt;/A&gt; demonstrates how to do this. I will put together a more detailed post about the sample in the coming weeks.&lt;/P&gt;
&lt;H3&gt;Reusing existing types in "Add Service Reference"&lt;/H3&gt;
&lt;P&gt;If you use "Add Service Reference" to add a reference to the service in your client, it will by default generate a duplicate of any type used by your service operation. Frequently when developing a WCF service and a Silverlight client, you want to declare your types in only one place. Alternatively, maybe your data contract types contain internal logic that you would like to preserve and that logic is lost when "Add Service Reference" generates the duplicate types in the client.&lt;/P&gt;
&lt;P&gt;&lt;IMG title="Reusing types in Add Service Reference" style="WIDTH: 454px; HEIGHT: 421px" height=421 alt="Reusing types in Add Service Reference" src="http://blogs.msdn.com/photos/silverlightws/images/9001562/original.aspx" width=454 align=absMiddle mce_src="http://blogs.msdn.com/photos/silverlightws/images/9001562/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;To prevent duplicate types from being generated in the client, you would normally declare the data contract types in a new project, which is referenced by both your WCF service and the Silverlight client. Then when adding a reference to the service, you would&amp;nbsp;select the correct option in the "Add Service Reference" dialog. This way "Add Service Reference" would find the types already referenced in the shared project, and not generate duplicates.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt;&amp;nbsp;In Silverlight the shared project that contains the data contract types has to be a "Silverlight Library", which can be referenced by both Silverlight projects and regular desktop framework projects. If the shared project is of any other type, you will not be able to reference it from within a "Silverlight Application" project.&lt;/P&gt;
&lt;P&gt;This option was already there in the Silverlight version of "Add Service Reference", but it did not work up until this release.&lt;/P&gt;
&lt;H3&gt;Duplex Services&lt;/H3&gt;
&lt;P&gt;We have made improvements to the duplex channel shipped in Beta 2:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Client and server side duplex components are now &lt;STRONG&gt;ready for production use&lt;/STRONG&gt;, with improved stability, security, etc. In Beta 2 the server-side duplex component was under an "evaluation" license.&lt;/LI&gt;
&lt;LI&gt;Server-side duplex component may now be &lt;STRONG&gt;hosted in Partial Trust&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Default timeouts and timeout behavior is “smarter”&lt;/STRONG&gt; – no changes should be required for common scenarios&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;In addition, &lt;A class="" title="Eugene's blog" href="http://eugeneos.blogspot.com/" mce_href="http://eugeneos.blogspot.com/"&gt;Eugene&lt;/A&gt; has developed &lt;A class="" title="Duplex Receiver sample" href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;amp;DownloadId=3472" mce_href="http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=silverlightws&amp;amp;DownloadId=3472"&gt;a great sample&lt;/A&gt; on top of the raw duplex channel model, to simplify duplex usage. On the client side you can use the &lt;STRONG&gt;DuplexReceiver &lt;/STRONG&gt;class:&lt;/P&gt;&lt;CODE&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;class&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;DuplexReceiver&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;{&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;// Opens a channel to the service to receive messages using the default PollingDuplexBinding&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; DuplexReceiver(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Uri&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; address, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;IEnumerable&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Type&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt; possibleTypes);&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Opens a channel to the service to receive messages using the default PollingDuplexBinding&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; DuplexReceiver(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EndpointAddress&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; address, &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;IEnumerable&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Type&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt; possibleTypes);&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Sends a message to a Duplex service. (The first time a message is sent, connection will be established to the service).&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; SendMessageAsync(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;object&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; message);&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Event that will be called after a message has been sent&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;event&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EventHandler&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;AsyncCompletedEventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt; SendMessageCompleted;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Event that will be called for each received message&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;event&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EventHandler&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ReceivedMessageEventArgs&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt; MessageReceived;&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Disconnects from a Duplex service (can later reconnect again). To permanently close, first call DisconnectAsync and then call Close&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; DisconnectAsync();&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Closes the Duplex connection&lt;BR&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Close();&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Other methods and properties omitted for brevity...&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;
&lt;P&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;/CODE&gt;
&lt;P&gt;Instead of using the channel model directly, you can use the &lt;STRONG&gt;SendMessageAsync&lt;/STRONG&gt; method to send messages to the service. The &lt;STRONG&gt;MessageReceived&lt;/STRONG&gt; event is fired when the service sends the client a message. Note that the DuplexReceiver contructor takes the list of types that can possibly be sent. The sample also provides a server-side &lt;STRONG&gt;DuplexService&lt;/STRONG&gt; object, which keeps track of connected clients and can relay messages to the correct recipient, or broadcast messages to all clients.&lt;/P&gt;
&lt;H3&gt;Support for ChannelFactory&amp;lt;T&amp;gt;&lt;/H3&gt;
&lt;P&gt;This is an advanced use case: say you want to use a service without generating a proxy to it. Perhaps you are connecting to a complex service and you manually copied over/shared all the contracts and types that the service uses (for example in order to preserve the internal logic of these types). But you never&amp;nbsp;used the&amp;nbsp;"Add Service Reference" wizard so you don't have a proxy class to the service. In this case ChannelFactory&amp;lt;T&amp;gt; can be used to communicate&amp;nbsp;with a service which&amp;nbsp;implements&amp;nbsp;the service contract &amp;lt;T&amp;gt;, as shown&amp;nbsp;below.&amp;nbsp;&lt;/P&gt;&lt;CODE&gt;&lt;FONT size=2&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;public&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Page()&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InitializeComponent();&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;ChannelFactory&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1Channel&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt; factory = &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;ChannelFactory&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;lt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1Channel&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&amp;gt;(&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=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; &lt;/FONT&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;BasicHttpBinding&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(),&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;EndpointAddress&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;FONT color=#a31515 size=2&gt;"http://localhost:49507/Service1.svc"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;));&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Service1Channel&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; channel = factory.CreateChannel();&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; channel.BeginDoWork(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;new&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;AsyncCallback&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;(doWorkCallback), channel);&lt;BR&gt;}&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;void&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; doWorkCallback(&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;IAsyncResult&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; result)&lt;BR&gt;{&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;Service1Channel&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; channel = (&lt;/FONT&gt;&lt;FONT color=#2b91af size=2&gt;&lt;FONT color=#2b91af size=2&gt;Service1Channel&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;)result.AsyncState;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;string&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; response = channel.EndDoWork(result);&lt;/P&gt;
&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;// Do something with response&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;}&lt;/P&gt;&lt;/FONT&gt;&lt;/CODE&gt;
&lt;P&gt;Note that using this approach, the event-based async pattern is not supported.&lt;/P&gt;
&lt;H3&gt;Other&lt;/H3&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Types generated from ADO.NET Entity Data Models (.edmx files)&amp;nbsp;&lt;/STRONG&gt;in WCF services intended for Silverlight consumption are now supported. Just use the type generated from a .edmx model as an argument in&amp;nbsp;a service operation.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Internal types and internal members &lt;/STRONG&gt;may now be serialized by the &lt;A class="" title="DataContractSerializer class" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer(VS.95).aspx"&gt;DataContractSerializer&lt;/A&gt; and the &lt;A class="" title="DataContractJsonSerializer class" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.datacontractjsonserializer(VS.95).aspx"&gt;DataContractJsonSerializer&lt;/A&gt; (on a per-assembly opt-in basis)&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;JSON/XML Mapping&lt;/STRONG&gt; is now supported (through System.Runtime.Serialization.Json.dll in the SDK), by using the &lt;A class="" title="JsonReaderWriterFactory class" href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.jsonreaderwriterfactory(VS.95).aspx" mce_href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.json.jsonreaderwriterfactory(VS.95).aspx"&gt;JsonReaderWriterFactory&lt;/A&gt; class.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;JAXB-style object references &lt;/STRONG&gt;in XML are now supported by &lt;STRONG&gt;DataContractSerializer&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Have fun using our new feature set!&lt;/P&gt;
&lt;P&gt;Yavor Georgiev&lt;BR&gt;Program Manager, Connected Framework Team&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9001471" width="1" height="1"&gt;</content><author><name>SLWSTeam</name><uri>http://blogs.msdn.com/members/SLWSTeam.aspx</uri></author><category term="wcf" scheme="http://blogs.msdn.com/silverlightws/archive/tags/wcf/default.aspx" /><category term="soap" scheme="http://blogs.msdn.com/silverlightws/archive/tags/soap/default.aspx" /><category term="duplex" scheme="http://blogs.msdn.com/silverlightws/archive/tags/duplex/default.aspx" /><category term="tools" scheme="http://blogs.msdn.com/silverlightws/archive/tags/tools/default.aspx" /><category term="channels" scheme="http://blogs.msdn.com/silverlightws/archive/tags/channels/default.aspx" /></entry></feed>