WcfRiaServicesWinforms

所属分类:其他
开发工具:C#
文件大小:10399KB
下载次数:71
上传日期:2011-05-23 10:41:32
上 传 者orichisonic
说明:  应用SilverLight 4.0的WCF RIA SERVICES实现服务并且开发给Winform实现调用
(This sample demonstrates how to use WCF RIA Services to query data, update data, integrate MVVM, write metadata classes, share code and validate data. And it shows that how to authenticating and authorizing call in the WCF RIA Services. Finally it is important that this sample demonstrates how to expose additional domain service endpoints for other clients, So that you can use the client based on WPF or WINFORM to invoke the method via WCF RIA Services.)

文件列表:
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms (0, 2011-04-27)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\CSWcfRiaServicesWinforms.sln (3756, 2011-04-27)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\CSWcfRiaServicesWinforms.suo (73728, 2011-04-29)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.sql (12348, 2010-09-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.suo (34816, 2011-04-25)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web (0, 2011-04-26)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\aspnet_client (0, 2011-04-26)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\aspnet_client\system_web (0, 2011-04-26)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\aspnet_client\system_web\4_0_30319 (0, 2011-04-25)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\Authentication.cs (5868, 2010-09-10)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin (0, 2011-04-29)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\30631ab9-e84c-48f1-b15a-6d0c25490f2a (52736, 2011-04-25)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\454444c6-eeb2-498d-9d77-4436be736542 (53248, 2011-04-25)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\75c50d8c-c5fa-4c20-a559-09f849f7ba29 (53248, 2011-04-26)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\84906454-80ed-4309-a133-dfddd81a4a78 (53248, 2011-04-26)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\977a4927-239c-4e08-9e22-cfba1f66cb06 (53248, 2011-04-26)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\de (0, 2011-04-28)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\de\System.ServiceModel.DomainServices.EntityFramework.resources.dll (11112, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\de\System.ServiceModel.DomainServices.Hosting.resources.dll (16232, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\de\System.ServiceModel.DomainServices.Server.resources.dll (34664, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\e4458f32-5fd7-41b3-b6b5-b01b32f7dddb (53248, 2011-04-25)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\ed923540-fb27-4ad0-95f7-cd1829ad1872 (53248, 2011-04-25)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\es (0, 2011-04-28)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\es\System.ServiceModel.DomainServices.EntityFramework.resources.dll (11112, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\es\System.ServiceModel.DomainServices.Hosting.resources.dll (16232, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\es\System.ServiceModel.DomainServices.Server.resources.dll (33640, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\fr (0, 2011-04-28)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\fr\System.ServiceModel.DomainServices.EntityFramework.resources.dll (11112, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\fr\System.ServiceModel.DomainServices.Hosting.resources.dll (16232, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\fr\System.ServiceModel.DomainServices.Server.resources.dll (35176, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\it (0, 2011-04-28)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\it\System.ServiceModel.DomainServices.EntityFramework.resources.dll (11112, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\it\System.ServiceModel.DomainServices.Hosting.resources.dll (16232, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\it\System.ServiceModel.DomainServices.Server.resources.dll (33640, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\ja (0, 2011-04-28)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\ja\System.ServiceModel.DomainServices.EntityFramework.resources.dll (11112, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\ja\System.ServiceModel.DomainServices.Hosting.resources.dll (16744, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\ja\System.ServiceModel.DomainServices.Server.resources.dll (37736, 2011-01-14)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\ko (0, 2011-04-28)
WcfRiaServicesWinforms\CSWcfRiaServicesWinforms\TaskManager.Web\bin\ko\System.ServiceModel.DomainServices.EntityFramework.resources.dll (11112, 2011-01-14)
... ...

==================================================================================================== Windows APPLICATION: CSWcfRiaServicesWinfroms Overview ==================================================================================================== //////////////////////////////////////////////////////////////////////////////////////////////////// Summary: This sample demonstrates how to use WCF RIA Services to query data, update data, integrate MVVM, write metadata classes, share code and validate data. And it shows that how to authenticating and authorizing call in the WCF RIA Services. Finally it is important that this sample demonstrates how to expose additional domain service endpoints for other clients, So that you can use the client based on WPF or WINFORM to invoke the method via WCF RIA Services. //////////////////////////////////////////////////////////////////////////////////////////////////// Demo: Step1. Build the “Taskmanager” project and the “TaskManager.Web” project concurrently in VS2010. Step2. Enter Control Panel and double click Internet Information Services (IIS) Manager included in Administrative Tools. Step3. Left Click the "Sites" tree node included in Internet Information Services(IIS) Manager in order to expand it and right Click it mentioned above in order to select the "Add Web Site..." menu item in the next menu. Step4. Hit the "TaskManager" text into the Textbox behind the label prompt written as "Site name:" and left click the "..." button included in the "Content Directory" group box in order to select the virtual web directory, In this sample you can select the directory written as "TaskManager.Web". Step5. Left click the "Application Pools" tree node included in Internet Information Services(IIS) Manager in order to change its framework version. You can double click the "TaskManager" column Item and change ".NET Framework v2.0.50727" into ".NET Framework v4.0.30319". Finally left click the "OK" button to take effect. Note: If you install the IIS behind the installed of vs2010, you should run the following order within Command Window: systemroot\Microsoft.NET\Framework\ versionNumber \aspnet_regiis -i. Step6. Open Microsoft SQL Server Management Studio. Step7. Open the script file looks like “TaskManager.sql” included in the sample "CSWcfRiaServicesWinforms" and run it with Microsoft SQL Server Management Studio. Step8. Rerun VS2010 using Administrator permission and open the project solution "CSWcfRiaServicesWinforms". Step9. Double click the project name written as "TaskManager.Web" and double click the entity data model file looks like "TasksModel.edmx". Step10. Right click the popup Visualization form and select the "Update Model From Database" menu item at the next menu. Step11. Bind the connect string with the database generated by Step7 and click the "Finish" button to update the entity data model, otherwise you can't get data from SQL database. Step12. Right click "TaskManager.Web" project’s tree node and select the "Publish..." menu item at the next menu.Consequently, Hit the "localhost" text behind the "Service URL:" label prompt and hit the "TaskManager" text behind the "Site/application:" label prompt. Finally, left click the "Publish" button with selecting the "Mark as IIS application on destination" Checkbox. Notes: If you want to deploy the WCF RIA Service to domain service machine not using local machine, you should select the deployed namespace and change the property item "Copy Local" into "True" at the Property Window listed below. If you don't use administrator permission to open the project solution, you can't publish WCF RIA SERVICE into the IIS. It is because that deploying the website should have write permission. Step13. Double click the "Service References" tree node included in the "WpfApp" project and click the "Update Service Reference" menu item. //////////////////////////////////////////////////////////////////////////////////////////////////// Code Logic: 1. The sample demonstrates how to apply WCF RIA Services. RIA Services helps you to write one set of server code, but have appropriate parts of that service code available on the client without having to duplicate it or write client side to access it. On the server side. WCF RIA Services helps you define your services, domain entities, and supporting logic. On the client side, WCF RIA Services code generates corresponding classes that let you easily call those services, have the same entities available and populated on the client side, along with supporting validation logic and other kinds of code that you can share between the client and the service side. 2. The sample demonstrates how to expose a soap endpoint from your domain service. The other topics you can access the website as follows: http://www.silverlightshow.net/items/WCF-RIA-Services-Part-1-Getting-Started.aspx If you want to expose it in order to invoke it by other client side, you can enter the web.config included in the "TaskManager.Web" project. And you can add the section Group to the web.config file looks like this: Certainly, you can add additional information to the web.config file looks like this:
It must be putted behind the xml node "", otherwise the "domainServices" node can’t be recognized by compiler. 3. You will also need to add a reference in the web host to Microsoft.ServiceModel.DomainServices.Host, which is where the SoapXmlEndpointFactory type is defined as you can see from the config code above. That endpoint does have metadata turned on, so clients can easily generate client proxy code from the endpoint like they would from any other WCF service. The address that this endpoint is exposed on is just the base domain service address with /soap appended to it. The WCF RIA SERVICE Toolkit, the WCF RIA SERVICE SP1 and Silverlight 4.0 should be installed by customer at the beginning of the running solution. It is because that the first of WCF RIA SERVICE package has some issues in it and WCF RIA SERVICE includes in the Silverlight 4.0 installation package actually. //////////////////////////////////////////////////////////////////////////////////////////////////// References: WCF RIA Services Part 1: Getting Started http://www.silverlightshow.net/items/WCF-RIA-Services-Part-1-Getting-Started.aspx ////////////////////////////////////////////////////////////////////////////////////////////////////

近期下载者

相关文件


收藏者