{"id":5533,"date":"2007-08-30T16:53:00","date_gmt":"2007-08-30T16:53:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vbteam\/2007\/08\/30\/a-walkthrough-of-wcf-support-in-visual-studio-2008\/"},"modified":"2024-07-05T14:41:26","modified_gmt":"2024-07-05T21:41:26","slug":"a-walkthrough-of-wcf-support-in-visual-studio-2008","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/vbteam\/a-walkthrough-of-wcf-support-in-visual-studio-2008\/","title":{"rendered":"A Walkthrough of WCF Support in Visual Studio 2008"},"content":{"rendered":"<p><font face=\"Calibri\" size=\"3\"><\/p>\n<p>One feature in Visual Studio 2008 I would like to highlight is our support of Windows Communication Foundation. WCF was introduced with .NET Fx3.0 as a next generation communications API. Previously if you wanted apps to talk you needed to make a lot of up-front decisions:<\/p>\n<p><font face=\"Courier New\" size=\"2\"><\/p>\n<p>o <\/p>\n<p><\/font><font face=\"Calibri\" size=\"3\">How important is transmission speed?<br \/><\/font><font face=\"Courier New\" size=\"2\">o <\/font><font face=\"Calibri\" size=\"3\">How will apps talk? Over the internet, intranet, or on the same machine?<br \/><\/font><font face=\"Courier New\" size=\"2\">o <\/font><font face=\"Calibri\" size=\"3\">Is reliable messaging important?<br \/><\/font><font face=\"Courier New\" size=\"2\">o <\/font><font face=\"Calibri\" size=\"3\">Is message encryption important?<\/p>\n<p>Once you made those decisions and started writing your app you were forced to learn a new protocol {.Net Remoting, ASMX web services, MSMQ, Named Pipes, etc.} and implement a solution specific to that API. The problem with this is that your code doesn&rsquo;t age gracefully. If the requirements change too much, you need to rewrite the entire communication layer using an API which supports whatever mission-critical feature you need.<\/p>\n<p>WCF fixes this problem and more by providing a unified programming model for all the above scenarios so you now just have to learn one API and toolset. It does this by separating the various pieces of communication, E.g., protocols, message contracts, etc. Rather than worrying about the specifics of how each message is transferred between client and server, WCF just asks you to focus on the service and message contracts. That is, what methods will you be able to call from a client and the structure of the data returned. All the goo about communication protocols is highly configurable and out of code (in the app.config). That is WCF from a mile-high view, but let&rsquo;s dive into what it can do for you in Visual Studio 2008.<\/p>\n<p>We will be creating a three-tiered application called Northwind Traders. Our solution will comprise of four projects: a data access layer, a WCF service, a WinForms client, and a shared business logic component. Along the way we will highlight key features new to Visual Studio 2008 and demonstrate just how easy it is to write killer data-centric apps.<\/p>\n<p><b>\n<\/b><\/p>\n<p><\/font><font face=\"Calibri\" color=\"#4f81bd\" size=\"4\">Creating Data Access Layer<\/font><font face=\"Calibri\"><\/p>\n<p><font size=\"3\">Let&#8217;s start our app by creating a data access layer by creating a new class library aptly titled DataAccessLayer. <\/font><\/p>\n<p><font size=\"3\">One of the common problems developing N-tier applications in Visual Studio, is that the tools put the TableAdapters and the typed DataSets in the same project. Which unfortunately leaks out sensitive information such as connection strings. If you wanted to reuse your typed DataSets but keep your TableAdapters private, you have to resort to fighting against the tools which doesn&rsquo;t provide a great developer experience. Fortunately in Visual Studio 2008 we&rsquo;ve addressed this.<\/font><\/p>\n<p><font size=\"3\">Once you&#8217;ve created the data access layer in Visual Studio 2008 you can configure the DataSet Designer to generate the DataSet code into a separate project in your solution. So you can share\/reuse your typed DataSets without exposing things like connection strings.<\/font><\/p>\n<p><font size=\"3\">Add another class library project to your solution called NorthwindBuisnessObjects.<\/font><\/p>\n<\/p>\n<p><\/font><font face=\"Calibri\"><font size=\"3\"><img decoding=\"async\" title=\"DataSet into Diff Project\" height=\"309\" alt=\"DataSet into Diff Project\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2007\/08\/1280360856_29d5ae7148.jpg\" width=\"500\"><\/font><\/font><\/p>\n<p><font face=\"Calibri\"><font size=\"3\">Then, reopen the NorthwindDataSet and change the &lsquo;DataSet Project&rsquo; property on the properties window to be NorthwindBuisnessObjects. Now, once you build your project, NorthwindDataSet.DataSet.Designer.vb will be generated in the NorthwindBuisnessObjects project.<\/font><\/font><\/p>\n<p><font size=\"3\">Next let&#8217;s add some simple validation logic to our DataSet. Double click the DataSet designer and insert the following code snippet. (Note that it automatically creates DataSet.vb in the correct project.)<\/font><\/p>\n<p><font face=\"Courier New\" color=\"#0000ff\" size=\"1\"><span><font color=\"#0000ff\" size=\"2\"><\/p>\n<p class=\"MsoNormal\"><span>Partial<\/span><span><font color=\"#000000\"> <\/font><span>Class<\/span><font color=\"#000000\"> NorthwindDataSet<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Partial<\/span><font color=\"#000000\"> <\/font><span>Class<\/span><font color=\"#000000\"> OrdersDataTable<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Private<\/span><font color=\"#000000\"> <\/font><span>Sub<\/span><font color=\"#000000\"> OrdersDataTable_OrdersRowChanging(<\/font><span>ByVal<\/span><font color=\"#000000\"> sender <\/font><span>As<\/span><font color=\"#000000\"> System.Object, <\/font><span>ByVal<\/span><font color=\"#000000\"> e <\/font><span>As<\/span><font color=\"#000000\"> OrdersRowChangeEvent) <\/font><span>Handles<\/span><font color=\"#000000\"> <\/font><span>Me<\/span><font color=\"#000000\">.OrdersRowChanging<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>End<\/span><font color=\"#000000\"> <\/font><span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Private<\/span><font color=\"#000000\"> <\/font><span>Sub<\/span><font color=\"#000000\"> OrdersDataTable_ColumnChanged(<\/font><span>ByVal<\/span><font color=\"#000000\"> sender <\/font><span>As<\/span><font color=\"#000000\"> <\/font><span>Object<\/span><font color=\"#000000\">, <\/font><span>ByVal<\/span><font color=\"#000000\"> e <\/font><span>As<\/span><font color=\"#000000\"> System.Data.DataColumnChangeEventArgs) <\/font><span>Handles<\/span><font color=\"#000000\"> <\/font><span>Me<\/span><font color=\"#000000\">.ColumnChanged<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>If<\/span><font color=\"#000000\"> e.Column.ColumnName = <\/font><span>Me<\/span><font color=\"#000000\">.OrderDateColumn.ColumnName <\/font><span>Or<\/span><font color=\"#000000\"> e.Column.ColumnName = <\/font><span>Me<\/span><font color=\"#000000\">.ShippedDateColumn.ColumnName <\/font><span>Then<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>ValidateDates(e.Row)<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>End<\/span><font color=\"#000000\"> <\/font><span>If<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>End<\/span><font color=\"#000000\"> <\/font><span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>&#8216;*********************************************<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>&#8216;CUSTOM VALIDATION CODE FOR MY DATASET<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>&#8216;*********************************************<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Private<\/span><font color=\"#000000\"> <\/font><span>Sub<\/span><font color=\"#000000\"> ValidateDates(<\/font><span>ByVal<\/span><font color=\"#000000\"> row <\/font><span>As<\/span><font color=\"#000000\"> OrdersRow)<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>If<\/span><font color=\"#000000\"> row.OrderDate &gt; row.ShippedDate <\/font><span>Then<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>row.SetColumnError(<\/font><span>Me<\/span><font color=\"#000000\">.OrderDateColumn, <\/font><span>&#8220;Can&#8217;t ship before it&#8217;s been ordered&#8221;<\/span><font color=\"#000000\">)<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>row.SetColumnError(<\/font><span>Me<\/span><font color=\"#000000\">.ShippedDateColumn, <\/font><span>&#8220;Can&#8217;t ship before it&#8217;s been ordered&#8221;<\/span><font color=\"#000000\">)<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Else<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>row.SetColumnError(<\/font><span>Me<\/span><font color=\"#000000\">.OrderDateColumn, <\/font><span>&#8220;&#8221;<\/span><font color=\"#000000\">)<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/span>row.SetColumnError(<\/font><span>Me<\/span><font color=\"#000000\">.ShippedDateColumn, <\/font><span>&#8220;&#8221;<\/span><font color=\"#000000\">)<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>End<\/span><font color=\"#000000\"> <\/font><span>If<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>End<\/span><font color=\"#000000\"> <\/font><span>Sub<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>End<\/span><font color=\"#000000\"> <\/font><span>Class<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span>End<\/span><span><font color=\"#000000\"> <\/font><span>Class<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\">\n<p><\/font><\/span><\/font><font face=\"Calibri\" size=\"3\"><\/font><\/p>\n<p>&nbsp;<\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">Let&rsquo;s finish our data access layer by adding a class called NorthwindManager, which connects to the database and returns our tables.<\/font><\/p>\n<p class=\"MsoNormal\"><font face=\"Calibri\" size=\"3\">&nbsp;<\/font><\/p>\n<p><font face=\"Courier New\" color=\"#0000ff\" size=\"1\"><\/p>\n<p class=\"MsoNormal\"><span>Imports<\/span><span><font color=\"#000000\"> NorthwindBuisnessObjects<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>Public<\/span><span><font color=\"#000000\"> <\/font><span>Class<\/span><font color=\"#000000\"> NorthwindManager<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Public<\/span><font color=\"#000000\"> <\/font><span>Shared<\/span><font color=\"#000000\"> <\/font><span>Function<\/span><font color=\"#000000\"> GetCustomers() <\/font><span>As<\/span><font color=\"#000000\"> NorthwindDataSet.CustomersDataTable<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Dim<\/span><font color=\"#000000\"> customerAdapter <\/font><span>As<\/span><font color=\"#000000\"> <\/font><span>New<\/span><font color=\"#000000\"> NorthwindDataSetTableAdapters.CustomersTableAdapter()<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Return<\/span><font color=\"#000000\"> customerAdapter.GetData()<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>End<\/span><font color=\"#000000\"> <\/font><span>Function<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Public<\/span><font color=\"#000000\"> <\/font><span>Shared<\/span><font color=\"#000000\"> <\/font><span>Function<\/span><font color=\"#000000\"> GetOrders() <\/font><span>As<\/span><font color=\"#000000\"> NorthwindDataSet.OrdersDataTable<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Dim<\/span><font color=\"#000000\"> orderAdapter <\/font><span>As<\/span><font color=\"#000000\"> <\/font><span>New<\/span><font color=\"#000000\"> NorthwindDataSetTableAdapters.OrdersTableAdapter()<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Return<\/span><font color=\"#000000\"> orderAdapter.GetData()<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>End<\/span><font color=\"#000000\"> <\/font><span>Function<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>End<\/span><span><font color=\"#000000\"> <\/font><span>Class<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p>&nbsp;<\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\">\n<p><\/font><b><font face=\"Calibri\" color=\"#4f81bd\" size=\"4\">Creating a WCF Service<\/font><\/b><font face=\"Calibri\" size=\"3\"><\/p>\n<p>Now let&#8217;s move onto creating our WCF service. The tooling support should be on par with the ASMX Web Reference experience. Let&rsquo;s begin by creating a new WCF Web Service project, which creates a new WCF service hosted in IIS.<\/p>\n<p><strong><img decoding=\"async\" title=\"New Website Dialog\" height=\"326\" alt=\"New Website Dialog\" src=\"https:\/\/devblogs.microsoft.com\/vbteam\/wp-content\/uploads\/sites\/7\/2007\/08\/1279495891_615e9fe4b2.jpg\" width=\"500\"><\/strong><\/p>\n<\/p>\n<p><\/font><font face=\"Calibri\" size=\"3\">Note that WCF doesn&#8217;t have to just be a web-based service. In Visual Studio 2008 we also have project templates for service libraries, which are WCF services baked into class libraries. In addition we have a Test Form which allows you to debug you WCF services (not discussed here).<\/p>\n<p>Once our service project has been created, let&#8217;s add references to both our DataAccessLayer and BuisnessObjects projects.<\/p>\n<p>Next, let&rsquo;s replace the default service contract from the project template with our own. Those &lt;ServiceContract()&gt; and &lt;OperationContract()&gt; interfaces indicate to the WCF runtime that this is a WCF service contract. <\/p>\n<p><\/font><font face=\"Courier New\" color=\"#0000ff\" size=\"1\"><\/p>\n<p class=\"MsoNormal\"><span>Imports<\/span><span><font color=\"#000000\"> NorthwindBuisnessObjects<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\">&lt;ServiceContract()&gt; _<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span>Public<\/span><span><font color=\"#000000\"> <\/font><span>Interface<\/span><font color=\"#000000\"> IService<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\"><span>&nbsp;&nbsp;&nbsp; <\/span>&lt;OperationContract()&gt; _<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Function<\/span><font color=\"#000000\"> GetCustomers() <\/font><span>As<\/span><font color=\"#000000\"> NorthwindDataSet.CustomersDataTable<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\"><span>&nbsp;&nbsp;&nbsp; <\/span>&lt;OperationContract()&gt; _<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Function<\/span><font color=\"#000000\"> GetOrders() <\/font><span>As<\/span><font color=\"#000000\"> NorthwindDataSet.OrdersDataTable<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>End<\/span><span><font color=\"#000000\"> <\/font><span>Interface<\/p>\n<p><\/span><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><\/span><\/p>\n<\/p>\n<p><\/font><font face=\"Calibri\" size=\"3\">Let&rsquo;s change the service contract implementation accordingly.<b><\/b><\/font><font face=\"Courier New\" color=\"#0000ff\" size=\"1\"><\/p>\n<p class=\"MsoNormal\"><span>Imports<\/span><span><font color=\"#000000\"> NorthwindBuisnessObjects<\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><font color=\"#000000\"><span>Imports<\/span><span><font color=\"#000000\"> DataAccessLayer<\/font><\/span><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span>Public<\/span><span><font color=\"#000000\"> <\/font><span>Class<\/span><font color=\"#000000\"> Service<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Implements<\/span><font color=\"#000000\"> IService<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\"><span><span><font color=\"#000000\">&nbsp;&nbsp;&nbsp; <\/font><\/span><span>Public<\/span><font color=\"#000000\"> <\/font><span>Function<\/span><font color=\"#000000\"> GetCustomers() <\/font><span>As<\/span><font color=\"#000000\"> NorthwindDataSet.CustomersDataTable <\/font><span>Implements<\/span><font color=\"#000000\"> IService.GetCustomers<\/p>\n<p><\/font><\/span><\/p>\n<p class=\"MsoNormal\"><span><\/p>\n<p><font color=\"#000000\">&nbsp;<\/font><\/p>\n<p><\/span><\/p>\n<p class=\"MsoNormal\" style=\"MARGI\">\n<p><\/font><\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One feature in Visual Studio 2008 I would like to highlight is our support of Windows Communication Foundation. WCF was introduced with .NET Fx3.0 as a next generation communications API. Previously if you wanted apps to talk you needed to make a lot of up-front decisions: o How important is transmission speed?o How will apps [&hellip;]<\/p>\n","protected":false},"author":260,"featured_media":8818,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[192,195],"tags":[82,177],"class_list":["post-5533","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-featured","category-visual-basic","tag-john-stallo","tag-wcf"],"acf":[],"blog_post_summary":"<p>One feature in Visual Studio 2008 I would like to highlight is our support of Windows Communication Foundation. WCF was introduced with .NET Fx3.0 as a next generation communications API. Previously if you wanted apps to talk you needed to make a lot of up-front decisions: o How important is transmission speed?o How will apps [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts\/5533","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/users\/260"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/comments?post=5533"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/posts\/5533\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/media\/8818"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/media?parent=5533"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/categories?post=5533"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/vbteam\/wp-json\/wp\/v2\/tags?post=5533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}