{"id":1673,"date":"2009-09-03T21:09:00","date_gmt":"2009-09-03T21:09:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/odatateam\/2009\/09\/03\/using-the-ado-net-data-services-silverlight-client-in-x-domain-and-out-of-browser-scenarios-i\/"},"modified":"2018-09-04T18:02:42","modified_gmt":"2018-09-04T18:02:42","slug":"using-the-ado-net-data-services-silverlight-client-in-x-domain-and-out-of-browser-scenarios-i","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/odata\/using-the-ado-net-data-services-silverlight-client-in-x-domain-and-out-of-browser-scenarios-i\/","title":{"rendered":"Using the ADO.NET Data Services Silverlight client in x-domain and out of browser scenarios \u2013 I"},"content":{"rendered":"<p>With the release of <a href=\"http:\/\/blogs.msdn.com\/astoriateam\/archive\/2009\/08\/31\/ado-net-data-services-v1-5-ctp2-now-available-for-download.aspx\">ADO.NET Data Services v1.5 CTP2<\/a>, you can now use the Silverlight Astoria client library to access Cross-Domain services     <br \/>and applications written with the new client library can go out of browser. <\/p>\n<p>The new Client Http networking stack introduced in SL3 supports the standard and custom HTTP Verbs(GET\/PUT\/POST\/DELETE\/MERGE)    <br \/>as well as access to the response status codes required for a full fidelity REST-based client experience in Silverlight.     <br \/>Working with the SL networking team, we modified the Astoria client library to use the networking stack     <br \/>in cross-domain and out-of-browser scenarios.     <br \/>With this change, we are now able to support Cross-Domain calls allowed by <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/cc645032(VS.95).aspx\">ClientAccessPolicy.xml<\/a> files     <br \/>and applications written with the Silverlight Astoria client library can go Out Of Browser. <\/p>\n<h5>I have an existing SL app based on the Astoria client library , what do I need to do to enable my application to    <br \/>access X-Domain Data Services and go Out Of Browser ?<\/h5>\n<p>1. Recompile your application with a reference to the new Silverlight client library .    <br \/>2. Update the URI of the Data Service to point to the absolute URI of the Data Service in its new location.     <br \/>3. Drop a <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/cc645032(VS.95).aspx\">ClientAccessPolicy.xml<\/a> file into the root of the Webserver Hosting your Data Service.     <br \/>4. Deploy the newly created application to the Webserver.     <br \/>5. In your Silverlight application code, find all the places that you call EndExecute\/EndSaveChanges\/EndExecuteBatch     <br \/>and check if the call is being marshaled back to the UI thread , else Silverlight will throw an invalid Cross-Thread Access Exception.     <br \/>To fix this, always dispatch the call to EndExecute to the UI thread using Dispatcher.BeginInvoke.     <br \/>As an example: <\/p>\n<pre class=\"csharpcode\">nwContext.BeginExecute&lt;Customers&gt;(<span class=\"kwrd\">new<\/span> Uri(<span class=\"str\">&quot;Customers&quot;<\/span>),\n(asResult) =&gt;\n{\n Dispatcher.BeginInvoke(\n   () =&gt;{\n   CustomersGrid.ItemsSource = nwContext.EndExecute&lt;Customers&gt;(asResult).ToList();\n   }\n   );                     \n}, someUserState);<\/pre>\n<p>.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/p>\n<p>Now , let\u2019s walk through a demo application that illustrates how to build a Silverlight application \n  <br \/>that accesses an ADO.NET Data Service from a different domain than the Silverlight application and can also run Out-Of-Browser.<\/p>\n<p>We have a sample Silverlight application that looks like this :<\/p>\n<p>Now , let\u2019s walk through a demo application that illustrates how to build a Silverlight application \n  <br \/>that accesses an ADO.NET Data Service from a different domain than the Silverlight application and can also run Out-Of-Browser.<\/p>\n<p>We have a sample Silverlight application that looks like this :<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image002_2.gif\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"clip_image002\" border=\"0\" alt=\"clip_image002\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2009\/09\/clip_image002_thumb.gif\" width=\"393\" height=\"160\" \/><\/a><\/p>\n<p>1. SilverlightApplicationHost is the Web application hosting your Silverlight XAP , think of this as UI.Foo.Com. \n  <br \/>2. DataServiceHost is the web application hosting the ADO.NET Data Service , think of this as API.Foo.Com <\/p>\n<p>3. DataServicesXDomainSLClient is the Silverlight application that runs in UI.Foo.Com and consumes the Data Service from API.Foo.Com.<\/p>\n<p>Since the DataServiceHost site hosts the Data Service, it also hosts the ClientAccessPolicy.xml file which allows apps from the \n  <br \/>domain hosting the Silverlight app to access resources hosted at API.Foo.com<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image002%5B8%5D.gif\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"clip_image002[8]\" border=\"0\" alt=\"clip_image002[8]\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2009\/09\/clip_image0025B85D_thumb.gif\" width=\"367\" height=\"300\" \/><\/a><\/p>\n<p>The Silverlight application, DataServicesXDomainSLClient, has a Service Reference to the Data Service hosted at DataServiceHost. \n  <br \/>It has two buttons which download an Entity Set called \u201cPublications\u201d from the Data Service and looks like this.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image001_2.jpg\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"clip_image001\" border=\"0\" alt=\"clip_image001\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2009\/09\/clip_image001_thumb.jpg\" width=\"588\" height=\"480\" \/><\/a><\/p>\n<p>The \u201cLoad Publications Via Uri\u201d downloads Entities from the \u201cPublications\u201d entity set and the Click handler looks like this : <\/p>\n<pre class=\"csharpcode\"><span class=\"kwrd\">void<\/span> btnLoadPublications_Click(<span class=\"kwrd\">object<\/span> sender, RoutedEventArgs e)\n{\n<span class=\"kwrd\">object<\/span> userState = <span class=\"kwrd\">null<\/span>;\n<span class=\"rem\">\/\/download the Publications and sort the Publications in descending order of Name<\/span>\npublicationContext.BeginExecute&lt;Publication&gt;(\n  <span class=\"kwrd\">new<\/span> Uri(<span class=\"str\">&quot;\/Publications?$expand=PublishedFrom&amp;$orderby= Name desc&quot;<\/span>, UriKind.Relative),\n(asResult) =&gt;\n  {\n  <span class=\"rem\">\/\/Dispatch the EndExecute call to the UI thread<\/span>\n  Dispatcher.BeginInvoke(\n   () =&gt;\n   {\n     var IEnumerableOfPublications = publicationContext.EndExecute&lt;Publication&gt;(asResult);\n     PublicationsGrid.ItemsSource = IEnumerableOfPublications.ToList();\n   }\n   );\n   }, userState);\n}<\/pre>\n<p>The \u201cLoad Publications Via Linq\u201d downloads entities via a Linq Query and the Click Handler looks like this : <\/p>\n<pre class=\"csharpcode\"><span class=\"kwrd\">void<\/span> btnLoadPublicationsLinq_Click(<span class=\"kwrd\">object<\/span> sender, RoutedEventArgs e)\n{\n <span class=\"kwrd\">object<\/span> userState = <span class=\"kwrd\">null<\/span>;\n <span class=\"rem\">\/\/download the Publications and sort the Publications in ascending order of Name<\/span>\n var publicationLinqQuery = (from pub <span class=\"kwrd\">in<\/span> <br \/>                       publicationContext.CreateQuery&lt;Publication&gt;(<span class=\"str\">&quot;Publications&quot;<\/span>)<br \/>                                                .Expand(<span class=\"str\">&quot;PublishedFrom&quot;<\/span>)\n                            orderby pub.Name ascending\n                            select pub) <span class=\"kwrd\">as<\/span> DataServiceQuery&lt;Publication&gt;;\npublicationLinqQuery.BeginExecute(\n (asResult) =&gt;\n {\n  <span class=\"rem\">\/\/Dispatch the EndExecute call to the UI thread<\/span>\n    Dispatcher.BeginInvoke(\n     () =&gt;\n     {\n      var IEnumerableOfPublications = publicationLinqQuery.EndExecute(asResult);\n      PublicationsGrid.ItemsSource =  IEnumerableOfPublications.ToList();\n      });\n      }, userState);\n  }<\/pre>\n<p>.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/p>\n<p>.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/p>\n<p>.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/p>\n<p>Clicking the \u201cInstall Me\u201d button installs the app and launches it Out Of Browser. \n  <br \/>Here is what the \u201cInstall Me\u201d button click handler looks like : <\/p>\n<p><\/p>\n<pre class=\"csharpcode\"><span class=\"rem\">\/\/\/ &lt;summary&gt;<\/span>\n<span class=\"rem\">\/\/\/ Installs the Silverlight application as an Out Of Browser application<\/span>\n<span class=\"rem\">\/\/\/ &lt;\/summary&gt;<\/span>\n<span class=\"kwrd\">void<\/span> InstallApplication(<span class=\"kwrd\">object<\/span> sender, RoutedEventArgs e)\n{\n  <span class=\"rem\">\/\/Install the app<\/span>\n  App.Current.Install();\n  <span class=\"rem\">\/\/Hide the &quot;Install Me&quot; button<\/span>\n  btnInstallOOBApp.Visibility = Visibility.Collapsed;\n }<\/pre>\n<p>.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/p>\n<p>.csharpcode, .csharpcode pre\n{\n\tfont-size: small;\n\tcolor: black;\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;\n\tbackground-color: #ffffff;\n\t\/*white-space: pre;*\/\n}\n.csharpcode pre { margin: 0em; }\n.csharpcode .rem { color: #008000; }\n.csharpcode .kwrd { color: #0000ff; }\n.csharpcode .str { color: #006080; }\n.csharpcode .op { color: #0000c0; }\n.csharpcode .preproc { color: #cc6633; }\n.csharpcode .asp { background-color: #ffff00; }\n.csharpcode .html { color: #800000; }\n.csharpcode .attr { color: #ff0000; }\n.csharpcode .alt \n{\n\tbackground-color: #f4f4f4;\n\twidth: 100%;\n\tmargin: 0em;\n}\n.csharpcode .lnum { color: #606060; }<\/p>\n<p>The buttons which do a Linq Query and a URI query still work , without any changes to the code . \n  <br \/><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image001%5B8%5D.jpg\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"clip_image001[8]\" border=\"0\" alt=\"clip_image001[8]\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2009\/09\/clip_image0015B85D_thumb.jpg\" width=\"640\" height=\"422\" \/><\/a><\/p>\n<h4>Debugging Out Of Browser Silverlight Applications<\/h4>\n<p>To debug your Out Of Browser Silverlight apps , follow these steps.<\/p>\n<p>1.&#160; Open the properties of the Silverlight application.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image002%5B10%5D.gif\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"clip_image002[10]\" border=\"0\" alt=\"clip_image002[10]\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2009\/09\/clip_image0025B105D_thumb.gif\" width=\"640\" height=\"341\" \/><\/a><\/p>\n<p>2. Select the Out Of Browser application which has the name of the project with the Page hosting the SL application. \n  <br \/>Which , in this case , is SilverlightApplicationHost.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image002%5B12%5D.gif\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"clip_image002[12]\" border=\"0\" alt=\"clip_image002[12]\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2009\/09\/clip_image0025B125D_thumb.gif\" width=\"435\" height=\"69\" \/><\/a><\/p>\n<p>3. Hit F5 and select yes when this prompt comes up. \n  <br \/>This prompt is warning you that you have a Service Reference to a Data Service. <\/p>\n<p>In In-Browser Silverlight apps , running the SL app directly will launch it off of the file system ( i.e c:ProjectsyourProjectPath), <\/p>\n<p>and you wont be able to make calls to data services&#160; as this would constitute a Cross-Scheme request and isn\u2019t allowed.<\/p>\n<p>While debugging your Out Of Browser Silverlight application, you can ignore this prompt.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/23\/2019\/02\/clip_image004_2.gif\"><img decoding=\"async\" style=\"border-right-width: 0px;border-top-width: 0px;border-bottom-width: 0px;border-left-width: 0px\" title=\"clip_image004\" border=\"0\" alt=\"clip_image004\" src=\"https:\/\/devblogs.microsoft.com\/odatateam\/wp-content\/uploads\/sites\/23\/2009\/09\/clip_image004_thumb.gif\" width=\"548\" height=\"240\" \/><\/a><\/p>\n<h4><\/h4>\n<h5>Is the SL3 Client HTTP stack used by the ADO.NET Data Services v1.5 CTP2 client library for all requests?<\/h5>\n<p>No, the SL3 Client Http Stack is only used for Out-Of-Browser and Cross-domain network access. \n  <br \/>The XmlHttp based stack is still used for In Browser, Same Domain network access to preserve backward compatibility. <\/p>\n<p>You can customize this by setting a new property on the client library called HttpStack. <\/p>\n<p>HttpStack which has 3 possible values: <\/p>\n<p><b>1. <\/b><b>Auto: <\/b>Client library decides when to switch networking stacks. <\/p>\n<p><b>2. <\/b><b>XmlHttp: <\/b>The classic networking stack based on XmlHttpRequest <\/p>\n<p><b>3. <\/b><b>ClientHttp: <\/b>The new SL3 Client HTTP&#160; stack <\/p>\n<p>The Default value is Auto, and you should leave it as it is, unless you need to customize the networking stack we use. \n  <br \/>When the HttpStack is set to Auto, the client library automatically switches the networking stack it uses to talk to <\/p>\n<p>the Data Service. <\/p>\n<h5>Should I set the HttpStack on the DataServiceContext instance so that I get X-Domain and OOB data access?<\/h5>\n<p>Nope, you can just leave the HttpStack property at Auto and we will figure out which stack to use and when. <\/p>\n<p>We use XmlHttp only in a scenario where the Silverlight XAP and the Data Service are hosted in the same domain. <\/p>\n<p>For other scenarios we use the ClientHttpStack. The below table is helpful in understanding when we automatically switch stacks. <\/p>\n<p>&#160;<\/p>\n<table style=\"background-color: #eeeeee\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n<tbody>\n<tr style=\"background-color: #99ccff\">\n<td valign=\"top\" width=\"179\">\n<p><b>Silverlight App<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"150\">\n<p><b>Data Service<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"136\">\n<p><b><i>Out Of Browser<\/i><\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"170\">\n<p><b>Networking stack<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"179\">\n<p><b><a href=\"http:\/\/foo.com\">http:\/\/foo.com<\/a><\/b><b><\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"150\">\n<p><a href=\"http:\/\/foo.com\">http:\/\/foo.com<\/a><\/p>\n<\/td>\n<td valign=\"top\" width=\"136\">\n<p><i>False<\/i><\/p>\n<\/td>\n<td valign=\"top\" width=\"170\">\n<p>XmlHttp&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"179\">\n<p><b><a href=\"http:\/\/foo.com\">http:\/\/foo.com<\/a><\/b><b><\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"150\">\n<p><a href=\"http:\/\/foo.com\">http:\/\/foo.com<\/a><\/p>\n<\/td>\n<td valign=\"top\" width=\"136\">\n<p><i>True<\/i><\/p>\n<\/td>\n<td valign=\"top\" width=\"170\">\n<p>ClientHttp<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"179\">\n<p><b><a href=\"http:\/\/UI.foo.com\">http:\/\/UI.foo.com<\/a><\/b><b><\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"150\">\n<p><a href=\"http:\/\/API.foo.com\">http:\/\/API.foo.com<\/a><\/p>\n<\/td>\n<td valign=\"top\" width=\"136\">\n<p><i>False\/True<\/i><\/p>\n<\/td>\n<td valign=\"top\" width=\"170\">\n<p>ClientHttp<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><b>Features VS Networking Stack <\/b><\/p>\n<p><strong><\/strong><\/p>\n<table style=\"background-color: #eeeeee\" border=\"0\" cellspacing=\"0\" cellpadding=\"5\">\n<tbody>\n<tr style=\"background-color: #99ccff\">\n<td valign=\"top\" width=\"245\">\n<p><b>Feature<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"180\">\n<p><b>XmlHttp<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"213\">\n<p><b>ClientHttp<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"245\">\n<p>Cross Domain Data Access<\/p>\n<\/td>\n<td valign=\"top\" width=\"180\">\n<p><b>No<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"213\">\n<p><b>Yes<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"245\">\n<p>Out Of Browser Data Access<\/p>\n<\/td>\n<td valign=\"top\" width=\"180\">\n<p><b>No<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"213\">\n<p><b>Yes<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"245\">\n<p>NTLM Based Authentication<\/p>\n<\/td>\n<td valign=\"top\" width=\"180\">\n<p><b>Yes<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"213\">\n<p><b>No<\/b>*<b><\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"245\">\n<p>Same Domain Data Access<\/p>\n<\/td>\n<td valign=\"top\" width=\"180\">\n<p><b>Yes<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"213\">\n<p><b>Yes<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"245\">\n<p>Cookie Based Authentication<\/p>\n<\/td>\n<td valign=\"top\" width=\"180\">\n<p><b>Yes<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"213\">\n<p><b>Yes<\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"245\">\n<p>Cookie store shared with browser<\/p>\n<\/td>\n<td valign=\"top\" width=\"180\">\n<p><b>Yes<\/b><\/p>\n<\/td>\n<td valign=\"top\" width=\"213\">\n<p><b>No<\/b>*<b><\/b><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>*We are working over the next few releases of Silverlight to extend the ClientHttp stack such that it supports \n  <br \/>all possible scenarios.<\/p>\n<h4>Authentication Schemes supported<\/h4>\n<p>With the new networking stack, in X-Domain and OOB scenarios, the client library is now restricted to the same options as any other application that uses the SL3 networking stack. \n  <br \/>The main concern is that NTLM based authentication schemes such as <b><i>Windows Authentication or BASIC Authentication are not supported in X-Domain and Out Of Browser scenarios<\/i><\/b>. <\/p>\n<p>The only authentication schemes that are supported are cookie-based authentication schemes such as ASP.NET Forms Authentication. <\/p>\n<p>An example of using the new client library with ASP.NET Forms Authentication will be shown in Part II of this blog post.<\/p>\n<p>You can download the sample application shown here at the bottom of the post.<\/p>\n<p>Phani Raj \n  <br \/>Engineer, ADO.NET Data Services .<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With the release of ADO.NET Data Services v1.5 CTP2, you can now use the Silverlight Astoria client library to access Cross-Domain services and applications written with the new client library can go out of browser. The new Client Http networking stack introduced in SL3 supports the standard and custom HTTP Verbs(GET\/PUT\/POST\/DELETE\/MERGE) as well as access [&hellip;]<\/p>\n","protected":false},"author":512,"featured_media":3253,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1673","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-odata"],"acf":[],"blog_post_summary":"<p>With the release of ADO.NET Data Services v1.5 CTP2, you can now use the Silverlight Astoria client library to access Cross-Domain services and applications written with the new client library can go out of browser. The new Client Http networking stack introduced in SL3 supports the standard and custom HTTP Verbs(GET\/PUT\/POST\/DELETE\/MERGE) as well as access [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/1673","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/users\/512"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/comments?post=1673"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/posts\/1673\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media\/3253"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/media?parent=1673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/categories?post=1673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/odata\/wp-json\/wp\/v2\/tags?post=1673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}